[fpc-pascal] Variants vs. Variant Records

Florian Klaempfl F.Klaempfl at gmx.de
Sun Jul 24 11:42:51 CEST 2005


Agustin Barto wrote:
> I have to build some container classes (like java Vector) for a
> project. I was thinking on how to store some primitive values (so far
> I only need to store Integer, Real or Extended and ShortString) and I
> can't decide between variants (variant arrays) and variant records
> (dynamic arrays of variant records). Any hints?

Variant arrays, i.e. arrays _stored_ in variants are dog slow. A good
compromise is a dyn. array of variant:

var
  a : array of variant;


If you want real speed, using dyn. arrays of variant records is the best
solution of course.




More information about the fpc-pascal mailing list