Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speed: VFP 6 vs VB
Message
 
 
To
12/09/1998 01:24:20
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00135486
Message ID:
00136205
Views:
29
Albert,

I didn't try strstream, I didn't know that would keep the whole 100k string available. I did try fixing the CString buffer size it doesn't change the performance much at all.

FWIW bagging the CString and replacing it a more special case (i.e. predefined buffer size char)
int CStrtestdllApp::test3()
{
char cTest[100100];
char *ap;

ap = cTest;
int i;
clock_t tStart;
tStart = clock();
for ( i = 0; i < 10000; i++ )
   {
   sprintf( ap, "%10d", i );
   ap += 10;
   }
tStart = ( clock() - tStart );
return (int)tStart;
}
And the code executes in 0.05 seconds, on par with the VFP6 code.

>Compared to VFP 5.0a, the C++ takes aprox. half the time. See how VFP 6.0 fairs.
>
>The C++ io stream classes are capable of doing easy formatting much more flexibly than the old C stdio functions.
>
>This example could be faster if the max size of the string were set so dynamic memory allocation is not necessary.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform