Re: [fpc-pascal] FPC_PCHAR_LENGTH dog slow

2018-07-03 Thread wkitty42
On 07/03/2018 01:44 PM, leledumbo via fpc-pascal wrote: 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-) > Ansi and any other dynamic strings already have length longint that allows

Re: [fpc-pascal] FPC_PCHAR_LENGTH dog slow

2018-07-03 Thread leledumbo via fpc-pascal
> 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-) Ansi and any other dynamic strings already have length longint that allows 2GB string length with O(1) length retrieval. --

Re: [fpc-pascal] FPC_PCHAR_LENGTH dog slow

2018-07-03 Thread wkitty42
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

Re: [fpc-pascal] FPC_PCHAR_LENGTH dog slow

2018-07-03 Thread Mattias Gaertner
On Tue, 3 Jul 2018 09:15:16 -0600 Ryan Joseph wrote: > I was just parsing something and found that a call to length on a pchar was > taking 90+% of the time in FPC_PCHAR_LENGTH. > > Why is that so crazy slow? Does it need to iterate the entire length of the > string to know it’s length? Yes.

Re: [fpc-pascal] FPC_PCHAR_LENGTH dog slow

2018-07-03 Thread Tomas Hajny
On Tue, July 3, 2018 17:15, Ryan Joseph wrote: > I was just parsing something and found that a call to > length on a pchar was taking 90+% of the time in > FPC_PCHAR_LENGTH. > > 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

[fpc-pascal] FPC_PCHAR_LENGTH dog slow

2018-07-03 Thread Ryan Joseph
I was just parsing something and found that a call to length on a pchar was taking 90+% of the time in FPC_PCHAR_LENGTH. Why is that so crazy slow? Does it need to iterate the entire length of the string to know it’s length? Regards, Ryan Joseph