PHP 는 프로세스가 실행후 죽으므로 각각의 프로세스는 독립되어있음


동시환경이란 swoole 이랑 프랑켄 php 같은 프로세스가 죽지않는 환경임


뮤텍스락이 걸려있는데 이를 해결함으로서 20~40% 가까이 향상되었다는


https://github.com/php/php-src/pull/13974

[wip] Remove zend_strtod mutex by arnaud-lb · Pull Request #13974 · php/php-srczend_strtod.c uses a global state (mostly an allocation freelist) protected by a mutex in ZTS builds. This state is used by zend_dtoa(). This creates a lot of contention in concurrent loads. zend_d...github.com



The impact on non-concurrent environments is null or negligible, but there is a considerable speed up on concurrent environments, especially on Alpine/Musl. When comparing master to this branch, the frankenphp-demo is sped up 10% under Apache/musl, 20% under FrankenPHP/glibc, and 40% under FrankenPHP/musl. Some synthetic benchmark is 80% faster.



# Event 'cpu_atom/cycles/P' # # Baseline Delta Abs Shared Object Symbol # ........ ......... ................... ....................................................................... # 30.24% -30.23% [kernel.kallsyms] [k] native_queued_spin_lock_slowpath 7.80% +9.31% libphp.so [.] execute_ex 2.39% +4.45% libphp.so [.] zend_gc_collect_cycles 4.62% +4.21% libz.so.1.3.1 [.] 0x0000000000003da8 3.74% -3.74% ld-musl-x86_64.so.1 [.] pthread_mutex_timedlock 2.90% -2.89% ld-musl-x86_64.so.1 [.] pthread_mutex_lock 0.98% +2.19% libphp.so [.] gc_scan 1.89% -1.88% ld-musl-x86_64.so.1 [.] pthread_mutex_unlock 1.06% +1.43% libphp.so [.] zend_hash_find 1.30% +1.38% frankenphp [.] 0x0000000000009f06 1.76% +1.34% ld-musl-x86_64.so.1 [.] memcpy 1.22% -1.21% [kernel.kallsyms] [k] futex_wake 1.21% -1.19% [kernel.kallsyms] [k] try_to_wake_up