Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
base repository: php/php-src
base: master
Choose a base ref
head repository: nikic/php-src
compare: integerHash
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 5 commits
  • 26 files changed
  • 1 contributor

Commits on Oct 1, 2016

  1. Implement key union

    Hashtable bucket keys are now represented using a union:
    
        union zend_bucket_key {
            zend_string *str;
            zend_ulong num;
        }
    
    The bucket->h value is now a pure hash and no longer doubles as
    being the integer key value.
    
    The top bit of bucket->h (HT_IS_STR_BIT) determines whether the
    key is a string or and integer. We can do this, because the top
    bit will always be 1 after hashtable mask application, so its
    value does not influence bucket distribution quality.
    
    The zend_hash_integer() function is a bit of a misnomer -- introducing
    integer hashing is not as simple as replacing this function.
    nikic committed Oct 1, 2016
    Copy the full SHA
    1ca85d0 View commit details
    Browse the repository at this point in the history
  2. Implement integer hash function

    For testing using a Murmur64 finalizer.
    nikic committed Oct 1, 2016
    Copy the full SHA
    909d101 View commit details
    Browse the repository at this point in the history
  3. Switch string hash to SipHash-2-4

    Using dummy key for testing.
    
    After changing hash implementation run to avoid full rebuild:
    
    touch Zend/zend_hash.c Zend/zend_string.c ext/oci8/oci8.c \
    ext/opcache/zend_accelerator_hash.c sapi/phpdbg/phpdbg_bp.c \
    sapi/phpdbg/phpdbg_cmd.c
    
    Conflicts:
    	Zend/zend_string.h
    nikic committed Oct 1, 2016
    Copy the full SHA
    4da7f63 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    4c8cd68 View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    a3a99c9 View commit details
    Browse the repository at this point in the history