GCC-Builtins
view release on metacpan or search on metacpan
cpanm --look GCC::Builtins
and then
perl Makefile.PL && make all && make test && make benchmarks
The following benchamrk results indicate that the use of GCC::Builtins
(clz() in this case) yields more than 100% performance gain over
equivalent pure perl code:
Benchmark: timing 50000000 iterations of clz/xs, clz/pp-ugly...
clz/xs: 3.92331 wallclock secs ( 3.92 usr + 0.00 sys = 3.92 CPU) @ 12755102.04/s (n=50000000)
clz/pp-ugly: 8.24574 wallclock secs ( 8.23 usr + 0.00 sys = 8.23 CPU) @ 6075334.14/s (n=50000000)
Rate clz/pp-ugly clz/xs
clz/pp-ugly 6075334/s -- -52%
clz/xs 12755102/s 110% --
KEY:
clz/xs : calling GCC builtin clz() via XS from Perl
clz/pp-ugly : as suggested by coldr3ality (see https://perlmonks.org/?node_id=11158279)
Benchmark: timing 50000000 iterations of clzl/xs, clzl/pp-ugly...
clzl/xs: 3.84597 wallclock secs ( 3.84 usr + 0.00 sys = 3.84 CPU) @ 13020833.33/s (n=50000000)
clzl/pp-ugly: 8.44006 wallclock secs ( 8.43 usr + 0.00 sys = 8.43 CPU) @ 5931198.10/s (n=50000000)
Rate clzl/pp-ugly clzl/xs
clzl/pp-ugly 5931198/s -- -54%
clzl/xs 13020833/s 120% --
KEY:
clzl/xs : calling GCC builtin clzl() via XS from Perl
clzl/pp-ugly : as suggested by coldr3ality (see https://perlmonks.org/?node_id=11158279)
So, it pays to use this module if performance is an issue.
and then
perl Makefile.PL && make all && make test && make benchmarks
The following benchamrk results indicate that the use
of [GCC::Builtins](https://metacpan.org/pod/GCC%3A%3ABuiltins) (`clz()` in this case)
yields more than 100% performance gain
over equivalent pure perl code:
Benchmark: timing 50000000 iterations of clz/xs, clz/pp-ugly...
clz/xs: 3.92331 wallclock secs ( 3.92 usr + 0.00 sys = 3.92 CPU) @ 12755102.04/s (n=50000000)
clz/pp-ugly: 8.24574 wallclock secs ( 8.23 usr + 0.00 sys = 8.23 CPU) @ 6075334.14/s (n=50000000)
Rate clz/pp-ugly clz/xs
clz/pp-ugly 6075334/s -- -52%
clz/xs 12755102/s 110% --
KEY:
clz/xs : calling GCC builtin clz() via XS from Perl
clz/pp-ugly : as suggested by coldr3ality (see https://perlmonks.org/?node_id=11158279)
Benchmark: timing 50000000 iterations of clzl/xs, clzl/pp-ugly...
clzl/xs: 3.84597 wallclock secs ( 3.84 usr + 0.00 sys = 3.84 CPU) @ 13020833.33/s (n=50000000)
clzl/pp-ugly: 8.44006 wallclock secs ( 8.43 usr + 0.00 sys = 8.43 CPU) @ 5931198.10/s (n=50000000)
Rate clzl/pp-ugly clzl/xs
clzl/pp-ugly 5931198/s -- -54%
clzl/xs 13020833/s 120% --
KEY:
clzl/xs : calling GCC builtin clzl() via XS from Perl
clzl/pp-ugly : as suggested by coldr3ality (see https://perlmonks.org/?node_id=11158279)
So, it pays to use this module if performance is an issue.
lib/GCC/Builtins.pm view on Meta::CPAN
and then
perl Makefile.PL && make all && make test && make benchmarks
The following benchamrk results indicate that the use
of L<GCC::Builtins> (C<clz()> in this case)
yields more than 100% performance gain
over equivalent pure perl code:
Benchmark: timing 50000000 iterations of clz/xs, clz/pp-ugly...
clz/xs: 3.92331 wallclock secs ( 3.92 usr + 0.00 sys = 3.92 CPU) @ 12755102.04/s (n=50000000)
clz/pp-ugly: 8.24574 wallclock secs ( 8.23 usr + 0.00 sys = 8.23 CPU) @ 6075334.14/s (n=50000000)
Rate clz/pp-ugly clz/xs
clz/pp-ugly 6075334/s -- -52%
clz/xs 12755102/s 110% --
KEY:
clz/xs : calling GCC builtin clz() via XS from Perl
clz/pp-ugly : as suggested by coldr3ality (see https://perlmonks.org/?node_id=11158279)
Benchmark: timing 50000000 iterations of clzl/xs, clzl/pp-ugly...
clzl/xs: 3.84597 wallclock secs ( 3.84 usr + 0.00 sys = 3.84 CPU) @ 13020833.33/s (n=50000000)
clzl/pp-ugly: 8.44006 wallclock secs ( 8.43 usr + 0.00 sys = 8.43 CPU) @ 5931198.10/s (n=50000000)
Rate clzl/pp-ugly clzl/xs
clzl/pp-ugly 5931198/s -- -54%
clzl/xs 13020833/s 120% --
KEY:
clzl/xs : calling GCC builtin clzl() via XS from Perl
clzl/pp-ugly : as suggested by coldr3ality (see https://perlmonks.org/?node_id=11158279)
So, it pays to use this module if performance is an issue.
sbin/build-gcc-builtins-package.pl view on Meta::CPAN
and then
perl Makefile.PL && make all && make test && make benchmarks
The following benchamrk results indicate that the use
of L<GCC::Builtins> (C<clz()> in this case)
yields more than 100% performance gain
over equivalent pure perl code:
Benchmark: timing 50000000 iterations of clz/xs, clz/pp-ugly...
clz/xs: 3.92331 wallclock secs ( 3.92 usr + 0.00 sys = 3.92 CPU) @ 12755102.04/s (n=50000000)
clz/pp-ugly: 8.24574 wallclock secs ( 8.23 usr + 0.00 sys = 8.23 CPU) @ 6075334.14/s (n=50000000)
Rate clz/pp-ugly clz/xs
clz/pp-ugly 6075334/s -- -52%
clz/xs 12755102/s 110% --
KEY:
clz/xs : calling GCC builtin clz() via XS from Perl
clz/pp-ugly : as suggested by coldr3ality (see https://perlmonks.org/?node_id=11158279)
Benchmark: timing 50000000 iterations of clzl/xs, clzl/pp-ugly...
clzl/xs: 3.84597 wallclock secs ( 3.84 usr + 0.00 sys = 3.84 CPU) @ 13020833.33/s (n=50000000)
clzl/pp-ugly: 8.44006 wallclock secs ( 8.43 usr + 0.00 sys = 8.43 CPU) @ 5931198.10/s (n=50000000)
Rate clzl/pp-ugly clzl/xs
clzl/pp-ugly 5931198/s -- -54%
clzl/xs 13020833/s 120% --
KEY:
clzl/xs : calling GCC builtin clzl() via XS from Perl
clzl/pp-ugly : as suggested by coldr3ality (see https://perlmonks.org/?node_id=11158279)
So, it pays to use this module if performance is an issue.
( run in 2.160 seconds using v1.01-cache-2.11-cpan-71847e10f99 )