-
-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
An optimization to handle a single LEAVEish phaser block, was broken. This meant that all block exits that had any phaser, would take the slow path. Instead if a block contains *only* a single LEAVE phaser, a super fast path is taken on exiting the block, without needing any hash lookups. This e.g. reduces the overhead of Lock.protect by 20%. And there are 4 of these for *every* startup of rakudo. This commit changes / fixes the following: - Block.$!phasers now either is not concrete (no phasers), contains a block (a single LEAVE phaser), or contains a hash with phasers (as before) - KEEP/UNDO phasers are saved in the hash as ($name,$block) list to allow for faster running all LEAVEish phasers. - the Block API for phasers remains the same, handling the new meanings of the $!phasers attribute transparently - The add phaser handling code has been adapted to support the lone LEAVE phaser case and KEEP/UNDO cases - the exit-handler only gets called if $!phasers is concrete: it now only has to check whether it is a hash (if not, take the fast path, directly executing what is in $!phasers). - unnecessary deconting has been remove from the exit handler. - the PhasersList class has been removed: it predated the IterationBuffer class, and it was basically just that. Changing that, simplified HLLizing some Block phaser API calls - the brittle handling of scopes by the "will" trait on variables, has been changed to dynamically search for the variable in question
- Loading branch information
Showing
12 changed files
with
212 additions
and
152 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
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
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
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
Oops, something went wrong.