develooper Front page | perl.perl5.porters | Postings from July 2010

Re: MG slabs?

Thread Previous | Thread Next
Leon Timmermans
July 18, 2010 16:02
Re: MG slabs?
Message ID:
On Sun, Jul 18, 2010 at 11:47 PM, Dave Mitchell <> wrote:
> Here's a bit of idle speculation:
> It's well known that linked lists are very bad for modern cachey CPUs:
> following through a linked list may involve a CPU stall with each
> foo = foo->next step.
> Now then, magic is currently attached to SVs using linked lists, and magic
> is attached to lots of SVs for lots of trivial reasons: taint, pos, etc.
> So a lot of processing of SVs involves lots of running through the MG
> linked list, eg
>    $ grep mg_find *.c | wc -l
>    87
> Which may be slow (although I haven't instrumented this with cachegrind or
> anything yet).
> So... maybe SvMAGIC should point to a singe array (in the C sense, not the
> AV sense) of MG structures. If we need to add more magic, we realloc the
> array.

How often do SVs really have more than one kind of magic? How much can
that be reduced by making taint a flag instead of a kind of magic?
Would this really be worth the effort?


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About