Skip to content

Trans refactor was major perf perturbance #3402

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

Closed
graydon opened this issue Sep 6, 2012 · 14 comments
Closed

Trans refactor was major perf perturbance #3402

graydon opened this issue Sep 6, 2012 · 14 comments
Assignees
Labels
A-codegen Area: Code generation I-slow Issue: Problems and improvements with respect to performance of generated code.
Milestone

Comments

@graydon
Copy link
Contributor

graydon commented Sep 6, 2012

I can't say exactly whether it's good or bad, but the perf numbers went sideways a fair bit with the refactoring of trans in 5e36a99. Some numbers dropped, some went up a lot (factor of 2 on fibo and sudoku), and we lost about 5s on self-compile time.

All of this is potentially tolerable, I'm not suggesting we back it out (so nice!) but it's probably worth looking at a couple of the smaller benchmarks at least, maybe comparing a count-llvm-insns graph and/or the LLVM bitcode output, to see if something changed obviously (by mistake) in the code we're generating.

@ghost ghost assigned nikomatsakis Sep 6, 2012
@nikomatsakis
Copy link
Contributor

not unexpected, will take a look

@nikomatsakis
Copy link
Contributor

The main cause seems to be larger stack size due to, I believe, deferred loads. This causes morestack to be invoked more often, leading to slower performance. I am looking into whether it's worth fixing this.

@bblum
Copy link
Contributor

bblum commented Sep 6, 2012

i am surprised that morestack would alone be responsible for up to 2x hits on some test cases. maybe believable, though, if these rare ones are stack-heavy(?) tests.

nikomatsakis added a commit that referenced this issue Sep 6, 2012
Should lead to smaller stack frames, hopefully reducing
the perf hits we saw
@catamorphism
Copy link
Contributor

Commit ee4ba44 appears to cause a segfault in run-pass/cci_capture_clause.

@nikomatsakis
Copy link
Contributor

@bblum fibonacci is basically all about calls. Basically all it does is morestack.

@nikomatsakis
Copy link
Contributor

@catamorphism where are you observing this segfault? I don't see it locally and the bots seem fine.

@nikomatsakis
Copy link
Contributor

fibo perf looks fine now. rustc performance is still lower, though that can be a result of many factors. When I test locally, however, rustc performs precisely the same both before and after the patch.

@catamorphism
Copy link
Contributor

@nikomatsakis It segfaults on my machine. The executable x86_64-apple-darwin/test/run-pass/cci_capture_clause.stage2-x86_64-apple-darwin segfaults when run.

@catamorphism
Copy link
Contributor

It also causes one of the libstd tests to segfault on my other machine. I haven't figured out which one yet. Reverting that patch fixes it.

@nikomatsakis
Copy link
Contributor

Segfault fixed in 14303ba

@nikomatsakis
Copy link
Contributor

I still haven't tracked down the msgsend-pipes.rs slowdown. I don't see it locally, so it's probably yet another stack usage thing.

@nikomatsakis
Copy link
Contributor

Deferring to 0.5---I think this is basically "done" anyhow.

@graydon
Copy link
Contributor Author

graydon commented Sep 18, 2012

044fbea caused a curious failure (the compile-fail test issue-1763.rs started passing because the typechecker's unused-variable-check loop seems to be mistranslated), so backing int out.

@pcwalton
Copy link
Contributor

This is not really actionable anymore.

bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
set the TARGET envar for the stdsimd integration test
RalfJung pushed a commit to RalfJung/rust that referenced this issue Mar 25, 2024
miri script: build with stable toolchain

`./miri toolchain` sets up a `rustup override miri`. But then if something goes wrong and the `miri` toolchain doesn't work, one can't even run `./miri toolchain` again as building miri-script needs a toolchain...

So let's always use stable to build miri-script, making it override-independent. I assume everyone will have that installed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation I-slow Issue: Problems and improvements with respect to performance of generated code.
Projects
None yet
Development

No branches or pull requests

5 participants