Re: [fpc-pascal] ShortString still relevant today?

2023-07-04 Thread Guillermo Martínez Jiménez via fpc-pascal
Hi, I'm not sure but I think that CPU caches (L1, L2...) have some impact on this example. Also I think PChar assignation should use string copy instead (Strings.strcopy). Not time to do my own tests right now though u_u) . Regards, Guillermo "Ñuño" Martínez El Tue, 4 Jul 2023 11:46:42 +0700

Re: [fpc-pascal] ShortString still relevant today?

2023-07-03 Thread Hairy Pixels via fpc-pascal
Here is my test unit I'm playing with. It's crude but can anyone suggest what other things I could test? I'm playing with a string pointer also to see how ref counting/finalization plays in. Making your own managed typed using management operators is not tested but I'm sure it will be

Re: [fpc-pascal] ShortString still relevant today?

2023-07-03 Thread Hairy Pixels via fpc-pascal
> On Jul 4, 2023, at 10:11 AM, Nikolay Nikolov via fpc-pascal > wrote: > > ShortString is mainly for compatibility with Turbo Pascal, not for > performance, IMHO. Although the FPC compiler itself still uses ShortString > for performance reasons (I think the main advantage is the avoidance

Re: [fpc-pascal] ShortString still relevant today?

2023-07-03 Thread Nikolay Nikolov via fpc-pascal
On 7/4/23 04:19, Hairy Pixels via fpc-pascal wrote: I've been exploring the string types and I'm curious now, does the classic Pascal "ShortString" even make sense anymore on modern computers? I'm running tests and I can't seem to find a way in which AnsiString overall performs worse than

[fpc-pascal] ShortString still relevant today?

2023-07-03 Thread Hairy Pixels via fpc-pascal
I've been exploring the string types and I'm curious now, does the classic Pascal "ShortString" even make sense anymore on modern computers? I'm running tests and I can't seem to find a way in which AnsiString overall performs worse than ShortString. Are there any examples where AnsiString is