mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Adjust default value of opcache.jit_hot_loop to a prime number
Loops whose number of iterations + 1 is a factor of opcache.jit_hot_loop will always be traced at the exact moment the loop condition evaluates to false. As a result, these loops can never be JIT'ed successfully. Here I adjust the default value of opcache.jit_hot_loop to a prime number, so this can not happen (unless number of iterations+1 is opcache.jit_hot_loop). Closes GH-18573
This commit is contained in:
3
NEWS
3
NEWS
@@ -111,9 +111,10 @@ PHP NEWS
|
||||
. Added mysqlnd.collect_memory_statistics to ini quick reference.
|
||||
(hauk92)
|
||||
|
||||
- OPcache:
|
||||
- Opcache:
|
||||
. Fixed ZTS OPcache build on Cygwin. (cmb)
|
||||
. Added opcache.file_cache_read_only. (Samuel Melrose)
|
||||
. Updated default value of opcache.jit_hot_loop. (Arnaud)
|
||||
|
||||
- Output:
|
||||
. Fixed calculation of aligned buffer size. (cmb)
|
||||
|
||||
@@ -460,6 +460,9 @@ PHP 8.5 UPGRADE NOTES
|
||||
Note: A cache generated with a different build of PHP, a different file
|
||||
path, or different settings (including which extensions are loaded), may be
|
||||
ignored.
|
||||
. The default value of opcache.jit_hot_loop is now 61 (a prime) to prevent it
|
||||
from being a multiple of loop iteration counts.
|
||||
It is recommended that this parameter is set to a prime number.
|
||||
|
||||
========================================
|
||||
12. Windows Support
|
||||
|
||||
@@ -323,7 +323,8 @@ ZEND_INI_BEGIN()
|
||||
STD_PHP_INI_ENTRY("opcache.jit_max_root_traces" , "1024", PHP_INI_SYSTEM, OnUpdateLong, max_root_traces, zend_jit_globals, jit_globals)
|
||||
STD_PHP_INI_ENTRY("opcache.jit_max_side_traces" , "128", PHP_INI_SYSTEM, OnUpdateLong, max_side_traces, zend_jit_globals, jit_globals)
|
||||
STD_PHP_INI_ENTRY("opcache.jit_max_exit_counters" , "8192", PHP_INI_SYSTEM, OnUpdateLong, max_exit_counters, zend_jit_globals, jit_globals)
|
||||
STD_PHP_INI_ENTRY("opcache.jit_hot_loop" , "64", PHP_INI_SYSTEM, OnUpdateCounter, hot_loop, zend_jit_globals, jit_globals)
|
||||
/* Defautl value should be a prime number, to reduce the chances of loop iterations being a factor of opcache.jit_hot_loop */
|
||||
STD_PHP_INI_ENTRY("opcache.jit_hot_loop" , "61", PHP_INI_SYSTEM, OnUpdateCounter, hot_loop, zend_jit_globals, jit_globals)
|
||||
STD_PHP_INI_ENTRY("opcache.jit_hot_func" , "127", PHP_INI_SYSTEM, OnUpdateCounter, hot_func, zend_jit_globals, jit_globals)
|
||||
STD_PHP_INI_ENTRY("opcache.jit_hot_return" , "8", PHP_INI_SYSTEM, OnUpdateCounter, hot_return, zend_jit_globals, jit_globals)
|
||||
STD_PHP_INI_ENTRY("opcache.jit_hot_side_exit" , "8", PHP_INI_ALL, OnUpdateCounter, hot_side_exit, zend_jit_globals, jit_globals)
|
||||
|
||||
Reference in New Issue
Block a user