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
Split out the TYPE_CHECK implementation for resources
- The old version is harder to reason about,
due to having different handling for resources.
Opcache has to check for MAY_BE_RESOURCE when transforming opcodes,
JITing operations, etc.
- Nikic suggested considering a separate opcode in phpGH-4906
Performance impact: no improvement/worsening,
unless hypothetically if is_resource and is_int calls were to alternate.
- I tried optimizations such as avoiding SAVE_OPLINE when possible in
TYPE_CHECK. This somehow made performance worse
(possibly due to larger code size).
Making this COLD might make more sense - I doubt a typical application would
be bottlenecked by is_resource.
E.g. this case was unaffected for `loopnotnull_isnull(0, 30000000);`
```php
function loopnotnull_isnull($a, $b) {
$count = 0;
for ($i = $a; $i < $b; $i++) {
if (is_null($i)) {
$count++;
}
}
return $count;
}
```
**NOTE: opcache.file_cache should be cleared by developers after this
commit**
0 commit comments