Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need a simple FLL
Message
 
 
To
20/09/2006 04:42:42
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01154766
Message ID:
01155502
Views:
27
Thomas,

I was only testing a string that long to get a measurable execution time using seconds(). The relative performance difference is still the same if shorter strings are escaped. Whether or not it's an appreciable difference overall depends on how heavily the site is hit. But honestly it sounds like this code should only be called once to convert a chunk of source code, which would then be stuffed into the page.

There's also the matter of which chunk of code presented here is the most readable. My 16 lines could go down to 9 or less depending on your brace style. But I chose to separate lines out that set up the pointers because I think it's clearer to see the intent. Far too much C/C++ code out there is self obfuscated! *L* And it really shows the power of being able to just run a pointer from one end of the string to the other instead of making some function call to to extract one character at a time.

Also this escape obfuscation would only annoy a script kiddie for a moment or two that it would take to turn it back into readable Java. *s*

>no doubt that C/C++ code will beat VFP at character handling in naerly all cases. But somehow I doubt that the OP's " relatively large ascii strings " are supposed to be in the range all of you were testing - I got the impression that it was more a case of URL-mangling. Especially since the C is not terribly difficult, the fact that such a question was asked smells of premature optimization to add such tiny bits into a project where probably no C/C++ skills exist.
>
>Consider that the speed difference of different implementation strategies might vary with the string length<bg>. For instance the "horrible" Substr() performance compared to heap-allocated memory comes into play only around 2**9 bytes - most URL's are shorter. The part where C++ "shines" will be relatively smaller, even if all non-naive implementations approach linear cost factor.
>
>I *do* hope that "portions of web pages that are intentionally obfuscated" are each not that large, as the tripled lenght has to sent even in todays DSL-times...
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