Attached are updated patches that together will restore 5.25.11+ compatibility ( at the sacrifice of being incompatible with older perls due to new + removed hash functions -_- )
--
- CPAN kentnl@cpan.org
- Gentoo Perl Maintainer kentnl@gentoo.org ( perl@gentoo.org )
From 65c3a3b89296fc49ee9e417bec06b9693fd32e7d Mon Sep 17 00:00:00 2001
From: Kent Fredric <kentfredric@gmail.com>
Date: Fri, 17 Mar 2017 22:47:25 +1300
Subject: Remove hashes symbols removed in 5.25.8
6b0260474df579e9412f57249519747ab8bb5c2b removed:
- SDBM
- DJB2
- SUPERFAST
- MURMUR3
- ONE_AT_A_TIME
- ONE_AT_A_TIME_OLD
- MURMUR_HASH_64A
- MURMUR_HASH_64B
---
CoreHashes.xs | 143 ---------------------------------------
lib/Benchmark/Perl/CoreHashes.pm | 6 --
t/Benchmark-Perl-CoreHashes.t | 6 --
3 files changed, 155 deletions(-)
diff --git a/CoreHashes.xs b/CoreHashes.xs
index 9306c16..9f3acc1 100755
--- a/CoreHashes.xs
+++ b/CoreHashes.xs
@@ -34,13 +34,7 @@ static const char arrlen [] = {
#undef XMM
#undef PERL_HASH_FUNC_SIPHASH
-#undef PERL_HASH_FUNC_SDBM
-#undef PERL_HASH_FUNC_DJB2
-#undef PERL_HASH_FUNC_SUPERFAST
-#undef PERL_HASH_FUNC_MURMUR3
-#undef PERL_HASH_FUNC_ONE_AT_A_TIME
#undef PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
-#undef PERL_HASH_FUNC_ONE_AT_A_TIME_OLD
#undef PERL_HASH_SEED
#define PERL_HASH_SEED "PeRlHaShhAcKpErl"
@@ -70,120 +64,6 @@ CODE:
OUTPUT:
RETVAL
-U32
-run_PERL_HASH_FUNC_SDBM()
-PREINIT:
- int i;
- int iarr;
-CODE:
-#undef PERL_HASH_FUNC
-#undef PERL_HASH_SEED_BYTES
-#undef PERL_HASH
-#define PERL_HASH_FUNC "SDBM"
-#define PERL_HASH_SEED_BYTES 4
-#define PERL_HASH(hash,str,len) (hash)= S_perl_hash_sdbm(PERL_HASH_SEED,(U8*)(str),(len))
- RETVAL = 0;
- for(i=0; i < 1000000; i++){
- for(iarr=0; iarr < sizeof(arrlen); iarr++){
- U32 hash;
- PERL_HASH(hash, arr[iarr], arrlen[iarr]);
- RETVAL += hash;
- }
- }
-OUTPUT:
- RETVAL
-
-U32
-run_PERL_HASH_FUNC_DJB2()
-PREINIT:
- int i;
- int iarr;
-CODE:
-#undef PERL_HASH_FUNC
-#undef PERL_HASH_SEED_BYTES
-#undef PERL_HASH
-#define PERL_HASH_FUNC "DJB2"
-#define PERL_HASH_SEED_BYTES 4
-#define PERL_HASH(hash,str,len) (hash)= S_perl_hash_djb2(PERL_HASH_SEED,(U8*)(str),(len))
- RETVAL = 0;
- for(i=0; i < 1000000; i++){
- for(iarr=0; iarr < sizeof(arrlen); iarr++){
- U32 hash;
- PERL_HASH(hash, arr[iarr], arrlen[iarr]);
- RETVAL += hash;
- }
- }
-OUTPUT:
- RETVAL
-
-U32
-run_PERL_HASH_FUNC_SUPERFAST()
-PREINIT:
- int i;
- int iarr;
-CODE:
-#undef PERL_HASH_FUNC
-#undef PERL_HASH_SEED_BYTES
-#undef PERL_HASH
-#define PERL_HASH_FUNC "SUPERFAST"
-#define PERL_HASH_SEED_BYTES 4
-#define PERL_HASH(hash,str,len) (hash)= S_perl_hash_superfast(PERL_HASH_SEED,(U8*)(str),(len))
- RETVAL = 0;
- for(i=0; i < 1000000; i++){
- for(iarr=0; iarr < sizeof(arrlen); iarr++){
- U32 hash;
- PERL_HASH(hash, arr[iarr], arrlen[iarr]);
- RETVAL += hash;
- }
- }
-OUTPUT:
- RETVAL
-
-U32
-run_PERL_HASH_FUNC_MURMUR3()
-PREINIT:
- int i;
- int iarr;
-CODE:
-#undef PERL_HASH_FUNC
-#undef PERL_HASH_SEED_BYTES
-#undef PERL_HASH
-#define PERL_HASH_FUNC "MURMUR3"
-#define PERL_HASH_SEED_BYTES 4
-#define PERL_HASH(hash,str,len) (hash)= S_perl_hash_murmur3(PERL_HASH_SEED,(U8*)(str),(len))
- RETVAL = 0;
- for(i=0; i < 1000000; i++){
- for(iarr=0; iarr < sizeof(arrlen); iarr++){
- U32 hash;
- PERL_HASH(hash, arr[iarr], arrlen[iarr]);
- RETVAL += hash;
- }
- }
-OUTPUT:
- RETVAL
-
-U32
-run_PERL_HASH_FUNC_ONE_AT_A_TIME()
-PREINIT:
- int i;
- int iarr;
-CODE:
-#undef PERL_HASH_FUNC
-#undef PERL_HASH_SEED_BYTES
-#undef PERL_HASH
-#define PERL_HASH_FUNC "ONE_AT_A_TIME"
-#define PERL_HASH_SEED_BYTES 4
-#define PERL_HASH(hash,str,len) (hash)= S_perl_hash_one_at_a_time(PERL_HASH_SEED,(U8*)(str),(len))
- RETVAL = 0;
- for(i=0; i < 1000000; i++){
- for(iarr=0; iarr < sizeof(arrlen); iarr++){
- U32 hash;
- PERL_HASH(hash, arr[iarr], arrlen[iarr]);
- RETVAL += hash;
- }
- }
-OUTPUT:
- RETVAL
U32
run_PERL_HASH_FUNC_ONE_AT_A_TIME_HARD()
@@ -207,26 +87,3 @@ CODE:
}
OUTPUT:
RETVAL
-
-U32
-run_PERL_HASH_FUNC_ONE_AT_A_TIME_OLD()
-PREINIT:
- int i;
- int iarr;
-CODE:
-#undef PERL_HASH_FUNC
-#undef PERL_HASH_SEED_BYTES
-#undef PERL_HASH
-#define PERL_HASH_FUNC "ONE_AT_A_TIME_OLD"
-#define PERL_HASH_SEED_BYTES 4
-#define PERL_HASH(hash,str,len) (hash)= S_perl_hash_old_one_at_a_time(PERL_HASH_SEED,(U8*)(str),(len))
- RETVAL = 0;
- for(i=0; i < 1000000; i++){
- for(iarr=0; iarr < sizeof(arrlen); iarr++){
- U32 hash;
- PERL_HASH(hash, arr[iarr], arrlen[iarr]);
- RETVAL += hash;
- }
- }
-OUTPUT:
- RETVAL
diff --git a/lib/Benchmark/Perl/CoreHashes.pm b/lib/Benchmark/Perl/CoreHashes.pm
index f611c6c..3f4b42e 100755
--- a/lib/Benchmark/Perl/CoreHashes.pm
+++ b/lib/Benchmark/Perl/CoreHashes.pm
@@ -13,13 +13,7 @@ our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
our @EXPORT = qw(
run_PERL_HASH_FUNC_SIPHASH
- run_PERL_HASH_FUNC_SDBM
- run_PERL_HASH_FUNC_DJB2
- run_PERL_HASH_FUNC_SUPERFAST
- run_PERL_HASH_FUNC_MURMUR3
- run_PERL_HASH_FUNC_ONE_AT_A_TIME
run_PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
- run_PERL_HASH_FUNC_ONE_AT_A_TIME_OLD
);
our $VERSION = '0.02';
diff --git a/t/Benchmark-Perl-CoreHashes.t b/t/Benchmark-Perl-CoreHashes.t
index a72ba04..a559233 100755
--- a/t/Benchmark-Perl-CoreHashes.t
+++ b/t/Benchmark-Perl-CoreHashes.t
@@ -11,13 +11,7 @@ BEGIN { use_ok('Benchmark::Perl::CoreHashes') };
my ($t1beg, $t1end);
my @subnames = qw|
PERL_HASH_FUNC_SIPHASH
- PERL_HASH_FUNC_SDBM
- PERL_HASH_FUNC_DJB2
- PERL_HASH_FUNC_SUPERFAST
- PERL_HASH_FUNC_MURMUR3
- PERL_HASH_FUNC_ONE_AT_A_TIME
PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
- PERL_HASH_FUNC_ONE_AT_A_TIME_OLD
|;
#disabled to make results easier to read for now
#@subnames = shuffle @subnames;
--
2.12.0
From 18fe79aa118580ddf22aba589e6fd897de6fe46b Mon Sep 17 00:00:00 2001
From: Kent Fredric <kentfredric@gmail.com>
Date: Fri, 17 Mar 2017 23:02:56 +1300
Subject: Add siphash13 and hybrid siphash13
---
CoreHashes.xs | 50 +++++++++++++++++++++++++++++++++++++++-
lib/Benchmark/Perl/CoreHashes.pm | 2 ++
t/Benchmark-Perl-CoreHashes.t | 2 ++
3 files changed, 53 insertions(+), 1 deletion(-)
diff --git a/CoreHashes.xs b/CoreHashes.xs
index 9f3acc1..2a51cc3 100755
--- a/CoreHashes.xs
+++ b/CoreHashes.xs
@@ -35,6 +35,8 @@ static const char arrlen [] = {
#undef PERL_HASH_FUNC_SIPHASH
#undef PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
+#undef PERL_HASH_FUNC_SIPHASH13
+#undef PERL_HASH_FUNC_HYBRID_OAATHU_SIPHASH13
#undef PERL_HASH_SEED
#define PERL_HASH_SEED "PeRlHaShhAcKpErl"
@@ -64,7 +66,6 @@ CODE:
OUTPUT:
RETVAL
-
U32
run_PERL_HASH_FUNC_ONE_AT_A_TIME_HARD()
PREINIT:
@@ -87,3 +88,50 @@ CODE:
}
OUTPUT:
RETVAL
+
+U32
+run_PERL_HASH_FUNC_SIPHASH13()
+PREINIT:
+ int i;
+ int iarr;
+CODE:
+#undef PERL_HASH_FUNC
+#undef PERL_HASH_SEED_BYTES
+#undef PERL_HASH
+#define PERL_HASH_FUNC "SIPHASH_1_3"
+#define PERL_HASH_SEED_BYTES 16
+#define PERL_HASH(hash,str,len) (hash)= S_perl_hash_siphash_1_3(PERL_HASH_SEED,(U8*)(str),(len))
+ RETVAL = 0;
+ for(i=0; i < 1000000; i++){
+ for(iarr=0; iarr < sizeof(arrlen); iarr++){
+ U32 hash;
+ PERL_HASH(hash, arr[iarr], arrlen[iarr]);
+ RETVAL += hash;
+ }
+ }
+OUTPUT:
+ RETVAL
+
+U32
+run_PERL_HASH_FUNC_HYBRID_OAATHU_SIPHASH13()
+PREINIT:
+ int i;
+ int iarr;
+CODE:
+#undef PERL_HASH_FUNC
+#undef PERL_HASH_SEED_BYTES
+#undef PERL_HASH
+#define PERL_HASH_FUNC "HYBRID_OAATHU_SIPHASH_1_3"
+#define PERL_HASH_SEED_BYTES 24
+#define PERL_HASH(hash,str,len) (hash)= S_perl_hash_oaathu_siphash_1_3(PERL_HASH_SEED,(U8*)(str),(len))
+ RETVAL = 0;
+ for(i=0; i < 1000000; i++){
+ for(iarr=0; iarr < sizeof(arrlen); iarr++){
+ U32 hash;
+ PERL_HASH(hash, arr[iarr], arrlen[iarr]);
+ RETVAL += hash;
+ }
+ }
+OUTPUT:
+ RETVAL
+
diff --git a/lib/Benchmark/Perl/CoreHashes.pm b/lib/Benchmark/Perl/CoreHashes.pm
index 3f4b42e..e493fc8 100755
--- a/lib/Benchmark/Perl/CoreHashes.pm
+++ b/lib/Benchmark/Perl/CoreHashes.pm
@@ -14,6 +14,8 @@ our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
our @EXPORT = qw(
run_PERL_HASH_FUNC_SIPHASH
run_PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
+ run_PERL_HASH_FUNC_SIPHASH13
+ run_PERL_HASH_FUNC_HYBRID_OAATHU_SIPHASH13
);
our $VERSION = '0.02';
diff --git a/t/Benchmark-Perl-CoreHashes.t b/t/Benchmark-Perl-CoreHashes.t
index a559233..ffd1520 100755
--- a/t/Benchmark-Perl-CoreHashes.t
+++ b/t/Benchmark-Perl-CoreHashes.t
@@ -12,6 +12,8 @@ my ($t1beg, $t1end);
my @subnames = qw|
PERL_HASH_FUNC_SIPHASH
PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
+ PERL_HASH_FUNC_SIPHASH13
+ PERL_HASH_FUNC_HYBRID_OAATHU_SIPHASH13
|;
#disabled to make results easier to read for now
#@subnames = shuffle @subnames;
--
2.12.0