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
Hack traversals for speed #110
Conversation
Pypy is 0.90s. |
For posterity, could also report the runtimes for the rust-port on your machine? cargo new --bin symoxide_contest
cd symoxide_contest
cargo add symoxide
curl https://gist.githubusercontent.com/kaushikcfd/74c442a075557dad466cd3daea9c151f/raw/d593ce7d5a6de6764e541921472456c8528efb3b/symoxide_expr_traversal.rs > src/main.rs
cargo run --release |
Just ran this. Somewhere around .28s.
|
So pypy times seem super variable. Just reran, with
(nominally unchanged to before) and got 0.63s. |
I have an idea for a Python-side AST-to-AST transform that would eliminate the bounces to |
Maybe earlier the JIT costs were also included? Also, not sure if tracing JIT is mature enough to compete with AOT compilers for such workloads in terms of both -- compilation overheads and quality of generated code. |
What does "mature" mean to you here? For me, I'm interested in correctness and speed, in that order. 🙂 |
8ac5423
to
472862e
Compare
The "mapper optimizer" is now a thing. It succeeds at removing passed-through It also contains a code path for inlining |
The doc failure is sphinx-doc/sphinx#10861. |
Bumped the baseline by a bit, see kaushikcfd/symoxide#3 :). |
457ce74
to
79f21b0
Compare
The final tally here:
There is a loopy failure, but that's just a doctest fail because this turns off flatten-by-default in the |
79f21b0
to
8c65f8b
Compare
There's actually a path towards merging this now.
The mapper optimizer needs documentation.(Decided against this; it requires a fair bit of care to use, and the sharp edges may not be obvious to users. Added a comment.)The root of this is this contest set up by @kaushikcfd to show that we should all abandon Python for Rust (or some other AOT statically-typed language).
Here's my fork of @kaushikcfd's gist: https://gist.github.com/inducer/25e3372fd5c82384d437c777ed4153e9
Latest results:
print
statements removed.