RE: [PHP-DEV] Reason for ZEND_JIT_COUNTER_INIT set to 32531?
Thanks Dmitry for the information. With a few debug sessions, I found that 32531 is working well for any thresholds, and is also a big prime number :-). -Original Message- From: Dmitry Stogov Sent: Monday, January 17, 2022 1:37 PM To: Su, Tao Cc: PHP internals Subject: Re: [PHP-DEV] Reason for ZEND_JIT_COUNTER_INIT set to 32531? This it's my choice. This number is common for all JIT counters (hot_loop, hot_func, hot_return). It's value was selected to provide the best precision when different counters have different thresholds. Unfortunately, I can't remember the exact equations or logic I used at that time. Thanks. Dmitry. On Thu, Jan 13, 2022 at 1:01 PM Su, Tao wrote: > Hi Internal, > I am not sure this is a correct mail list for asking source code > related question. > If not, I am sorry. Appreciate you guys' help. > > I am reading PHP8 JIT related source code and found that zend_jit.h > has a magic definition ZEND_JIT_COUNTER_INIT as 32531 which I do not > quite understand how this number was chosen and why? > Anybody can provide some historic information? > #define ZEND_JIT_COUNTER_INIT 32531 > > A code example using this definition (looks like the 2nd parameter > computes into a fixed number if hot_func is set by php.ini) > ZEND_OPCODE_TAIL_CALL_EX(zend_jit_trace_counter_helper, > ((ZEND_JIT_COUNTER_INIT + JIT_G(hot_func) - 1) / > JIT_G(hot_func))); > > > === > Tony Su (Su, Tao) > make a 'lazy' programmer diligently with efficiency > > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php
Re: [PHP-DEV] Reason for ZEND_JIT_COUNTER_INIT set to 32531?
This it's my choice. This number is common for all JIT counters (hot_loop, hot_func, hot_return). It's value was selected to provide the best precision when different counters have different thresholds. Unfortunately, I can't remember the exact equations or logic I used at that time. Thanks. Dmitry. On Thu, Jan 13, 2022 at 1:01 PM Su, Tao wrote: > Hi Internal, > I am not sure this is a correct mail list for asking source code related > question. > If not, I am sorry. Appreciate you guys' help. > > I am reading PHP8 JIT related source code and found that zend_jit.h has a > magic definition > ZEND_JIT_COUNTER_INIT as 32531 which I do not quite understand how this > number was chosen and why? > Anybody can provide some historic information? > #define ZEND_JIT_COUNTER_INIT 32531 > > A code example using this definition (looks like the 2nd parameter > computes into a fixed number if hot_func is set by php.ini) > ZEND_OPCODE_TAIL_CALL_EX(zend_jit_trace_counter_helper, > ((ZEND_JIT_COUNTER_INIT + JIT_G(hot_func) - 1) / > JIT_G(hot_func))); > > > === > Tony Su (Su, Tao) > make a 'lazy' programmer diligently with efficiency > >
[PHP-DEV] Re: [VOTE] User Defined Operator Overloads
On Sun, Jan 2, 2022 at 4:13 PM Jordan LeDoux wrote: > Hello internals, > > I've opened voting on > https://wiki.php.net/rfc/user_defined_operator_overloads. The voting will > close on 2022-01-17. > > To review past discussions on this RFC and the feature in general, please > refer to: > > - https://externals.io/message/116611 | Current RFC discussion > - https://externals.io/message/115764 | Initial RFC discussion > - https://externals.io/message/115648 | Pre-RFC discussion and > fact-finding > > Jordan > Internals, The RFC has been declined with a vote of 21 in favor and 24 against. Jordan