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

Performance has gotten significantly worse #2719

Closed
brson opened this issue Jun 25, 2012 · 10 comments
Closed

Performance has gotten significantly worse #2719

brson opened this issue Jun 25, 2012 · 10 comments
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code.
Milestone

Comments

@brson
Copy link
Contributor

brson commented Jun 25, 2012

Rustbot shows graph500-bfs, rustc, k-nucleotide, mandelbrot, and others as losing a lot of perf.

graph500-bfs went from a few seconds to thousands of seconds. Rustbot fingers 1d6fb24 as the culprit.

@eholk
Copy link
Contributor

eholk commented Jun 25, 2012

It seems like there's a good chance this is related to me moving vector append into the library. I'm making a few tweaks now that should improve performance.

@eholk
Copy link
Contributor

eholk commented Jun 25, 2012

Actually, after looking at the graphs some more, it looks like my change isn't responsible for the latest perf regression. That said, there's still a few v += [x] expressions that can be replaced with push(v, x).

@msullivan
Copy link
Contributor

Tracked it down. It looks like the libcore vector code was (accidentally) not getting called until my patch landed.

So the regression is due to moving vec append to the library, and the extra copies that causes.

@eholk
Copy link
Contributor

eholk commented Jun 26, 2012

I just did a grep for += [ over the whole tree, and there are still a lot of singleton vector appends to track down. This should win back the perf we lost on rustc.

How hard would it be to let us pass self by - or +? This seems like a better long term fix than telling everyone just to use vec::push.

The issue for allowing modes on self is #2585.

@pcwalton
Copy link
Contributor

I think dvec is probably the real long-term fix, no?

eholk added a commit that referenced this issue Jun 26, 2012
@eholk
Copy link
Contributor

eholk commented Jun 26, 2012

@msullivan just pointed out that vec::push_all and vec::append are doing a lot of unnecessary bounds checks that could probably be removed using unsafe code. This could gain some of our speed back.

@catamorphism
Copy link
Contributor

@eholk and @msullivan : is this resolved for now?

@eholk
Copy link
Contributor

eholk commented Jun 28, 2012

The perf bots are still showing that we're about 5 seconds behind where we used to be on rustc. There's definitely more work to do, but to me the performance is tolerable again.

I can keep trying to win back those 5 seconds if people don't want to take the hit.

eholk added a commit that referenced this issue Jun 28, 2012
eholk added a commit that referenced this issue Jun 28, 2012
Didn't update shape because the changes were causing segfaults.
@eholk
Copy link
Contributor

eholk commented Jun 29, 2012

I replaced pretty much all the calls to + with various append, push, push_all, append_one calls, and now rustc is faster than it was before.

@eholk eholk closed this as completed Jun 29, 2012
@brson
Copy link
Contributor Author

brson commented Jun 29, 2012

Nice work @eholk!

RalfJung pushed a commit to RalfJung/rust that referenced this issue Dec 24, 2022
Aaron1011 pushed a commit to Aaron1011/rust that referenced this issue Jan 6, 2023
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
…driver (rust-lang#2719)

Co-authored-by: Felipe R. Monteiro <rms.felipe@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code.
Projects
None yet
Development

No branches or pull requests

5 participants