diff options
author | Tyson Andre <tysonandre775@hotmail.com> | 2020-04-19 11:53:36 -0400 |
---|---|---|
committer | Tyson Andre <tysonandre775@hotmail.com> | 2020-04-19 17:31:18 -0400 |
commit | cd56395d4779582506b35c11e6dcd415112113d9 (patch) | |
tree | 5b653ef49b54e38357b51b9786f09b76310884bf /sapi/phpdbg/phpdbg.c | |
parent | 928b25cd6e6a6c6f039b22e7ff55c1a67339256c (diff) | |
download | php-git-cd56395d4779582506b35c11e6dcd415112113d9.tar.gz |
Speed up ZEND_SWITCH_STRING/ZEND_SWITCH_LONG for wrong type
This has the minor benefit of avoiding loading the address of the
jump table when the expression for the switch isn't a string/long.
gcc doesn't seem to optimize that.
The previous function body is the original implementation: ad8652818a5
```
// Before: 0.267s, after: 0.265s
function test_switch($x) {
for ($i = 0; $i < 10000000; $i++) {
switch ($x) {
case 'a':
case 'b':
echo "i=$i\n";
}
}
}
test_switch(null);
```
Closes GH-5419
Diffstat (limited to 'sapi/phpdbg/phpdbg.c')
0 files changed, 0 insertions, 0 deletions