Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quicken everything #98686

Open
brandtbucher opened this issue Oct 25, 2022 · 1 comment
Open

Quicken everything #98686

brandtbucher opened this issue Oct 25, 2022 · 1 comment
Assignees
Labels
3.12 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage

Comments

@brandtbucher
Copy link
Member

brandtbucher commented Oct 25, 2022

...as discussed in faster-cpython/ideas#462.

Basically, we can simplify the quickening process by quickening code objects as they are created. This works by ditching our per-code-object warmup counter, and instead using our adaptive backoff counters for more-granular "warming".

I have a branch that implements this change, resulting in consistent a ~1% performance improvement. I imagine that this comes from several places:

  • A lower specialization threshold. I tried a wide range of initial adaptive counter values (ranging from 0 to 4095), and a value of 1 worked best. With this value, adaptive instructions will specialize the second time they are run.
  • A simpler interpreter loop. RESUME_QUICK and JUMP_BACKWARD_QUICK are no longer needed.
  • Superinstructions everywhere. All code objects have superinstructions now.

Next steps will be simplifying the unmarshal / code creation process as part of this same work.

@brandtbucher brandtbucher added performance Performance or resource usage interpreter-core (Objects, Python, Grammar, and Parser dirs) 3.12 bugs and security fixes labels Oct 25, 2022
@brandtbucher brandtbucher self-assigned this Oct 25, 2022
@brandtbucher brandtbucher changed the title Quicken Everything Quicken everything Oct 25, 2022
@brandtbucher
Copy link
Member Author

Leaving this open since we want to move most of this logic to the compile and unmarshal steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage
Projects
None yet
Development

No branches or pull requests

1 participant