Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pp_aassign: optimise: store NULLs in L elem slots
(This commit only affects code within PERL_RC_STACK ifdefs) In a list assignment such as (L1, L2, ...) = (R1, R2, ...), pp_assign is called with the stack looking like: * R1 R2 ... * L1 L2 ... Previously, all elements on the stack were popped at the end. This commit changes it so that after each L element is processed, it is freed and a NULL (or sometimes &PL_sv_undef) is stored at that slot in the stack. Then at the end, PL_stack_sp can just be set to one slot below the ex-L1, without having to run a loop popping each element off the stack. This reduces the number of memory reads and branches, at the cost of more writes. (All the R elems will still need to be freed, though).
- Loading branch information
Showing
1 changed file
with
88 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters