[php-src] Issue #8619: Relocate JIT buffer close to PHP and achieve 2% more performance
| From: | stkeke | Date: | Tue, 24 May 2022 02:00:17 +0000 |
| Subject: | [php-src] Issue #8619: Relocate JIT buffer close to PHP and achieve 2% more performance | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241579@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8619
Author: stkeke
### Description
This is a JIT buffer relocation experiment inspired by this blog
https://v8.dev/blog/short-builtin-calls
> For 64-bit applications, branch prediction performance can be
negatively impacted when the target of a branch is more than
4 GB away from the branch.
We set up a big 500MB char array which is close to PHP .text segment
and use it as our own JIT buffer (originally allocated by opcache.so and
was close to opcache in virtual address).
In our benchmark, we found PHP interpreter achieved 2% performance
and much better branching performance.
Hopefully, you community experts can advise a more elegant and robust
method to implement this performance optimization.
Here is what did a super simple experiment and the reference patch: https://github.com/php/php-src/pull/8618