Skip to content

Inline hash_table::calculate_offsets, used by iterators. #25921

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

Merged
merged 1 commit into from
May 31, 2015

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented May 31, 2015

The HashMap and HashSet iterators use RawTable::first_bucket_raw which is generic and will get inlined cross-crate.
However, first_bucket_raw calls calculate_offsets and the call doesn't get inlined, despite being a simple function.
This missing #[inline] results in hash_table::calculate_offsets showing up at the top of a callgrind profile with 3 million calls (for the testcase in #25916).

The `HashMap` and `HashSet` iterators use `RawTable::first_bucket_raw` which is generic and will get inlined cross-crate.
However, `first_bucket_raw` calls `calculate_offsets` and the call doesn't get inlined, despite being a simple function.
This missing `#[inline]` results in `hash_table::calculate_offsets` showing up at the top of a callgrind profile with 3 million calls (for the testcase in rust-lang#25916).
@rust-highfive
Copy link
Contributor

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

@Aatch Aatch assigned Aatch and unassigned brson May 31, 2015
@Aatch
Copy link
Contributor

Aatch commented May 31, 2015

@bors r+ 4a4315b rollup

@bors
Copy link
Collaborator

bors commented May 31, 2015

⌛ Testing commit 4a4315b with merge 243e85f...

bors added a commit that referenced this pull request May 31, 2015
The `HashMap` and `HashSet` iterators use `RawTable::first_bucket_raw` which is generic and will get inlined cross-crate.
However, `first_bucket_raw` calls `calculate_offsets` and the call doesn't get inlined, despite being a simple function.
This missing `#[inline]` results in `hash_table::calculate_offsets` showing up at the top of a callgrind profile with 3 million calls (for the testcase in #25916).
@bors bors merged commit 4a4315b into rust-lang:master May 31, 2015
@eddyb eddyb deleted the inline-calculate-offsets branch May 31, 2015 14:57
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.

5 participants