Hashtable collision resolution in PHP 7
| From: | Pawel Por | Date: | Tue, 16 May 2017 09:28:36 +0000 |
| Subject: | Hashtable collision resolution in PHP 7 | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-99056@lists.php.net to get a copy of this message | ||
Hi
I'm trying to understand why PHP 7 hashtables are more efficient than
PHP 5 hashtables.
I'm confused about hashes that are in collision.
In PHP 5 there were a linked lists to resolve collisions.
What about PHP 7 ? Are there still linked lists ?
I read somewhere that the solution taken in PHP 7 is L1 cache friendly
so I conclude PHP 7 cannot resolve collisions using linked lists but
rather arrays.
If so please write me where the buckets that are in collision are
stored in memory I mean by what field the array is pointed to by (e.g.
zval.u2.next) and a few words of high level design of how it is
implemented.
thanks for help