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 `LexicalResolve::expansion`. #65260

Merged
merged 3 commits into from Oct 15, 2019

Conversation

@nnethercote
Copy link
Contributor

nnethercote commented Oct 10, 2019

A win for unicode_normalization.

r? @nikomatsakis

nnethercote added 3 commits Oct 9, 2019
Some places use the local `tcx` variable, some use `self.tcx()`. This
commit removes the local variable so that all places use `self.tcx()`,
for consistency.
This wins 6% on `unicode_normalization`, by avoiding a call to
`lub_concrete_regions()` and a `Region` equality test.
The function only has one call site, so we don't need a tag argument.
@nnethercote

This comment has been minimized.

Copy link
Contributor Author

nnethercote commented Oct 10, 2019

I tried a whole lot of different things to speed this up, but commit 2 was the only thing that helped. Commits 1 and 3 are just minor clean-ups.

@nnethercote

This comment has been minimized.

Copy link
Contributor Author

nnethercote commented Oct 10, 2019

@bors try @rust-timer queue

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 10, 2019

⌛️ Trying commit 8cd25e7 with merge bb3defd...

bors added a commit that referenced this pull request Oct 10, 2019
… r=<try>

Optimize `LexicalResolve::expansion`.

A win for `unicode_normalization`.

r? @nikomatsakis
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 10, 2019

☀️ Try build successful - checks-azure
Build commit: bb3defd (bb3defd56b91fd479b0d8deffea23a68f3936982)

Copy link
Contributor

nikomatsakis left a comment

This seems ok but I will probably have to undo it shortly, if I land #65232. Well, perhaps adapt it is more correct -- there's probably a shortened test that would be equally efficient.

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Oct 10, 2019

r=me once perf measurements are in

@nnethercote

This comment has been minimized.

Copy link
Contributor Author

nnethercote commented Oct 10, 2019

The rust-timer queue command seems to have failed. Let's try it the old-fashioned way:

@rust-timer build bb3defd

@rust-timer

This comment has been minimized.

Copy link

rust-timer commented Oct 10, 2019

Queued bb3defd with parent aa45e03, future comparison URL.

@rust-timer

This comment has been minimized.

Copy link

rust-timer commented Oct 11, 2019

Finished benchmarking try commit bb3defd, comparison URL.

@nnethercote

This comment has been minimized.

Copy link
Contributor Author

nnethercote commented Oct 11, 2019

Up to 7% wins on unicode_normalization, and negligible effects on other benchmarks.

@bors r=nikomatsakis

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 11, 2019

📌 Commit 8cd25e7 has been approved by nikomatsakis

Centril added a commit to Centril/rust that referenced this pull request Oct 14, 2019
…-expansion, r=nikomatsakis

Optimize `LexicalResolve::expansion`.

A win for `unicode_normalization`.

r? @nikomatsakis
bors added a commit that referenced this pull request Oct 14, 2019
Rollup of 4 pull requests

Successful merges:

 - #64987 (Compute the layout of uninhabited structs)
 - #65252 (expand: Simplify expansion of derives)
 - #65260 (Optimize `LexicalResolve::expansion`.)
 - #65261 (Remove `Option` from `TokenStream`)

Failed merges:

r? @ghost
tmandry added a commit to tmandry/rust that referenced this pull request Oct 15, 2019
…-expansion, r=nikomatsakis

Optimize `LexicalResolve::expansion`.

A win for `unicode_normalization`.

r? @nikomatsakis
bors added a commit that referenced this pull request Oct 15, 2019
Rollup of 10 pull requests

Successful merges:

 - #65170 (rustc_metadata: Privatize private code and remove dead code)
 - #65260 (Optimize `LexicalResolve::expansion`.)
 - #65261 (Remove `Option` from `TokenStream`)
 - #65332 (std::fmt: reorder docs)
 - #65340 (Several changes to the codegen backend organization)
 - #65365 (Include const generic arguments in metadata)
 - #65398 (Bring attention to suggestions when the only difference is capitalization)
 - #65410 (syntax: add parser recovery for intersection- / and-patterns `p1 @ p2`)
 - #65415 (Remove an outdated test output file)
 - #65416 (Minor sync changes)

Failed merges:

r? @ghost
@bors bors merged commit 8cd25e7 into rust-lang:master Oct 15, 2019
5 checks passed
5 checks passed
homu Test successful
Details
pr Build #20191010.11 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-LexicalResolve-expansion branch Oct 15, 2019
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.