Skip Menu |

This queue is for tickets about the Digest-CRC CPAN distribution.

Report information
The Basics
Id: 82335
Status: resolved
Priority: 0/
Queue: Digest-CRC

People
Owner: OLIMAUL [...] cpan.org
Requestors: victor [...] vsespb.ru
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.18
Fixed in: 0.19



Subject: 100 times slower than it should be
$ ./b_shavscrc1.t (warning: too few iterations for a reliable count) Rate crc sha crc 334/s -- -98% sha 20000/s 5880% -- $ cat b_shavscrc1.t #!/usr/bin/perl use strict; use warnings; use Digest::SHA qw/sha256/; use Digest::CRC qw(crc16); use Benchmark qw/:all/; { my $s = "Hello, world! ".('x' x 10000); cmpthese(1000, { 'sha' => sub { sha256($s); }, 'crc' => sub { crc16($s); } }); } $ perl -MDigest::CRC -e 'print $Digest::CRC::VERSION' 0.18
My guess is that you are using the pure perl implementation. For some reason, the pure perl installation is selected when installing from CPAN. A manual "perl Makefile.PL && make && make test && sudo make install" is all it takes for me to get the XS version. Not sure what is broken. On Sun Dec 30 03:47:52 2012, vsespb wrote: Show quoted text
> $ ./b_shavscrc1.t > (warning: too few iterations for a reliable count) > Rate crc sha > crc 334/s -- -98% > sha 20000/s 5880% -- > > > $ cat b_shavscrc1.t > #!/usr/bin/perl > > > use strict; > use warnings; > use Digest::SHA qw/sha256/; > use Digest::CRC qw(crc16); > use Benchmark qw/:all/; > > > { > my $s = "Hello, world! ".('x' x 10000); > > cmpthese(1000, { > 'sha' => sub { > sha256($s); > }, > 'crc' => sub { > crc16($s); > } > }); > } > > $ perl -MDigest::CRC -e 'print $Digest::CRC::VERSION' > 0.18
with Digest::CRC installed out of cpan, I get: ski@nigeria-v270:/tmp$ perl b_shavscrc1.t (warning: too few iterations for a reliable count) Rate crc sha crc 329/s -- -99% sha 25000/s 7500% -- But after a manual perl Makefile.PL && make && sudo make install, I get: ski@nigeria-v270:/tmp$ perl b_shavscrc1.t (warning: too few iterations for a reliable count) (warning: too few iterations for a reliable count) Rate sha crc sha 25000/s -- -50% crc 50000/s 100% -- On Fri Jun 14 13:44:26 2013, BRIANSKI wrote: Show quoted text
> My guess is that you are using the pure perl implementation. For some > reason, the pure perl installation is selected when installing from > CPAN. A manual "perl Makefile.PL && make && make test && sudo make > install" is all it takes for me to get the XS version. Not sure > what is broken. > > > > On Sun Dec 30 03:47:52 2012, vsespb wrote:
> > $ ./b_shavscrc1.t > > (warning: too few iterations for a reliable count) > > Rate crc sha > > crc 334/s -- -98% > > sha 20000/s 5880% -- > > > > > > $ cat b_shavscrc1.t > > #!/usr/bin/perl > > > > > > use strict; > > use warnings; > > use Digest::SHA qw/sha256/; > > use Digest::CRC qw(crc16); > > use Benchmark qw/:all/; > > > > > > { > > my $s = "Hello, world! ".('x' x 10000); > > > > cmpthese(1000, { > > 'sha' => sub { > > sha256($s); > > }, > > 'crc' => sub { > > crc16($s); > > } > > }); > > } > > > > $ perl -MDigest::CRC -e 'print $Digest::CRC::VERSION' > > 0.18
> >
Building with Module::Build (ie ./Build.PL && ./Build && ./Build test && sudo ./Build install ) fails to slurp in the XS goop and gives me a perl-only build. Building with ExtUtils::MakeMaker, however, installs an XS-using, performant version of Digest::CRC (ie. Makefile.PL && make && make test && sudo make install) On Fri Jun 14 13:47:58 2013, BRIANSKI wrote: Show quoted text
> with Digest::CRC installed out of cpan, I get: > > ski@nigeria-v270:/tmp$ perl b_shavscrc1.t > (warning: too few iterations for a reliable count) > Rate crc sha > crc 329/s -- -99% > sha 25000/s 7500% -- > > > But after a manual perl Makefile.PL && make && sudo make install, I get: > ski@nigeria-v270:/tmp$ perl b_shavscrc1.t > (warning: too few iterations for a reliable count) > (warning: too few iterations for a reliable count) > Rate sha crc > sha 25000/s -- -50% > crc 50000/s 100% -- > > > On Fri Jun 14 13:44:26 2013, BRIANSKI wrote:
> > My guess is that you are using the pure perl implementation. For some > > reason, the pure perl installation is selected when installing from > > CPAN. A manual "perl Makefile.PL && make && make test && sudo make > > install" is all it takes for me to get the XS version. Not sure > > what is broken. > > > > > > > > On Sun Dec 30 03:47:52 2012, vsespb wrote:
> > > $ ./b_shavscrc1.t > > > (warning: too few iterations for a reliable count) > > > Rate crc sha > > > crc 334/s -- -98% > > > sha 20000/s 5880% -- > > > > > > > > > $ cat b_shavscrc1.t > > > #!/usr/bin/perl > > > > > > > > > use strict; > > > use warnings; > > > use Digest::SHA qw/sha256/; > > > use Digest::CRC qw(crc16); > > > use Benchmark qw/:all/; > > > > > > > > > { > > > my $s = "Hello, world! ".('x' x 10000); > > > > > > cmpthese(1000, { > > > 'sha' => sub { > > > sha256($s); > > > }, > > > 'crc' => sub { > > > crc16($s); > > > } > > > }); > > > } > > > > > > $ perl -MDigest::CRC -e 'print $Digest::CRC::VERSION' > > > 0.18
> > > >
> >
From: victor [...] vsespb.ru
Yeah, you're right, according to module::build documentation http://search.cpan.org/perldoc?Module%3A%3ABuild XS files auto-compiled if found in lib/ directory I copied CRC.xs to lib/ and now it at least compiles the code (but I didn't test further installation) On Fri Jun 14 21:52:55 2013, BRIANSKI wrote: Show quoted text
> Building with Module::Build (ie ./Build.PL && ./Build && ./Build test > && sudo ./Build install ) fails to slurp in the XS goop and gives me a > perl-only build. > > Building with ExtUtils::MakeMaker, however, installs an XS-using, > performant version of Digest::CRC (ie. Makefile.PL && make && make > test && sudo make install) > > On Fri Jun 14 13:47:58 2013, BRIANSKI wrote:
> > with Digest::CRC installed out of cpan, I get: > > > > ski@nigeria-v270:/tmp$ perl b_shavscrc1.t > > (warning: too few iterations for a reliable count) > > Rate crc sha > > crc 329/s -- -99% > > sha 25000/s 7500% -- > > > > > > But after a manual perl Makefile.PL && make && sudo make install, I
> get:
> > ski@nigeria-v270:/tmp$ perl b_shavscrc1.t > > (warning: too few iterations for a reliable count) > > (warning: too few iterations for a reliable count) > > Rate sha crc > > sha 25000/s -- -50% > > crc 50000/s 100% -- > > > > > > On Fri Jun 14 13:44:26 2013, BRIANSKI wrote:
> > > My guess is that you are using the pure perl implementation. For
> some
> > > reason, the pure perl installation is selected when installing
> from
> > > CPAN. A manual "perl Makefile.PL && make && make test && sudo
> make
> > > install" is all it takes for me to get the XS version. Not sure > > > what is broken. > > > > > > > > > > > > On Sun Dec 30 03:47:52 2012, vsespb wrote:
> > > > $ ./b_shavscrc1.t > > > > (warning: too few iterations for a reliable count) > > > > Rate crc sha > > > > crc 334/s -- -98% > > > > sha 20000/s 5880% -- > > > > > > > > > > > > $ cat b_shavscrc1.t > > > > #!/usr/bin/perl > > > > > > > > > > > > use strict; > > > > use warnings; > > > > use Digest::SHA qw/sha256/; > > > > use Digest::CRC qw(crc16); > > > > use Benchmark qw/:all/; > > > > > > > > > > > > { > > > > my $s = "Hello, world! ".('x' x 10000); > > > > > > > > cmpthese(1000, { > > > > 'sha' => sub { > > > > sha256($s); > > > > }, > > > > 'crc' => sub { > > > > crc16($s); > > > > } > > > > }); > > > > } > > > > > > > > $ perl -MDigest::CRC -e 'print $Digest::CRC::VERSION' > > > > 0.18
> > > > > >
> > > >
> >
Thanks. Can you rectify this for the next release? It would really help with adoption of Digest::CRC over Digest::{SHA1|MD5}. On Sat Jun 15 13:19:26 2013, vsespb wrote: Show quoted text
> Yeah, you're right, according to module::build documentation > > http://search.cpan.org/perldoc?Module%3A%3ABuild XS files auto- > compiled if found in lib/ directory > > I copied CRC.xs to lib/ and now it at least compiles the code (but I > didn't test further installation) > > On Fri Jun 14 21:52:55 2013, BRIANSKI wrote:
> > Building with Module::Build (ie ./Build.PL && ./Build && ./Build
> test
> > && sudo ./Build install ) fails to slurp in the XS goop and gives me
> a
> > perl-only build. > > > > Building with ExtUtils::MakeMaker, however, installs an XS-using, > > performant version of Digest::CRC (ie. Makefile.PL && make && make > > test && sudo make install) > > > > On Fri Jun 14 13:47:58 2013, BRIANSKI wrote:
> > > with Digest::CRC installed out of cpan, I get: > > > > > > ski@nigeria-v270:/tmp$ perl b_shavscrc1.t > > > (warning: too few iterations for a reliable count) > > > Rate crc sha > > > crc 329/s -- -99% > > > sha 25000/s 7500% -- > > > > > > > > > But after a manual perl Makefile.PL && make && sudo make install,
> I
> > get:
> > > ski@nigeria-v270:/tmp$ perl b_shavscrc1.t > > > (warning: too few iterations for a reliable count) > > > (warning: too few iterations for a reliable count) > > > Rate sha crc > > > sha 25000/s -- -50% > > > crc 50000/s 100% -- > > > > > > > > > On Fri Jun 14 13:44:26 2013, BRIANSKI wrote:
> > > > My guess is that you are using the pure perl implementation. For
> > some
> > > > reason, the pure perl installation is selected when
> installing
> > from
> > > > CPAN. A manual "perl Makefile.PL && make && make test && sudo
> > make
> > > > install" is all it takes for me to get the XS version. Not
> sure
> > > > what is broken. > > > > > > > > > > > > > > > > On Sun Dec 30 03:47:52 2012, vsespb wrote:
> > > > > $ ./b_shavscrc1.t > > > > > (warning: too few iterations for a reliable count) > > > > > Rate crc sha > > > > > crc 334/s -- -98% > > > > > sha 20000/s 5880% -- > > > > > > > > > > > > > > > $ cat b_shavscrc1.t > > > > > #!/usr/bin/perl > > > > > > > > > > > > > > > use strict; > > > > > use warnings; > > > > > use Digest::SHA qw/sha256/; > > > > > use Digest::CRC qw(crc16); > > > > > use Benchmark qw/:all/; > > > > > > > > > > > > > > > { > > > > > my $s = "Hello, world! ".('x' x 10000); > > > > > > > > > > cmpthese(1000, { > > > > > 'sha' => sub { > > > > > sha256($s); > > > > > }, > > > > > 'crc' => sub { > > > > > crc16($s); > > > > > } > > > > > }); > > > > > } > > > > > > > > > > $ perl -MDigest::CRC -e 'print $Digest::CRC::VERSION' > > > > > 0.18
> > > > > > > >
> > > > > >
> > > >
> >
From: victor [...] vsespb.ru
I am the original bug reporter, not maintainer. On Mon Jun 17 17:26:28 2013, BRIANSKI wrote: Show quoted text
> Thanks. Can you rectify this for the next release? It would really > help with adoption of Digest::CRC over Digest::{SHA1|MD5}. > > On Sat Jun 15 13:19:26 2013, vsespb wrote:
> > Yeah, you're right, according to module::build documentation > > > > http://search.cpan.org/perldoc?Module%3A%3ABuild XS files auto- > > compiled if found in lib/ directory > > > > I copied CRC.xs to lib/ and now it at least compiles the code (but I > > didn't test further installation) > > > > On Fri Jun 14 21:52:55 2013, BRIANSKI wrote:
> > > Building with Module::Build (ie ./Build.PL && ./Build && ./Build
> > test
> > > && sudo ./Build install ) fails to slurp in the XS goop and gives
> me
> > a
> > > perl-only build. > > > > > > Building with ExtUtils::MakeMaker, however, installs an XS-using, > > > performant version of Digest::CRC (ie. Makefile.PL && make && make > > > test && sudo make install) > > > > > > On Fri Jun 14 13:47:58 2013, BRIANSKI wrote:
> > > > with Digest::CRC installed out of cpan, I get: > > > > > > > > ski@nigeria-v270:/tmp$ perl b_shavscrc1.t > > > > (warning: too few iterations for a reliable count) > > > > Rate crc sha > > > > crc 329/s -- -99% > > > > sha 25000/s 7500% -- > > > > > > > > > > > > But after a manual perl Makefile.PL && make && sudo make
> install,
> > I
> > > get:
> > > > ski@nigeria-v270:/tmp$ perl b_shavscrc1.t > > > > (warning: too few iterations for a reliable count) > > > > (warning: too few iterations for a reliable count) > > > > Rate sha crc > > > > sha 25000/s -- -50% > > > > crc 50000/s 100% -- > > > > > > > > > > > > On Fri Jun 14 13:44:26 2013, BRIANSKI wrote:
> > > > > My guess is that you are using the pure perl implementation.
> For
> > > some
> > > > > reason, the pure perl installation is selected when
> > installing
> > > from
> > > > > CPAN. A manual "perl Makefile.PL && make && make test &&
> sudo
> > > make
> > > > > install" is all it takes for me to get the XS version. Not
> > sure
> > > > > what is broken. > > > > > > > > > > > > > > > > > > > > On Sun Dec 30 03:47:52 2012, vsespb wrote:
> > > > > > $ ./b_shavscrc1.t > > > > > > (warning: too few iterations for a reliable
> count)
> > > > > > Rate crc sha > > > > > > crc 334/s -- -98% > > > > > > sha 20000/s 5880% -- > > > > > > > > > > > > > > > > > > $ cat b_shavscrc1.t > > > > > > #!/usr/bin/perl > > > > > > > > > > > > > > > > > > use strict; > > > > > > use warnings; > > > > > > use Digest::SHA qw/sha256/; > > > > > > use Digest::CRC qw(crc16); > > > > > > use Benchmark qw/:all/; > > > > > > > > > > > > > > > > > > { > > > > > > my $s = "Hello, world! ".('x' x 10000); > > > > > > > > > > > > cmpthese(1000, { > > > > > > 'sha' => sub { > > > > > > sha256($s); > > > > > > }, > > > > > > 'crc' => sub { > > > > > > crc16($s); > > > > > > } > > > > > > }); > > > > > > } > > > > > > > > > > > > $ perl -MDigest::CRC -e 'print $Digest::CRC::VERSION' > > > > > > 0.18
> > > > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> >
Hi, the Build support has been removed in 0.19 which has been released today, because it does not seem to support XS completely. Oliver