Dan Sugalski <[EMAIL PROTECTED]> wrote: > SArray and Array PMCs, in addition to being sparse (which has some > overhead), allow you to really store PMC *, STRING *, INTVAL, and > NUMVAL entries, which means that each slot in an SArray and Array > needs to have a flag on it that says what data type's in each slot.
SArray can hold arbitrary items and has a type associated with it. Its fixed sized after initialization and does not handle sparse holes. Its intended for handling small typed arrays. Array and PerlArray only store PMCs. If you put an natural int into an Array a new PerlInteger with that value is stored. Finally only Arrays and PerlArray can be sparse. s. also the warnocked: "Q: Array vs SArray" from Dec 11th. > Most of the code to handle this lives in list.c and, honestly, > there's a lot of overhead. For the problem it solves--having a > mixed-type sparse array--it's just fine, but that's not what we need > in this case, so the overhead is just too darned excessive. The list.c code is using memory chunks and performs fine with big arrays (try shift/unshift on perl5 and parrot arrays) The current usage pattern (put a few PMCs in) isn't optimized yet. leo