Front page | perl.perl5.porters |
Postings from February 2000
Tie::VecArray
From:
Michael G Schwern
Date:
February 21, 2000 00:56
Subject:
Tie::VecArray
Message ID:
20000221035324.A5491@blackrider.aocn.com
I just threw together Tie::VecArray 0.01 and put it on CPAN. Its been
sitting at the top of the Todo list for so long I figured somebody
should just do it.
Its a fairly simple implementation leaving most of the hard stuff to
Tie::Array. I'll optimize POP, PUSH, and SPLICE later. I could
tighten down the use of memory a smidge by using a scalar for the
object instead of a pseudohash (placing object information in the
first 128 bits) but I don't think that's really necessary.
Tie::VecArray can't do multidimensional tied vectors, but I can pull
it off. I'll add a Tie::VecArray::MultiD subclass in a few days. You
guys decide if its worth putting into the core.
Oh, its really slow. *Really* slow. About 8 times slower than vec()
access. (Using the object directly is about 3 times slower). This
coincides with the expected sluggishness of the tie interface.
Tie::SubstrArray isn't far off, they should be very similar.
-
Tie::VecArray
by Michael G Schwern