Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize unserializing arrays with apc.serializer=default
The pointer data apcu sees is usually aligned to 16 bytes on 64-bit systems using emalloc. It is guaranteed to be aligned to a power of at least ZEND_MM_ALIGNMENT_LOG2. Preserve the original bits just in case, similar to opcache's zend_rotr3. Benchmarking this for repeatedly unserializing large arrays with small strings and apc.serializer=default, this showed a moderate performance improvement. (note that apcu_fetch returns a different array on every call due to the possibility of cache evictions) For an array with 65536 small string keys and values: Repeated apcu_fetch went from 3.5 seconds -> 3.0 seconds For an array with 4096 small string keys and values: Repeated apcu_fetch went from 1.2 seconds -> 0.9 seconds For #323
- Loading branch information