Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

Fixed-length strings allocate and deallocate faster
[ All Languages » VB »  String]

Total Hit ( 2226)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


Fixed-length strings are generally slower than conventional strings, because all VB string functions and operators only recognize conventional strings, thus all fixed-length strings must be transparently converted to and from conventional strings.

However, arrays of fixed-length strings occupy a contiguous area of memory, therefore they can be allocated and released much faster than arrays of conventional strings. For instance, an array of 100,000 fixed-length strings of 30 characters each is allocated in about half a second (on a Pentium 233MHz machine), whereas it takes more than 8 seconds to initialize the same amount of variable-length strings with 30 blanks. The latter array can be erased in about 0.35 seconds, but the array of fixed-length strings is deallocated instantaneously. If your application deals with such huge string arrays, consider the convenience of using fixed-length strings to optimize the allocation and release phase.


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.