[fpc-pascal] FPC_PCHAR_LENGTH dog slow
wkitty42 at windstream.net
wkitty42 at windstream.net
Tue Jul 3 19:30:49 CEST 2018
On 07/03/2018 12:01 PM, Tomas Hajny wrote:
> On Tue, July 3, 2018 17:15, Ryan Joseph wrote:
>> Why is that so crazy slow? Does it need to iterate the entire length of the
>> string to know it’s length? >
> Yes, that's indeed the difference between Pascal strings
> (Short/Ansi/Wide/UnicodeString) and C-like PChars.
absolutely! i truly hated having to add loops to my string handling code when
working with ""C strings"" as we used to call them back in the day... the huge
advantage of "Pascal strings" is their length being specified at the beginning
of the character array they are stored in...
i think i'm still waiting for the string "length byte" becoming a "length word"
or possibly a "length long" so the speed of pascal strings can be reacquired -=B-)
--
NOTE: No off-list assistance is given without prior approval.
*Please keep mailing list traffic on the list unless*
*a signed and pre-paid contract is in effect with us.*
More information about the fpc-pascal
mailing list