summaryrefslogtreecommitdiff
path: root/ext/Hash-Util-FieldHash
Commit message (Collapse)AuthorAgeFilesLines
* scalar(%h = (1,1,1,1)) should return 4, not 2Ruslan Zakirov2012-12-111-2/+2
| | | | | | | | | | | perldoc perlop says: a list assignment in scalar context returns the number of elements produced by the expression on the right hand side of the assignment Behaviour was changed as side effect of ca65944e8ff8fff6e36ea7476ba807be16cfe2a9 where goal was to fix return value in list context.
* Hash Function Change - Murmur hash and true per process hash seedYves Orton2012-11-171-110/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does the following: *) Introduces multiple new hash functions to choose from at build time. This includes Murmur-32, SDBM, DJB2, SipHash, SuperFast, and One-at-a-time. Currently this is handled by muning hv.h. Configure support hopefully to follow. *) Changes the default hash to Murmur hash which is faster than the old default One-at-a-time. *) Rips out the old HvREHASH mechanism and replaces it with a per-process random hash seed. *) Changes the old PL_hash_seed from an interpreter value to a global variable. This means it does not have to be copied during interpreter setup or cloning. *) Changes the format of the PERL_HASH_SEED variable to a hex string so that hash seeds longer than fit in an integer are possible. *) Changes the return of Hash::Util::hash_seed() from a number to a string. This is to accomodate hash functions which have more bits than can be fit in an integer. *) Adds new functions to Hash::Util to improve introspection of hashes -) hash_value() - returns an integer hash value for a given string. -) bucket_info() - returns basic hash bucket utilization info -) bucket_stats() - returns more hash bucket utilization info -) bucket_array() - which keys are in which buckets in a hash More details on the new hash functions can be found below: Murmur Hash: (v3) from google, see http://code.google.com/p/smhasher/wiki/MurmurHash3 Superfast Hash: From Paul Hsieh. http://www.azillionmonkeys.com/qed/hash.html DJB2: a hash function from Daniel Bernstein http://www.cse.yorku.ca/~oz/hash.html SDBM: a hash function sdbm. http://www.cse.yorku.ca/~oz/hash.html SipHash: by Jean-Philippe Aumasson and Daniel J. Bernstein. https://www.131002.net/siphash/ They have all be converted into Perl's ugly macro format. I have not done any rigorous testing to make sure this conversion is correct. They seem to function as expected however. All of them use the random hash seed. You can force the use of a given function by defining one of PERL_HASH_FUNC_MURMUR PERL_HASH_FUNC_SUPERFAST PERL_HASH_FUNC_DJB2 PERL_HASH_FUNC_SDBM PERL_HASH_FUNC_ONE_AT_A_TIME Setting the environment variable PERL_HASH_SEED_DEBUG to 1 will make perl output the current seed (changed to hex) and the hash function it has been built with. Setting the environment variable PERL_HASH_SEED to a hex value will cause that value to be used at the seed. Any missing bits of the seed will be set to 0. The bits are filled in from left to right, not the traditional right to left so setting it to FE results in a seed value of "FE000000" not "000000FE". Note that we do the hash seed initialization in perl_construct(). Doing it via perl_alloc() (via init_tls) causes problems under threaded builds as the buffers used for reentrant srand48 functions are not allocated. See also the p5p mail "Hash improvements blocker: portable random code that doesnt depend on a functional interpreter", Message-ID: <CANgJU+X+wNayjsNOpKRqYHnEy_+B9UH_2irRA5O3ZmcYGAAZFQ@mail.gmail.com>
* FieldHash.pm: Fix broken linksKarl Williamson2011-05-181-6/+6
|
* Version bumps for the recent PERL_NO_GET_CONTEXT commitsFather Chrysostomos2011-03-191-1/+1
|
* Add PERL_NO_GET_CONTEXT to Hash::Util::FieldHashNicholas Clark2011-03-191-45/+63
| | | | | For threaded platforms, this reduces the object code size, and should slight reduce CPU usage.
* Version bumps for Hash::Util non-dual-life modules identified byJesse Vincent2011-01-201-1/+1
| | | | ./perl -Ilib Porting/cmpVERSION.pl -xd . v5.13.8
* Fix typos (spelling errors) in ext/*.Peter J. Acklam) (via RT2011-01-072-2/+2
| | | | | | | | | # New Ticket Created by (Peter J. Acklam) # Please include the string: [perl #81882] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=81882 > Signed-off-by: Abigail <abigail@abigail.be>
* bump version of many modulesZefram2010-12-191-1/+1
| | | | | Core-only modules that have changed from v5.13.7, and dual-life modules that have changed from v5.13.7 and didn't show up in earlier passes.
* fix various compiler warnings from XS codeZefram2010-12-111-14/+18
| | | | | | | | | | | Trivial changes to fix warnings of types * unclear precedence * assignment as conditional * signed/unsigned mixing * unused parameter/variable * value computed not used * wrong argument type for a printf format * variable may be used uninitialised (due to unhandled switch case)
* Increase Hash::Util::FieldHash’s versionFather Chrysostomos2010-10-281-1/+1
|
* Merge Hash::Util::FieldHash::_test_uvar_{get,set,same} using ALIAS.Nicholas Clark2010-10-251-34/+7
| | | | | | On this platform it reduces the object code size by over 1K. Ideally these test functions would not be in the installed code, but I can't see an easy way to avoid this.
* In Hash::Util::FieldHash::_test_uvar_set, the second SvRV(sverf) is not needed.Nicholas Clark2010-10-251-1/+0
|
* Convert modules in ext/ to pass minimal arguments to XSLoader::load().Nicholas Clark2010-10-141-2/+2
|
* Remove the $ENV{PERL_CORE} boilerplate from Hash::Util::FieldHash's tests.Nicholas Clark2009-08-308-64/+0
|
* rebump Hash::Util::FieldHash from 1.03_01 to 1.04David Mitchell2009-07-071-1/+1
| | | | (it's not dual-lived so there's no need for a devel version number)
* Remove Makefile.PLs that make_ext.pl can automatically generate.Nicholas Clark2009-04-131-18/+0
| | | | | | (For core modules, or where the dual life module on CPAN has a Makefile.PL that is not the same. AUTHOR is only used for the ppm target, which the core doesn't need.)
* Remove now-redundant references to MAN3PODS in core modules' Makefile.PLs.Nicholas Clark2009-03-261-4/+0
|
* Hash::Util::FieldHash 1.03 leaks SVs which are used as object IDs stored in ↵Goro Fuji2009-02-282-1/+2
| | | | mg->mg_obj
* Rename ext/Hash/Util/FieldHash to ext/Hash-Util-FieldHashNicholas Clark2009-02-0912-0/+2698