Re: com php-src: hashmap sizes: ext/opcache/zend_accelerator_hash.c
| From: | Nikita Popov | Date: | Sun, 01 Feb 2015 10:34:48 +0000 |
| Subject: | Re: com php-src: hashmap sizes: ext/opcache/zend_accelerator_hash.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-84548@lists.php.net to get a copy of this message | ||
On Mon, Dec 8, 2014 at 1:54 PM, Stanislav Malyshev <stas@php.net> wrote:
> Commit: 3141922321b000d6d9b186e781a6849c18324f21
> Author: Adrian <kontakt@adrianslowik.pl> Mon, 8 Dec 2014
> 13:54:12 +0100
> Parents: 999545258308effa49fde71b7af7fdd991256e3a
> Branches: master
>
> Link:
>
> http://git.php.net/?p=php-src.git;a=commitdiff;h=3141922321b000d6d9b186e781a6849c18324f21
>
> Log:
> hashmap sizes
>
> Changed paths:
> M ext/opcache/zend_accelerator_hash.c
>
>
> Diff:
> diff --git a/ext/opcache/zend_accelerator_hash.c
> b/ext/opcache/zend_accelerator_hash.c
> index 6717922..c399d89 100644
> --- a/ext/opcache/zend_accelerator_hash.c
> +++ b/ext/opcache/zend_accelerator_hash.c
> @@ -26,7 +26,7 @@
>
> /* Generated on an Octa-ALPHA 300MHz CPU & 2.5GB RAM monster */
> static uint prime_numbers[] =
> - {5, 11, 19, 53, 107, 223, 463, 983, 1979, 3907, 7963, 16229,
> 32531, 65407, 130987, 262237, 524521, 1048793 };
> + {5, 11, 19, 53, 97, 193, 389, 769, 1543, 3079, 6151, 12289, 24593,
> 49157, 98317, 196613, 393241, 786433, 1572869, 3145739, 6291469, 12582917,
> 25165843, 50331653, 100663319, 201326611, 402653189, 805306457, 1610612741
> };
> static uint num_prime_numbers = sizeof(prime_numbers) / sizeof(uint);
>
> void zend_accel_hash_clean(zend_accel_hash *accel_hash)
>
If anyone is wondering where these come from and why these particular
primes were chosen, seems like the source is
http://planetmath.org/goodhashtableprimes.
Nikita