Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP versus C++
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00842594
Message ID:
00851350
Views:
15
Hi John,

>Just out of curiosity, have you benchmarked VFP 8 and C++ when finding the number of occurences of Anna in a text file of War and Peace?

No, but I wouldn't expect much of a difference here. The OCCURS() function is written in C++ and can just as quickly scan the text. What slows VFP down is basically:

a) You cannot specify a size for a string but only use part of that allocated memory. Every time you extend a string, VFP needs to allocate new memory.

b) You can't easily access individual characters or substrings. You have to use SUBSTR() and STUFF(). Especiall, STUFF is slow because

c) VFP has no concept of manipulating an existing string. Every string function that manipulates a string returns a new one as a result. Due to the number of string copy operations, manpipulating large strings in VFP is comparable slow.

--
Christof
--
Christof
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform