[Lazarus] dynamic string proposal
Michael Schnell
mschnell at lumino.de
Thu Aug 17 11:41:10 CEST 2017
On 17.08.2017 11:29, Sven Barth via Lazarus wrote:
>
> Am 17.08.2017 11:11 schrieb "Michael Schnell via Lazarus"
> <lazarus at lists.lazarus-ide.org <mailto:lazarus at lists.lazarus-ide.org>>:
> >
> > Maybe, Sven could answer to this mail in the other thread...
> >
>
> I provided an example in my answer to Tony Whyman in the same
> subbranch of the thread.
>
I suppose you mean this:
> In a tight loop where one accesss the string character by character
> (take Pos() for example) this will lead to a significant slowdown as the
> compiler (without optimizations) will have to insert a call to the
> lookup function for each access. While I generally don't consider
> performance degradation as a backwards compatibility issue I do in this
> case, due to the significant decrease in performance.
This is not applicable to the "DynamicString" discussed here. With that,
"pos" would just need to use the "bytes per element" value taken (once)
from the the String header, instead of a value supplied at compile time.
I don't think that this can introduce a considerable performance hit.
-Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170817/3b2e3333/attachment.html>
More information about the Lazarus
mailing list