Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Are vbscript classes fast?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,59769
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Are vbscript classes fast?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Are vbscript classes fast? - 5/3/2008 3:37:25 AM   
  atwork8

 

Posts: 5
Score: 0
Joined: 5/2/2008
Status: offline
Hi there,
Just found these forums and my first post, so hi all

I'm doing some work with vbscript just now and had a quick question I hope somebody could help with...

Say I have a few functions for accessing a database e.g. openDBConn, closeDBConn, openRs, closeRs, getRsAsArray, executeSql, getDbConnString etc

I could put these functions in to an include file "incDbHelper.asp" and include the file in any page that needs database functionality... or I could create a class "clsDbhelper.asp" which again I would include in any page that needs it. Now once the files have been included, to access the functions I could do:

executeSQL("select * form table")

or

(if my db class is called Database)

set db = new Database
db.executeSQL("select * form table")

So my question is what is the best method? Using a class seems like extra overhead for nothing? I've had a search around google but couldn't find anything on performance issues when using classes. Does anybody have an experience they could help me out with?

Thanks in advance for any help
 
 
Post #: 1
 
 RE: Are vbscript classes fast? - 5/3/2008 12:52:08 PM   
  TNO


Posts: 1040
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
The class structure takes slightly longer to initialize (measured in nanoseconds) but you will never notice this difference. In comparison to a simple list of functions this is negligible.

As for what you SHOULD do... use the Class structure. Name collisions are something you should keep in mind.

_____________________________

Consolidated Script Component: The Acid Test

A universe of complexity...

(in reply to atwork8)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Are vbscript classes fast? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts