Devel::GoFaster(3pm)
π Devel::GoFaster π
okay so bestie, welcome to Devel::GoFaster β a User Contributed Perl Documentation page (the 3pm section, if you're keeping track) that is literally just here to make your compiled Perl ops go zoom. β¨
Devel::GoFaster β optimise executable Perl ops ποΈπ¨
πΈ SYNOPSIS πΈ
use Devel::GoFaster;
use Devel::GoFaster "global";
that's it. that's the whole vibe. two lines. iconic. π
β¨ DESCRIPTION β¨
so this module implements some optimisations in compiled Perl code, and the whole point is that your code runs slightly faster without visibly affecting behaviour. it's giving free speed, no cap. π¦
the way it works: the optimisations get applied at the peephole optimisation step, augmenting Perl's built-in optimisations. so it's not rewriting your whole thing, it's just... polishing. β¨
Code to be made faster does not need to be written in any special way; this module can generally be applied to code that was not written with it in mind. π«Ά so like, don't stress, you don't have to write anything differently.
BUT. and this is the important part β to help with situations where the op munging causes trouble (such as with the deparser π), there is some selectivity in which code gets the optimisations.
Whether to apply these optimisations is decided for each subroutine as a whole: it cannot be enabled or disabled for just part of a subroutine. π
there's a global control, defaulting to off, and lexically-scoped local control which takes precedence over the global control. so local wins, always. π
because the optimisations are applied in the peephole optimiser, not affecting primary compilation, they are invisible to most modules that muck around with op trees during compilation. so this module should play nicely with modules that use custom ops and the like. π€
however β anything that examines the ops of a complete compiled subroutine is liable to see the non-standard optimised ops from this module, and may have a problem. π in particular, the deparser can't correctly deparse code that has been affected by this module. if such problems affect a particular subroutine, the lexical control can be used to disable non-standard optimisation of that subroutine alone. problem solved, bestie. π
This module tries quite hard to not visibly fail, so that it should be generally safe to use its pragmata. if circumstances make it impossible to apply optimisations that would sometimes be available, the module will silently leave code unoptimised. π§
in particular β and this one's a big deal β because all the optimisations are necessarily implemented using XS code, on any system that can't build or load XS modules this module's pragmata effectively become no-ops. no XS, no zoom, that's just the deal. π
No particular optimisations are guaranteed by invoking this module. fr fr. nothing is promised.
π PRAGMATA π
here's the whole menu, bestie. four options, all of them slay:
use Devel::GoFasterβ Locally enable the optimisations of this module. Subroutines compiled in the lexical scope of this pragma will get the non-standard optimisations, regardless of the global pragma state. local on, no matter what the global is doing. πno Devel::GoFasterβ Locally disable the optimisations of this module. Subroutines compiled in the lexical scope of this pragma will not get the non-standard optimisations, regardless of the global pragma state. local off, no matter what. π«use Devel::GoFaster "global"β Globally enable the optimisations of this module. Subroutines compiled after this pragma has been encountered will get the non-standard optimisations, except where locally overridden. πβ¨no Devel::GoFaster "global"β Globally disable the optimisations of this module (which is the default state, btw π). Subroutines compiled after this pragma has been encountered will not get the non-standard optimisations, except where locally overridden. π
π BUGS π
As noted above, this module is liable to break anything that examines the ops of a complete compiled subroutine, such as the deparser. so like... heads up. π
π AUTHOR π
Andrew Main (Zefram) <zefram@fysh.org> β absolute legend, thank you for your service π«Ά
β COPYRIGHT β
Copyright (C) 2015, 2017 Andrew Main (Zefram) <zefram@fysh.org>
πΈ LICENSE πΈ
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π
okay that's the whole page, bestie β go optimise something π β¨
this has been Devel::GoFaster(3pm) from perl v5.42.0, dated 2025-07-25 β mwah, take care of her π
π¦ where this page comes from
- fedora 43: perl-Devel-GoFaster 0.001-29.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms