[fpc-devel] Generics.Collections as package for Lazarus or package for FPC RTL

Marco van de Voort marcov at stack.nl
Fri Jan 29 17:24:20 CET 2016


In our previous episode, Sven Barth said:
> > Interfaces are relatively slow. Not only because of the refcounting, but
> > returning interfaces in a tight loop (e.g. to get the elements of an
> > enumeration) would be a new allocation each time.
> 
> Note: the enumerator of a for-in is only fetched once before the loop, so
> it does not really matter whether it's an interface or record as long as
> the elements themselves aren't on demand allocated interfaces.

The trouble is that you then have to avoid for-in for many potentially small
iterations as in the hash case.



More information about the fpc-devel mailing list