Path::Hilbert::XS - XS implementation of a Hilbert Path algorithm
0.003
use Path::Hilbert::XS; my ($x, $y) = d2xy(16, 127); my $d = xy2d(16, $x, $y); die unless $d == 127;
This implements Path::Hilbert in XS for speed and awesomesauceness.
The OO interface is not available (yet?).
While Path::Hilbert is a solid module, we just wanted speed when dealing with abundant amount of data.
Here are some statistics, generated using the bundled tools/benchmark.pl script:
-- d2xy -- PP: Rounded run time per iteration: 1.4496e-05 +/- 4.8e-08 (0.3%) XS: Rounded run time per iteration: 5.1150e-07 +/- 6.3e-10 (0.1%) Time PP XS PP 1.450e-05 -- -3.53% XS 5.115e-07 96.47% -- -- xy2d-- PP: Rounded run time per iteration: 1.3215e-05 +/- 2.7e-08 (0.2%) XS: Rounded run time per iteration: 4.7877e-07 +/- 8.3e-10 (0.2%) Time PP XS PP 1.322e-05 -- -3.62% XS 4.788e-07 96.38% --
(Statistics collected using Dumbbench.)
Rate PP XS PP 71028/s -- -98% XS 3703704/s 5114% --
(Statistics collected using Benchmark.)
Rafaël Garcia-Suarez - for asking for it.
p5pclub
Gonzalo Diethelm gonzus AT cpan DOT org
gonzus AT cpan DOT org
Sawyer X xsawyerx AT cpan DOT org
xsawyerx AT cpan DOT org
To install Path::Hilbert::XS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Path::Hilbert::XS
CPAN shell
perl -MCPAN -e shell install Path::Hilbert::XS
For more information on module installation, please visit the detailed CPAN module installation guide.