-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Published binaries are kinda' slow #3459
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
Comments
Does jemalloc work with musl target?
…On Wed, 4 Mar 2020 at 18:37, Laurențiu Nicola ***@***.***> wrote:
The musl allocator is not one of the fastest ones out there. We should
consider enabling jemalloc if possible.
$ target/release/rust-analyzer analysis-stats . Database loaded, 185 roots, 207.149744ms
Crates in this dir: 27
Total modules found: 391
Total declarations: 6479
Total functions: 4882
Item Collection: 12.928391044s, 0b allocated 0b resident
Total expressions: 134876
Expressions of unknown type: 4420 (3%)
Expressions of partially unknown type: 4193 (3%)
Type mismatches: 271
Inference: 38.903396336s, 0b allocated 0b resident
Total: 51.83179408s, 0b allocated 0b resident
$ target/x86_64-unknown-linux-musl/release/rust-analyzer analysis-stats . Database loaded, 185 roots, 236.729051ms
Crates in this dir: 27
Total modules found: 391
Total declarations: 6479
Total functions: 4882
Item Collection: 14.239506998s, 0b allocated 0b resident
Total expressions: 134876
Expressions of unknown type: 4438 (3%)
Expressions of partially unknown type: 4284 (3%)
Type mismatches: 271
Inference: 44.227304328s, 0b allocated 0b resident
Total: 58.466818431s, 0b allocated 0b resident
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3459>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANB3MZ4Q4FEEAK334Z6INDRF2GV5ANCNFSM4LBOQTMQ>
.
|
It does, with a bit of prodding. I had to set my linker to
|
Noticed that // However, when ripgrep is built with musl, this means ripgrep will use musl's
// allocator, which appears to be substantially worse. (musl's goal is not to
// have the fastest version of everything. Its goal is to be small and amenable
// to static compilation.) Even though ripgrep isn't particularly allocation
// heavy, musl's allocator appears to slow down ripgrep quite a bit. Therefore,
// when building with musl, we use jemalloc.
//
// We don't unconditionally use jemalloc because it can be nice to use the
// system's default allocator by default. Moreover, jemalloc seems to increase
// compilation times by a bit.
//
// Moreover, we only do this on 64-bit systems since jemalloc doesn't support
// i686.
#[cfg(all(target_env = "musl", target_pointer_width = "64"))]
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; |
Update: in #4157 we've switched to |
Yeah, I think we should maybe close this for now -- if the goal is better perf, the bigger impact would be in optimizing stuff inside rust-analyzer itself. |
The
musl
allocator is not one of the fastest ones out there. We should consider enablingjemalloc
if possible.The text was updated successfully, but these errors were encountered: