develooper Front page | perl.perl5.porters | Postings from December 2007

Re: optimising opcodes

Thread Previous
Nicholas Clark
December 26, 2007 02:15
Re: optimising opcodes
Message ID:
On Tue, Dec 25, 2007 at 07:38:30PM +0100, demerphq wrote:
> On 24/12/2007, Nicholas Clark <> wrote:
> > I was thinking about something Jim Cromie mailed me privately, and wondered:
> > "How many null ops do we have, and how many cache misses do they cause?"
> > For example:

> > 3: If you configured perl to use a slab allocator, and happened to do two
> >   parses (first to determine the total size of ops, second to copy them in)
> >   and thereby allocated a slab of the exact size, would that help more?
> Based on the experience of the regex engine id say that you dont want
> to do this. In order to do advanced optimisations you need a parse
> tree to manipulate, but if you do a size only pass there isnt enough
> information available to determine if an optimisation is possible.
> What im hoping to be able to do in the regex engine is "free allocate"
> the nodes in the parse tree, then once all optimisations are complete
> copy them into a slab.

Sorry, I wasn't clear. I meant that by using the slab allocator by default
(which is already a standard option, just not the default) the rest of the
core code wouldn't realise the difference between ops during optree
construction and optimisation, and ops that a final parse had copied into
the slap.

Specifically, op_free() wouldn't need to be changed - it already supports
the op slab allocator.

Nicholas Clark

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