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

Make `intern_lazy_const` actually intern its argument. #58207

Merged
merged 1 commit into from Feb 9, 2019

Conversation

Projects
None yet
@nnethercote
Copy link
Contributor

nnethercote commented Feb 6, 2019

Currently it just unconditionally allocates it in the arena.

For a "Clean Check" build of the the packed-simd benchmark, this
change reduces both the max-rss and faults counts by 59%; it
slightly (~3%) increases the instruction counts but the wall-time is
unchanged.

For the same builds of a few other benchmarks, max-rss and faults
drop by 1--5%, but instruction counts and wall-time changes are in the
noise.

Fixes #57432, fixes #57829.

Make `intern_lazy_const` actually intern its argument.
Currently it just unconditionally allocates it in the arena.

For a "Clean Check" build of the the `packed-simd` benchmark, this
change reduces both the `max-rss` and `faults` counts by 59%; it
slightly (~3%) increases the instruction counts but the `wall-time` is
unchanged.

For the same builds of a few other benchmarks, `max-rss` and `faults`
drop by 1--5%, but instruction counts and `wall-time` changes are in the
noise.

Fixes #57432, fixes #57829.
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Feb 6, 2019

r? @petrochenkov

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

@nnethercote

This comment has been minimized.

Copy link
Contributor Author

nnethercote commented Feb 6, 2019

I'm no expert on interning but this appears to do the trick.

r? @oli-obk

cc @RalfJung

@rust-highfive rust-highfive assigned oli-obk and unassigned petrochenkov Feb 6, 2019

@nnethercote

This comment has been minimized.

Copy link
Contributor Author

nnethercote commented Feb 6, 2019

@bors try

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 6, 2019

⌛️ Trying commit f2871a9 with merge 75a5b71...

bors added a commit that referenced this pull request Feb 6, 2019

Auto merge of #58207 - nnethercote:intern_lazy_const, r=<try>
Make `intern_lazy_const` actually intern its argument.

Currently it just unconditionally allocates it in the arena.

For a "Clean Check" build of the the `packed-simd` benchmark, this
change reduces both the `max-rss` and `faults` counts by 59%; it
slightly (~3%) increases the instruction counts but the `wall-time` is
unchanged.

For the same builds of a few other benchmarks, `max-rss` and `faults`
drop by 1--5%, but instruction counts and `wall-time` changes are in the
noise.

Fixes #57432, fixes #57829.
@Zoxc

This comment has been minimized.

Copy link
Contributor

Zoxc commented Feb 6, 2019

I find it amusing that this removes intern from the name, but actually adds interning.

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 6, 2019

☀️ Test successful - checks-travis
State: approved= try=True

@nnethercote

This comment has been minimized.

Copy link
Contributor Author

nnethercote commented Feb 6, 2019

@rust-timer

This comment has been minimized.

Copy link

rust-timer commented Feb 6, 2019

Success: Queued 75a5b71 with parent 65e647c, comparison URL.

@rust-timer

This comment has been minimized.

Copy link

rust-timer commented Feb 6, 2019

Finished benchmarking try commit 75a5b71

@nnethercote

This comment has been minimized.

Copy link
Contributor Author

nnethercote commented Feb 6, 2019

Perf results are very similar to what I saw locally: big max-rss and faults wins, minor instruction count increases, but no obvious corresponding wall-time increases.

@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented Feb 6, 2019

@bors r+

awesome!

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 6, 2019

📌 Commit f2871a9 has been approved by oli-obk

@RalfJung

This comment has been minimized.

Copy link
Member

RalfJung commented Feb 9, 2019

Given the impact of the regression this fixes, is it appropriate to give it higher priority?

@Mark-Simulacrum

This comment has been minimized.

Copy link
Member

Mark-Simulacrum commented Feb 9, 2019

@bors p=1

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 9, 2019

⌛️ Testing commit f2871a9 with merge d329d46...

bors added a commit that referenced this pull request Feb 9, 2019

Auto merge of #58207 - nnethercote:intern_lazy_const, r=oli-obk
Make `intern_lazy_const` actually intern its argument.

Currently it just unconditionally allocates it in the arena.

For a "Clean Check" build of the the `packed-simd` benchmark, this
change reduces both the `max-rss` and `faults` counts by 59%; it
slightly (~3%) increases the instruction counts but the `wall-time` is
unchanged.

