Skip to content

Relocate JIT buffer close to PHP and achieve 2% more performance #8619

Closed
@stkeke

Description

@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: #8618

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions