On 17.08.2017 14:43, Sven Barth via Lazarus wrote:

Yes it does, because without optimizations implemented and enabled the compiler would need to do this for each element access.

But it does not need to do a function call. If getting the element size of a string is a pascal function it would be built-in.

Moreover I suppose (or suggest) that pos() is a built-in function that in fact can use decently optimized code.

Also a library function could use optimized pascal code that reads the element size, stores it in a variable and uses a pointer within the loop.

Of course a user function would just do s[x] and see some degradation.

-Michael

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to