[fpc-pascal] FPC_PCHAR_LENGTH dog slow

Tomas Hajny XHajT03 at hajny.biz
Tue Jul 3 18:01:05 CEST 2018


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 indeed the difference between Pascal strings
(Short/Ansi/Wide/UnicodeString) and C-like PChars.

Tomas





More information about the fpc-pascal mailing list