php-src/ext/zend_test
Tyson Andre 7504cf189b
Improve performance of WeakReference/WeakMap. Avoid hash collisions on pointers. (#7690)
Shift pointers by ZEND_MM_ALIGNMENT_LOG2
to avoid the noticeable performance degradation caused by hash table collisions.
in `EG(weakrefs)` and zend_weakmap->ht

On 64-bit platforms, pointers are usually aligned to at least 8 bytes,
so only one in 8 hash buckets were actually getting used.
(With the metadata needed to track allocations,
alignment might be at least 16 bytes in practice)

Address review comments, add optimization

Make it public for any extensions that need to work with EG(weakrefs)
for instrumentation, debugging, etc. (e.g. zend_test)

PHP 8.1 and previous releases would use the raw pointer value as a hash key instead.
2021-11-27 19:52:30 -05:00
..
tests Merge branch 'PHP-8.1' 2021-10-21 19:32:20 +02:00
config.m4 Reorganize zend_test and add custom fiber implementation tests (#7137) 2021-06-11 12:25:47 -05:00
config.w32 Reorganize zend_test and add custom fiber implementation tests (#7137) 2021-06-11 12:25:47 -05:00
fiber.c Flexible fiber bailout handling (#7163) 2021-06-18 11:01:10 -05:00
fiber.h Flexible fiber bailout handling (#7163) 2021-06-18 11:01:10 -05:00
fiber.stub.php Add test for leaking prior context with symmetric coroutines 2021-06-12 00:10:17 -05:00
fiber_arginfo.h Add test for leaking prior context with symmetric coroutines 2021-06-12 00:10:17 -05:00
observer.c Release observed function name table 2021-09-16 10:38:28 +02:00
observer.h Reorganize zend_test and add custom fiber implementation tests (#7137) 2021-06-11 12:25:47 -05:00
php_test.h Merge branch 'PHP-8.0' into PHP-8.1 2021-10-21 13:42:20 +02:00
test.c Improve performance of WeakReference/WeakMap. Avoid hash collisions on pointers. (#7690) 2021-11-27 19:52:30 -05:00
test.stub.php Warn if return type on internal __toString() is missing 2021-11-09 10:24:41 +01:00
test_arginfo.h Merge branch 'PHP-8.1' 2021-11-15 11:05:52 +01:00