Ability to whitelist/blacklist functions from JIT
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
Description
I maintain a decent size, long-running application using PHP.
I've been very excited about the introduction of JIT into PHP before, since as a long-running, CPU-heavy application, it stands to benefit far more from JIT than the average PHP application.
However, our attempts to rollout JIT usage have been constantly thwarted by a plague of crashes and stability issues that have made it unusable for all practical purposes. This remains true as of PHP 8.4, although I will grant that the stability of the JIT does seem a lot better since the introduction of IR.
This issue is a request for some way to whitelist/blacklist code from being JITed.
For example, there is some math-heavy code in PocketMine that benefits from tracing JIT to the tune of a 5x performance improvement. It would be a probably acceptable tradeoff to enable JIT in just that one code pathway to get that huge performance improvement, since we can test that specific part of the code heavily in isolation, while avoiding it in other areas where stability is more important.
Conversely, it would make it much easier to track down JIT issues in large applications if there were some way to blacklist code from being compiled by the JIT, so that code can be A/B tested in parts in real-world conditions.
Perhaps this could take the form of #[AllowJIT] and/or #[DenyJIT] attributes on functions, but maybe there is a better way that I'm not aware of.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no php-src files, tests, or entry points; begin by locating the JIT implementation and its existing configuration or control mechanisms. The requested behavior is a design proposal for selectively enabling or disabling JIT compilation, so an agreed API and acceptance tests would be needed before implementation can be considered done.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, php
- Domain
- compilers, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100