mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Refactor GC data traversal loops
Previusly, to redce stack usage GC traversed object properties and array elements in both directions. At first, it seeked backward from the last element, to find the last refcounted zval. Then, it traversed elements forward. As result, we had 2 non-spatial memory accesses for each object/array and usuall 2 expensive CPU cache misses. Now all the traversal algorithms are refactored to scan elements only in forward direction. The number of checks and GC stack usage should be the same. The order of element processing may be differenr, but this should not be a problem.
This commit is contained in:
parent
885f935090
commit
4b4b9edcc0
1 changed files with 416 additions and 506 deletions
922
Zend/zend_gc.c
922
Zend/zend_gc.c
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue