General information
Category:
COM/DCOM and OLE Automation
Title:
Memory Pre-Allocation Trick?
I have a VFP7 class with an empty string property. After instantiation, from 3 to 9 methods get called, and each concatenates 100-500 bytes in rapid succession, resulting in about a 5k stirng property when it's done. The caller consumes this string property before destroying the object.
Would it make sense to pre-allocate memory for the object by setting the string property to Space(8192), and on the first write set the property to the first string and then concatenate after that?
I am thinking that the object would run "faster" because the OS (or runtime) would not have to grow the stack space for the object as it runs. This is for a web app where I have potentially 60-70 objects going at any given second.
Thanks.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only