develooper Front page | perl.perl5.porters | Postings from May 2022

Optimisation idea: OP_ANONCODE with OPf_REF - good newbie project?

Thread Next
Paul "LeoNerd" Evans
May 18, 2022 16:35
Optimisation idea: OP_ANONCODE with OPf_REF - good newbie project?
Message ID:
An idea for 5.37:

Everywhere that OP_ANONCODE appears in the optree of normal code, it's
surrounded by an OP_REFGEN op, to make a reference SV out of the bare
CV that OP_ANONCODE created.

It would be quite easy to define the OPf_REF flag on the OP_ANONCODE op
to do this step internally, meaning it didn't need a separate op. That
would result in a small memory saving of the optree, and a runtime
performance boost; perhaps enough to be measurably useful in code that
uses lots of higher-order functions and closures, and generally does
this sort of thing a lot.

The change would be fairly small, quite easy to write tests for, and an
excellent candidate for someone new to core development who wanted to
dip their toes in the water.

If anyone wants to take a look at that in the 5.37 round, give us a
wave and I can walk you through it...

Paul "LeoNerd" Evans      |  |

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