You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And for ZEND_IS_NOT_IDENTICAL.
- Take advantage of branch prediction in cases that are false/true
- Avoid function call and duplicate fetches of Z_TYPE_P in common use cases
- Avoid checking for EG(exception) when it's impossible.
I think that the zval would always be IS_NULL or lower for an exception,
but may be wrong.
Aside 1: I see that ZEND_IS_EQUAL does have the `SMART_BRANCH` in the
`SPEC`, generating optimized implementations based on what type of smart
branch is used. Is excluding it from ZEND_IS_IDENTICAL deliberate,
and if so, what's the reasoning?
(e.g. is the use in common applications low?)
- The SMART_BRANCH specialization was introduced in
27e01cd
Aside 2: The function pointer for ZEND_IS_EQUAL_LONG can probably be used
directly for ZEND_IS_IDENTICAL_LONG. I'm not sure how to generate that.
(and DOUBLE)
The amount of time for nestedloop_ni(20) decreased from 0.726s to
0.593s due to this change.
This is still worse than `!=` (0.434) and `<` (0.375), which
have implementations that take advantage of branch prediction for
IS_LONG
```php
function nestedloop_ni($n) {
$x = 0;
for ($a=0; $a!==$n; $a++)
for ($b=0; $b!==$n; $b++)
for ($c=0; $c!==$n; $c++)
for ($d=0; $d!==$n; $d++)
for ($e=0; $e!==$n; $e++)
for ($f=0; $f!==$n; $f++)
$x++;
print "$x\n";
}
```
0 commit comments