Am 17.08.2017 11:41 schrieb "Michael Schnell via Lazarus" < lazarus@lists.lazarus-ide.org>: > > On 17.08.2017 11:29, Sven Barth via Lazarus wrote: >> >> Am 17.08.2017 11:11 schrieb "Michael Schnell via Lazarus" < lazarus@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.
Yes it does, because without optimizations implemented and enabled the compiler would need to do this for each element access. Regards, Sven
-- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus