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

Reduce code bloat from managed allocations #6237

Merged
merged 1 commit into from
May 4, 2013

Conversation

dotdash
Copy link
Contributor

@dotdash dotdash commented May 4, 2013

In commit d7f5e43 "core::rt: Add the local heap to newsched tasks",
local_malloc and local_free have become rather big and their forced
inlining causes quite a bit of code bloat. Compile times for crates
affected by the bloat (e.g. rustc) improve, while others (e.g. libstd)
seem to be unaffected, so I guess the inlining doesn't gain us much.

Sizes:

               | librustc   | libsytax
---------------|–-----------|------------
with inlining  | 18,547,824 |  7,110,848
w/o inlining   | 15,092,040 |  5,518,608

In commit d7f5e43 "core::rt: Add the local heap to newsched tasks",
local_malloc and local_free have become rather big and their forced
inlining causes quite a bit of code bloat. Compile times for crates
affected by the bloat (e.g. rustc) improve, while others (e.g. libstd)
seem to be unaffected, so I guess the inlining doesn't gain us much.

Sizes:
               | librustc   | libsytax
---------------|–-----------|------------
with inlining  | 18,547,824 |  7,110,848
w/o inlining   | 15,092,040 |  5,518,608
@thestinger
Copy link
Contributor

I think this is worth doing because the overhead of the Rust call isn't very big. There's already a non-inlined wrapper around the C call and then the non-inlineable C call itself. At the very least it should be #[inline] and not #[inline(always)].

@brson: r?

@dotdash
Copy link
Contributor Author

dotdash commented May 4, 2013

There's basically no difference between #[inline(always)] and just #[inline]. Sizes with the latter:

librustc: 18,579,272
libsyntax: 7,110,640

So librustc got even worse.

@brson
Copy link
Contributor

brson commented May 4, 2013

Nice catch. Thanks. 🍍

bors added a commit that referenced this pull request May 4, 2013
In commit d7f5e43 "core::rt: Add the local heap to newsched tasks",
local_malloc and local_free have become rather big and their forced
inlining causes quite a bit of code bloat. Compile times for crates
affected by the bloat (e.g. rustc) improve, while others (e.g. libstd)
seem to be unaffected, so I guess the inlining doesn't gain us much.

Sizes:
```
               | librustc   | libsytax
---------------|–-----------|------------
with inlining  | 18,547,824 |  7,110,848
w/o inlining   | 15,092,040 |  5,518,608
@bors bors closed this May 4, 2013
@bors bors merged commit e5ca35d into rust-lang:incoming May 4, 2013
@dotdash dotdash deleted the reduce_bloat branch May 4, 2013 22:45
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 20, 2020
Fix bad suggestions for `deref_addrof` and `try_err` lints

Fix bad suggestions when in macro expansion for `deref_addrof` and `try_err` lints.

Fixes: rust-lang#6234
Fixes: rust-lang#6242
Fixes: rust-lang#6237

changelog: none

r? `@llogiq`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants