pperl 0.6.0#
2026-07-11 to 2026-07-15, 54 commits.
Language and runtime#
The interpreter is faster: with the JIT off, pperl averages 108.6 on the perlbench suite, where perl5 scores 100, up from 85. Every benchmark of the suite scores at least 84, and the
whileloop and sub call benchmarks run faster than on perl5.
JIT and parallelization#
The JIT compiler and auto-parallelization work in pperl’s default runtime; in 0.5.6 they worked only under
--pp. Numericfor,whileanduntilloops, nested loops andif/elsein loop bodies compile to machine code, with integer arithmetic checked for overflow and floating-point expressions evaluated in perl’s order, so results are those of the interpreter. A sum over 100 million integers takes 0.14 s against perl5’s 2.76 s, and a 1000x1000 Mandelbrot render 214 ms against 12.5 s.Parallel loops: a counting loop whose iterations only add to sums runs on several cores, with the result of a sequential run. A floating-point sum is split across cores only when every partial sum is exact; other floating-point sums run compiled on one core. Loops too short to pay for the threads stay sequential: 100,000 iterations for a flat loop, 512 for one with a nested loop. The 1000x1000 Mandelbrot render takes 51 ms in parallel.
Strings in compiled loops: concatenation and
.=,sprintfwith%dformats,length,indexwith a constant string, string comparisons,uc,lc,ucfirst,lcfirst,chomp,reverse,xandsubstrcompile. A loop callingindexwith a constant string makes 253 million calls per second, perl5 26 million.Arrays and hashes in compiled loops: array elements with constant or computed indexes,
push,pop, list assignment,$#a,foreachover an array or over the default$_,while (@a)and hash elements compile, as dodefined,refand++or--used as a value.map,grep,sort,joinandsplitin compiled loops:mapandgrepblocks that compute a value,sort { $a <=> $b }and its descending form,joinover an array andspliton a literal pattern compile.maptakes 0.13 andgrep0.17 of the time perl5 takes.Subroutine calls in compiled loops: calls to named subs compile with the loop, including subs that take their arguments with
shiftor a signature, declaremyvariables, return early, or call themselves or each other recursively. A signature sub with optional parameters compiles once per argument count, and a branch that callsdie,warn,croakorconfessno longer keeps a sub from compiling. A recursive sub such asfibcompiles on its own as well:fib(30)takes 17 ms instead of 538 ms, and the “Deep recursion” warning comes at the same depth as on perl5.Regular expressions in compiled loops: matches, captures and substitutions with a constant replacement,
s/PAT/TEXT/ands/PAT/TEXT/g, compile and run perl’s regex engine, so$&,$1and@-are set as in the interpreter. Patterns with(?{ }),m//g,s///eands///rstay interpreted.Scalar::Util and List::Util in compiled loops:
blessed,reftype,refaddr,weaken,unweaken,isweak,looks_like_numberandreadonlyfrom Scalar::Util andsum,sum0,product,minandmaxfrom List::Util can be called in a compiled loop.
Modules#
B::Deparse and B::Concise work: the B module was revised against perl5’s, so
B::Deparseturns code references back into source andB::Conciseprints op trees. Deparsing interpolated strings and chained element access such as$h->{a}{b}works, where it died.B::CV::XSUBandB::CV::XSUBANYexist, and loading B no longer warns about a missingB::OBJECTpackage.Data::Dumper supports
FreezerandToaster,Deparse,Sortkeyswith a code reference,PurityandDeepcopy, aSeenhash given by the caller, globs and regexps, with perl5’s rules for quoting numbers. WithSortkeysunderuse locale, keys sort in the locale’s collation order. It runs at about perl5’s speed.XSLoader:
XSLoader::loadsucceeds for every module built into pperl, as for a statically linked module on perl5. A module that loads its compiled part in anevaland falls back to pure Perl on failure no longer takes the slower fallback: Data::Dumper did, and ran 2 to 5 times slower.List::Util:
first,anyand the other functions that take a block call it as perl5 does, without a full sub call per element;firstandanytook 6 to 7 times perl5’s time and take 1.2 times.uniqkeepsundefasundef,uniqintreturns integers and honours an overloadedint, anduniqnumkeeps integers above 2**53 apart.Sub::Util: calling
set_subnameagain and again on the same sub no longer gets slower with every call or leaks memory.Scalar::Util:
blessed,refaddr,reftype,weaken,unweakenandisweakare thebuiltin::functions, as in Scalar::Util on perl5.Function prototypes: the functions of Time::HiRes, Scalar::Util, MIME::Base64 and MIME::QuotedPrint carry the prototypes perl5 gives them. With Time::HiRes’s
timeimported,time - $t0subtracts instead of callingtime(-$t0).File::Spec: the Unix functions that are XS on perl5 are native in pperl;
canonpathruns at perl5’s speed, where it took 12.8 times as long.
Command line#
The
--ppruntime is removed. pperl has one runtime;--ppand the options only it supported,--cache,--flush,--daemon,--client,--stop,--optree,--from-json,--trace,--timeout,--dump-optreeand--compare-bytecode, are gone.-cchecks syntax with the parser that runs the program, so its messages and exit codes are perl5’s; it used the other runtime’s parser before.
Distribution#
Static and cross-architecture builds: pperl builds as a static x86-64 binary against musl, and as static AArch64 and RISC-V binaries with the JIT and auto-parallelization. Release binaries come with SHA-256 sums, and each must pass a smoke test, run under emulation for AArch64 and RISC-V.
Documentation#
One runtime in the documentation: the “Runtimes” page, the reference pages of the
--ppruntime’s modules in every language and every mention of--ppare removed, and the reference section is titled “Reference”.JIT guide: the architecture guide’s JIT chapter is rewritten for the compiler of this release, covering what it compiles, how it keeps results exact and how to watch it work. The pages on writing fast pperl code, on measuring and on concurrent execution are brought in line with it.
Module reference: the pages of Devel::Peek, Hash::Util, List::Util, Math::GMP, the PDL modules, Peta::FFI, SDBM_File and mro are expanded and corrected, and their code examples are highlighted as Perl.
Serbian translation: links in ten perlfunc pages showed control characters instead of their labels; they are repaired, and the Serbian PDF builds.