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

Optimize `BitIter` #65425

Merged
merged 2 commits into from Oct 16, 2019

Conversation

@nnethercote
Copy link
Contributor

nnethercote commented Oct 15, 2019

A minor speed improvement.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Oct 15, 2019

r? @zackmdavis

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

@zackmdavis

This comment has been minimized.

Copy link
Member

zackmdavis commented Oct 15, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 15, 2019

📌 Commit f5bfffd has been approved by zackmdavis

@nnethercote nnethercote force-pushed the nnethercote:optimize-BitIter branch from b780b3c to f5bfffd Oct 15, 2019
@nnethercote

This comment has been minimized.

Copy link
Contributor Author

nnethercote commented Oct 15, 2019

I added another commit, one that benefits from the faster BitIter. But I didn't see the r+ before that happened. I have now removed the additional commit; I will do it in a different PR.

@nnethercote

This comment has been minimized.

Copy link
Contributor Author

nnethercote commented Oct 15, 2019

@bors r=zackmdavis

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 15, 2019

📌 Commit f5bfffd has been approved by zackmdavis

Centril added a commit to Centril/rust that referenced this pull request Oct 15, 2019
…kmdavis

Optimize `BitIter`

A minor speed improvement.
bors added a commit that referenced this pull request Oct 15, 2019
Rollup of 4 pull requests

Successful merges:

 - #64035 (Stabilize proc macros generating `macro_rules` items)
 - #65376 (syntax: misc extractions)
 - #65425 (Optimize `BitIter`)
 - #65428 (Refactor: Rename `db` locals to `diag`)

Failed merges:

r? @ghost
@Centril

This comment has been minimized.

Copy link
Member

Centril commented Oct 15, 2019

Failed in #65430 (comment), @bors r-

nnethercote added 2 commits Oct 14, 2019
This factors out some duplicated code.
This commit removes an `Option` check in `BitIter::next()`, avoids
calling `trailing_zeros()` when it's not necessary, and avoids the need
for `enumerate()`. This gives a tiny (0.2%) instruction count win on a
couple of benchmarks.

The commit also adds some comments, which is good because this iteration
code is moderately complex.
@nnethercote nnethercote force-pushed the nnethercote:optimize-BitIter branch from f5bfffd to 60851b0 Oct 15, 2019
@nnethercote

This comment has been minimized.

Copy link
Contributor Author

nnethercote commented Oct 15, 2019

I mistakenly thought it was ok for unsigned integers to wrap with +. wrapping_add fixes the problem.

@bors r=zackmdavis

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 15, 2019

📌 Commit 60851b0 has been approved by zackmdavis

tmandry added a commit to tmandry/rust that referenced this pull request Oct 15, 2019
…kmdavis

Optimize `BitIter`

A minor speed improvement.
bors added a commit that referenced this pull request Oct 15, 2019
Rollup of 14 pull requests

Successful merges:

 - #64603 (Reducing spurious unused lifetime warnings.)
 - #64623 (Remove last uses of gensyms)
 - #65235 (don't assume we can *always* find a return type hint in async fn)
 - #65242 (Fix suggestion to constrain trait for method to be found)
 - #65265 (Cleanup librustc mir err codes)
 - #65293 (Optimize `try_expand_impl_trait_type`)
 - #65307 (Try fix incorrect "explicit lifetime name needed")
 - #65308 (Add long error explanation for E0574)
 - #65353 (save-analysis: Don't ICE when resolving qualified type paths in struct members)
 - #65389 (Return `false` from `needs_drop` for all zero-sized arrays.)
 - #65402 (Add troubleshooting section to PGO chapter in rustc book.)
 - #65425 (Optimize `BitIter`)
 - #65438 (Organize `never_type`  tests)
 - #65444 (Implement AsRef<[T]> for List<T>)

Failed merges:

 - #65390 (Add long error explanation for E0576)

r? @ghost
@bors bors merged commit 60851b0 into rust-lang:master Oct 16, 2019
4 checks passed
4 checks passed
pr Build #20191015.67 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-6.0) Linux x86_64-gnu-llvm-6.0 succeeded
Details
pr (LinuxTools) LinuxTools succeeded
Details
@nnethercote nnethercote deleted the nnethercote:optimize-BitIter branch Oct 16, 2019
bors added a commit that referenced this pull request Oct 16, 2019
Speed up `LexicalResolve::expansion()`

A couple of improvements that speed up `unicode_normalization` by about 4%. The first commit was enabled by the improvements to `BitSet` iteration in #65425.

r? @nikomatsakis
tmandry added a commit to tmandry/rust that referenced this pull request Oct 18, 2019
…size, r=nikomatsakis

Speed up `LexicalResolve::expansion()`

A couple of improvements that speed up `unicode_normalization` by about 4%. The first commit was enabled by the improvements to `BitSet` iteration in rust-lang#65425.

r? @nikomatsakis
tmandry added a commit to tmandry/rust that referenced this pull request Oct 18, 2019
…size, r=nikomatsakis

Speed up `LexicalResolve::expansion()`

A couple of improvements that speed up `unicode_normalization` by about 4%. The first commit was enabled by the improvements to `BitSet` iteration in rust-lang#65425.

r? @nikomatsakis
tmandry added a commit to tmandry/rust that referenced this pull request Oct 18, 2019
…size, r=nikomatsakis

Speed up `LexicalResolve::expansion()`

A couple of improvements that speed up `unicode_normalization` by about 4%. The first commit was enabled by the improvements to `BitSet` iteration in rust-lang#65425.

r? @nikomatsakis
tmandry added a commit to tmandry/rust that referenced this pull request Oct 18, 2019
…size, r=nikomatsakis

Speed up `LexicalResolve::expansion()`

A couple of improvements that speed up `unicode_normalization` by about 4%. The first commit was enabled by the improvements to `BitSet` iteration in rust-lang#65425.

r? @nikomatsakis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.