Category
Foundation: · closed-but-not-done · child of #36379
Problem
#36191 was closed by "HashTable: DJB hash index for string-key lookup" + "O(1) string-key append via strKeysTail (#36191 partial)". Re-verified on master 1edb103c34 with the issue's own probe ($a["k$i"] = $i then isset+read for all keys):
| n |
2026-09-01 |
2026-09-02 |
Zend |
| 5,000 |
171 s |
0.133 s |
0.028 s |
| 20,000 |
> 300 s |
2.40 s |
0.037 s |
| 100,000 |
> 300 s |
> 120 s (timeout) |
0.086 s |
4x more keys → 18x the time: still ~n^2. The 5k case improved 1,300x (the {main} copy-per-store, #36252, was the first-order term), but the structure is not a hash table yet on at least one of: the index is not consulted on isset/read (only on insert), the index never grows (fixed bucket count → chains of n/buckets), or strKeysTail append still walks. The issue's Done-when required "within 2x of Zend at 100k" — not met.
PHP implementation target
Done when
Category
Foundation:· closed-but-not-done · child of #36379Problem
#36191 was closed by "HashTable: DJB hash index for string-key lookup" + "O(1) string-key append via strKeysTail (#36191 partial)". Re-verified on master
1edb103c34with the issue's own probe ($a["k$i"] = $ithenisset+read for all keys):4x more keys → 18x the time: still ~n^2. The 5k case improved 1,300x (the
{main}copy-per-store, #36252, was the first-order term), but the structure is not a hash table yet on at least one of: the index is not consulted onisset/read (only on insert), the index never grows (fixed bucket count → chains of n/buckets), orstrKeysTailappend still walks. The issue's Done-when required "within 2x of Zend at 100k" — not met.PHP implementation target
PHPC_HT_STATS=1counter in the helper) — if comparisons grow with n, the index is not used or not resized.arData+arHashwith power-of-two resize at load factor, hash cached on the string, used by every string-key entry point (setStringKey*,readStringKey*,offsetIsSetStringKey,unsetStringKey,peek), and the iteration order kept by the ordered array (not by the linked list).Done when
foreachorder,ksort/asort,unset+re-add, numeric-string normalisation differential cases green;--aot --repeat 3unchanged