08 May 2021 14:55:40 UTC
- Distribution: Faster-Maths
- Module version: 0.02
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (2)
- Testers (94 / 0 / 5)
- KwaliteeBus factor: 1
- 75.44% Coverage
- License: perl_5
- Perl: v5.22.0
- Activity24 month
- Download (15.26KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
Faster::Maths- make mathematically-intense programs faster
use Faster::Maths; # and that's it :)
This module installs an optimizer into the perl compiler that looks for sequences of maths operations that it can make faster.
When this module is lexically in scope, mathematical expressions composed of the four basic operators (
/) operating on lexical variables and constants will be compiled into a form that is more efficient at runtime.
Does not currently respect operator overloading. All values will get converted into NVs individually, and composed using regular NV maths.
We should recognise the presence of overloading magic on variables and fall back to slower-but-correct operation in that case; also potentially ignore any OP_CONSTs with magical values.
Does not currently retain full integer precision on integer values larger than platform float (NV) size. All values will get converted to NVs immediately, thus losing the lower bits of precision if the value is too large.
Recognise more potential arguments - padrange and package variables at least.
Recognise more operators -
sqrt, possibly other unary operators like
Store IV/UV constants as values directly in the UNOP_AUX structure avoiding the need for SV lookup on them.
Back-compatibility to perls older than 5.22.0 by providing an UNOP_AUX implementation.
Paul Evans <email@example.com>
Module Install Instructions
To install Faster::Maths, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Faster::Maths
For more information on module installation, please visit the detailed CPAN module installation guide.