about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@mozilla.com>2016-09-20 09:52:38 +1000
committerNicholas Nethercote <nnethercote@mozilla.com>2016-09-20 22:00:29 +1000
commit80a44779f7a211e075da9ed0ff2763afa00f43dc (patch)
tree5d49078593ddf77bc18b28c1f29f76441ae83770 /src/rustllvm/RustWrapper.cpp
parent55bf6a4f870cda7afddea7c6ca2b3ee9aac23ca2 (diff)
downloadrust-80a44779f7a211e075da9ed0ff2763afa00f43dc.tar.gz
rust-80a44779f7a211e075da9ed0ff2763afa00f43dc.zip
Lazily allocate TypedArena's first chunk.
Currently `TypedArena` allocates its first chunk, which is usually 4096
bytes, as soon as it is created. If no allocations are ever made from
the arena then this allocation (and the corresponding deallocation) is
wasted effort.

This commit changes `TypedArena` so it doesn't allocate the first chunk
until the first allocation is made.

This change speeds up rustc by a non-trivial amount because rustc uses
`TypedArena` heavily: compilation speed (producing debug builds) on
several of the rustc-benchmarks increases by 1.02--1.06x. The change
should never cause a slow-down because the hot `alloc` function is
unchanged. It does increase the size of `TypedArena` by one `usize`
field, however.

The commit also fixes some out-of-date comments.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions