perf: extend table on env startup instead of letting zend_hash_copy do it#2272
perf: extend table on env startup instead of letting zend_hash_copy do it#2272
Conversation
frankenphp.c
Outdated
There was a problem hiding this comment.
zend_hash_extend also happens in frankenphp_register_server_vars. You could probably move the zend_hash_copy to frankenphp_register_server_vars, so extending only happens once.
(go_register_server_variables just calls frankenphp_register_server_vars with the expected hash size)
|
Not sure why the preload sometimes segfaults, maybe |
I don't think it's related to this PR as the segfaults are happening on multiple branches. |
|
Oh you're right, seems to be related to PHP 8.2. The 'build docker images' workflow wasn't triggered on the branch that added the test. |
|
Yeah I'm longing for 2027 to drop 8.2 and debian buster/rhel 8 support. |
this can potentially save us a few internal calls to zend_hash_do_resize while it loops over the source table (main_thread_env)
8 -> 16 -> 32 -> 64 -> 128becomes8 -> target_size (rounded to power of 2) 128.