Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for changing the global, default allocator (RFC 1974) #27389
Comments
alexcrichton
added
the
B-RFC-approved
label
Jul 29, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Jul 30, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Jul 30, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Jul 30, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Jul 30, 2015
alexcrichton
referenced this issue
Jul 30, 2015
Merged
rustc: Allow changing the default allocator #27400
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Jul 30, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Jul 30, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Jul 31, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Aug 4, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Aug 5, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Aug 5, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Aug 5, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Aug 10, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Aug 10, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Aug 10, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Aug 10, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Aug 11, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Aug 11, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Aug 11, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Aug 11, 2015
alexcrichton
added
the
T-libs
label
Aug 11, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Aug 12, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Aug 12, 2015
bors
added a commit
that referenced
this issue
Aug 13, 2015
bors
added a commit
that referenced
this issue
Aug 13, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Aug 13, 2015
bors
added a commit
that referenced
this issue
Aug 13, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Aug 13, 2015
This comment has been minimized.
This comment has been minimized.
|
Depending on how we handle its link visibility, the overhead may even be less than calling |
This comment has been minimized.
This comment has been minimized.
|
@SimonSapin note that the cost is also reduced to zero in cases of LTO. |
This comment has been minimized.
This comment has been minimized.
|
Alright, if people are confident that this is not an issue please carry on :) |
This comment has been minimized.
This comment has been minimized.
|
However, at least for non-LTO the missing inlining does incur some cost, e.g. the |
matthewjasper
referenced this issue
Apr 3, 2018
Open
Custom global allocators (RFC 1398, RFC 1974) #287
This comment has been minimized.
This comment has been minimized.
|
Drive-by-comment: Currently, the Should there be a separate |
This was referenced Apr 4, 2018
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this issue
Apr 13, 2018
This comment has been minimized.
This comment has been minimized.
|
I am certainly not very happy that we're making performance worse in the normal case. LTO is nice, but it's very expensive, so most programs are not compiled with LTO--it's a huge hammer for attacking this problem, and isn't actually necessary today. Moreover, relying excessively on LTO for performance runs counter to the goal of improving Rust's compilation speed for optimized builds. Allocation is a huge hotspot for many programs, and I don't think we should reduce allocation performance in a way that can only be recovered with compiler magic that people rarely enable. |
This comment has been minimized.
This comment has been minimized.
|
@pythonesque Worse than what? As far as I can tell this indirection has existed since at least #27400 in Rust 1.4.0, released in 2015. |
This comment has been minimized.
This comment has been minimized.
I think what would help is if The way it is now, if you want LTO you have to enable it for all release builds, included "development" release builds you are just building and running to test our some performance intensive piece of the software. |
This comment has been minimized.
This comment has been minimized.
Mazwak
commented
Apr 20, 2018
No. You can add a [profile.release] in your cargo.toml. And it will apply to release builds only. On topic, it would be nice if one could choose the system allocator the same way. Something simple for the end user. Like "allocator = system" in the [target]. |
This comment has been minimized.
This comment has been minimized.
|
@Mazwak Right now the incantation is: #[global_allocator] static A: std::alloc::System = std::alloc::System;But the plan is to eventually make |
SimonSapin
referenced this issue
May 24, 2018
Closed
Make rustc use jemalloc through #[global_allocator] #51038
kennytm
referenced this issue
May 26, 2018
Merged
Ensure every unstable language feature has a tracking issue. #51090
bors
added a commit
that referenced
this issue
May 26, 2018
bors
added a commit
that referenced
this issue
May 27, 2018
SimonSapin
added a commit
to glandium/rust
that referenced
this issue
May 31, 2018
glandium
referenced this issue
May 31, 2018
Merged
Stabilize GlobalAlloc and #[global_allocator] #51241
This comment has been minimized.
This comment has been minimized.
|
Stabilization PR: #51241 (finally!) |
glandium
added a commit
to glandium/rust
that referenced
this issue
Jun 2, 2018
SimonSapin
added a commit
to glandium/rust
that referenced
this issue
Jun 11, 2018
bors
added a commit
that referenced
this issue
Jun 12, 2018
bors
closed this
in
#51241
Jun 12, 2018
This comment has been minimized.
This comment has been minimized.
|
Oh I forgot to mention my ~ month-old RFC rust-lang/rfcs#2492 that would subsume |
This comment has been minimized.
This comment has been minimized.
|
@Ericson2314 The At this point the existence of an alternative design proposal is not enough to justify an emergency revert in my opinion. |
This comment has been minimized.
This comment has been minimized.
|
That's fine. I just wanted to not this in the proper place. |
alexcrichton commentedJul 29, 2015
•
edited
Tracking issue for
rust-lang/rfcs#1183rust-lang/rfcs#1974Known bugs:
#[global_allocator]attribute doesn't work in modules #44113Current status:
A quick summary of the current state of this feature is that you can change the default global allocator via: