[php-src] PR #20423: standard: Simplify array_chunk()
| From: | ndossche | Date: | Sat, 08 Nov 2025 12:30:17 +0000 |
| Subject: | [php-src] PR #20423: standard: Simplify array_chunk() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-33970@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/20423
Author: ndossche
Shrinks the code size from 682 to 601 bytes on x86-64 with GCC 15.2.1. Does not make a difference in
performance, at least on my i7-4790. I also tried specialising the pack logic like I did with
str_split(), but that is a hit or miss in performance improvement depending on the length. It seems
that the instruction cache is become too full, and the fact that add_next_index_zval() and
zend_hash_next_index_insert() use the same code internally is beneficial.