Perl 6 Development Grant (Jonathan Worthington): Report for August 2018

My grant work in August focused on improving the performance of a number of very commonly used constructs in Perl 6 programs, of note array and hash access, box/unbox operations (which take place inside many of the builtins), and various common operations on Int (the default integer type in Perl 6, which is arbitrary precision). My work also uncovered a problem that could be best addressed with a small language design tweak, and I wrote up a proposal on that (which has since gained broad acceptable, and will be implemented for Perl 6.d).

I also made various improvements to the optimization infrastructure. Most notably, I made it possible to track what is known about the value coming into a guard vs. its state after the guard (guards are the things that ensure a speculative optimization still applies, and deoptimize if not). This most usefully allows for elimination of guards (for example, when program anlaysis - perhaps after inlining - proves a property that was guarded, then we can remove the guard). However, this change also means we properly deal with facts before/after the guard point; earlier we'd not tracked this precisely in a few cases and so had to forego optimization opportunities. Now we can take them.

I also improved GC behavior a bit, making values assigned into long-lived aggregates get promoted sooner and making the optimizer thread join in with GC in a more timely manner.

Finally, there was a range of other smaller optimizations, as well as a good amount of bug hunting/fixing.

1:12    Decrease GC latency during specialization, 
        so that we won't block it so long while optimizing longer frames
13:25   Lots of speedups to hash and array access and storage, 
        giving some notable benchmark wins
5:19    Refactor guards so we can track facts before/after, 
        allowing for redundant guard elimination
1:47    Pass on facts from return types when inlining, 
        allowing further guard elimination
0:23    Generate less decont instructions when compiling calls
0:25    Tweak code-gen for calls to put callee lookup closer to call when possible, 
        shortening lifetime of it
1:11    Research and write up proposal for changing the default scoping of $_ in v6.d
7:42    Improve performance of common box/unbox operations, including to a Perl 6 Int
8:15    Improvement of addition, subtraction, and multiplication of Perl 6 Int, 
        removing indirections and improving JIT for the non-bigint case
9:38    Implement a spesh plugin for return type checks, 
        reducing code size and allowing some speedups
0:25    Fix a DEPRECATED crash when a backtrace misses some frames
0:58    Track down and fix a SEGV when a debug type name was set from 
        multiple threads
1:02    Fix a segfault in basic block elimination's annotation movement
1:10    Improve GC handling of programs placing objects into long-lived aggregates
6:23    Fix various deoptimization bugs
0:58    Correct how log guards are handled at a PHI to avoid incorrect deletions 
        of guards that were depended on beyond the PHI
1:02    Optimize takedispatcher into an nqp::null on inlining where possible
2:32    Investigate a module regression due to serialization and repossession 
        related changes; fix it
3:42    More aggressive optimization of inlines and better size handling
1:52    Assorted small optimizations in Rakudo and with hllize elimination
8:32    Other assorted debugging, fixing, and testing

About TPF

The Perl Foundation - supporting the Perl community since 2000. Find out more at

About this Entry

This page contains a single entry by Matthias Bloch published on September 24, 2018 2:16 PM.

Perl 6 Development Grant (Jonathan Worthington): Report for July 2018 was the previous entry in this blog.

Grant Proposals Sep/Oct 2018 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.


OpenID accepted here Learn more about OpenID
Powered by Movable Type 6.2.2