[php-src] Issue #10854: TSRM should set a smarter value for expected_threads
| From: | nielsdos | Date: | Tue, 14 Mar 2023 23:27:28 +0000 |
| Subject: | [php-src] Issue #10854: TSRM should set a smarter value for expected_threads | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-243910@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/10854
Author: nielsdos
### Description
The
tsrm_startup() function is currently always called with expected_threads =
1. This means that the hashtable used in the TSRM will only contain a single bucket, and all
thread resources will therefore be in the same linked list. So it's not really a hashtable atm,
even though it's supposed to be.
We could improve performance in principle by choosing a more appropriate value for
expected_threads, by somehow letting the SAPI give an estimation based on its
configuration.
I noticed this while working on #10737.