You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
array_flip and array_splice stay 3-8x slower than php (hash insert path, cell-typed append) #285
Two functions from the #278 sweep stayed slow after the bulk-copy work, because the cost is in shared machinery rather than in the PHP bodies.
array_flip: 30 ns per element against php's 8. A profile puts index_find at ~45% and index_build at ~20%: the hash-table insert path.
array_splice: 24-36 ns per element against php's 4. The cost is the cell-typed append; the new bulk path works only when the replacement and the input share an element hint, which is not the common case.
Also open from the same sweep: sort of shuffled strings is ~1.7x slower than php (near-sorted input is on par), and in_array over a bare untyped array is ~10x slower because the generic foreach retains and releases every element.
Proposal
Speed up the hash insert path (index probe / build for int and string keys) and give array_splice a bulk path across element hints; then re-measure array_flip, array_unique, array_count_values, which share the insert path.
Activity
Fix the bug backlog: coercion, references, crashes, uninitialised typ…