For the same builds of a few other benchmarks, `max-rss` and `faults`
drop by 1--5%, but instruction counts and `wall-time` changes are in the
noise.

Fixes #57432, fixes #57829.
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 9, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: oli-obk
Pushing d329d46 to master...

@bors bors added the merged-by-bors label Feb 9, 2019

@bors bors merged commit f2871a9 into rust-lang:master Feb 9, 2019

1 check passed

homu Test successful
Details

@nnethercote nnethercote deleted the nnethercote:intern_lazy_const branch Feb 11, 2019

@nnethercote

This comment has been minimized.

Copy link
Contributor Author

nnethercote commented Feb 11, 2019

Perf results from landing are as expected.

@RalfJung

This comment has been minimized.

Copy link
Member

RalfJung commented Feb 11, 2019

Strange, why did max-rss increase by 15% for some benchmarks?

@Zoxc

This comment has been minimized.

Copy link
Contributor

Zoxc commented Feb 11, 2019

@RalfJung You have to store a map to each constant value, which is wasteful if you only have distinct constant values. Maybe that's why? The max-rss benchmarks are also noisy =P

@nnethercote

This comment has been minimized.

Copy link
Contributor Author

nnethercote commented Feb 11, 2019

And inflate and keccak are particularly noisy. Earlier runs didn't show a regression for them.

@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented Feb 11, 2019

nominating for beta backport as per #57829 (comment)

We can also create a less invasive backport by just doing the changes in https://github.com/rust-lang/rust/pull/58207/files#diff-c8a6d543f758cb294320bcac3b5268ae without renaming the method

@pnkfelix

This comment has been minimized.

Copy link
Member

pnkfelix commented Feb 14, 2019

triage, beta-accepted.

bors added a commit that referenced this pull request Feb 17, 2019

Auto merge of #58537 - pietroalbini:beta-backports, r=pietroalbini
[beta] Rollup backports

Cherry-picked:

* #58207: Make `intern_lazy_const` actually intern its argument.
* #58161: Lower constant patterns with ascribed types.
* #57908: resolve: Fix span arithmetics in the import conflict error
* #57835: typeck: remove leaky nested probe during trait object method resolution
* #57885: Avoid committing to autoderef in object method probing
* #57646: Fixes text becoming invisible when element targetted

Rolled up:

* #58522: [BETA] Update cargo

r? @ghost

bors added a commit that referenced this pull request Feb 19, 2019

Auto merge of #58537 - pietroalbini:beta-backports, r=pietroalbini
[beta] Rollup backports

Cherry-picked:

* #58207: Make `intern_lazy_const` actually intern its argument.
* #58161: Lower constant patterns with ascribed types.
* #57908: resolve: Fix span arithmetics in the import conflict error
* #57835: typeck: remove leaky nested probe during trait object method resolution
* #57885: Avoid committing to autoderef in object method probing
* #57646: Fixes text becoming invisible when element targetted

Rolled up:

* #58522: [BETA] Update cargo

r? @ghost

bors added a commit that referenced this pull request Feb 19, 2019

Auto merge of #58537 - pietroalbini:beta-backports, r=pietroalbini
[beta] Rollup backports

Cherry-picked:

* #58207: Make `intern_lazy_const` actually intern its argument.
* #58161: Lower constant patterns with ascribed types.
* #57908: resolve: Fix span arithmetics in the import conflict error
* #57835: typeck: remove leaky nested probe during trait object method resolution
* #57885: Avoid committing to autoderef in object method probing
* #57646: Fixes text becoming invisible when element targetted

Rolled up:

* #58522: [BETA] Update cargo

r? @ghost

bors added a commit that referenced this pull request Feb 20, 2019

Auto merge of #58537 - pietroalbini:beta-backports, r=pietroalbini
[beta] Rollup backports

Cherry-picked:

* #58207: Make `intern_lazy_const` actually intern its argument.
* #58161: Lower constant patterns with ascribed types.
* #57908: resolve: Fix span arithmetics in the import conflict error
* #57835: typeck: remove leaky nested probe during trait object method resolution
* #57885: Avoid committing to autoderef in object method probing
* #57646: Fixes text becoming invisible when element targetted

Rolled up:

* #58522: [BETA] Update cargo

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