On 21 Mar 2010, at 21:07, Jorge Aldo G. de F. Junior wrote:

> actually, for most porpuses, ansistring is a lot faster than normal
> strings with size 255...
> 
> you pass around 4 bytes instead of 256...

And on the downside the compiler inserts a lot of initialisation/finalisation 
and reference increment/decrement code for ansistrings (which use atomic 
operations and hence are fairly slow), and if you use var/out/const parameters 
then the compiler will also pass around pointers to shortstrings instead of 
copying them all the time.

Unless you are assigning long strings to each other all the time (or if your 
string parameters are all value parameters even though you don't change them), 
I don't think ansistrings are much if any faster than shortstrings. In fact, 
the compiler internally uses shortstrings instead of ansistrings in a lot of 
places exactly because of speed reasons.


Jonas_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to