StringList micro optimization

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

StringList micro optimization

Free Pascal - General mailing list
Procedure TStrings.SetDelimitedText(const AValue: string);  has about 16
calls to Length(AValue), so make a variable NLen to speed up it.

--
Regards,
Alexey

_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: StringList micro optimization

Michael Van Canneyt


On Fri, 8 Nov 2019, AlexeyT via fpc-pascal wrote:

> Procedure TStrings.SetDelimitedText(const AValue: string);  has about 16
> calls to Length(AValue), so make a variable NLen to speed up it.

Optimized, thanks for the hint.

Also reworked it so AddDelimitedText reuses DelimitedText code, no temp stringlist is created
any more.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal