Skip to content

Remove sip::Hasher::short_write. #69471

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Mar 15, 2020

Conversation

nnethercote
Copy link
Contributor

sip::Hasher::short_write is currently unused. It is called by
sip::Hasher::write_{u8,usize}, but those methods are also unused,
because DefaultHasher, SipHasher and SipHasher13 don't implement
any of the write_xyz methods, so all their write operations end up
calling sip::Hasher::write.

(I confirmed this by inserting a panic! in sip::Hasher::short_write
and running the tests -- they all passed.)

The alternative would be to add all the missing write_xyz methods.
This does give some significant speed-ups, but it hurts compile times a
little in some cases. See #69152 for details. This commit does the
conservative thing and doesn't change existing behaviour.

r? @rust-lang/libs

`sip::Hasher::short_write` is currently unused. It is called by
`sip::Hasher::write_{u8,usize}`, but those methods are also unused,
because `DefaultHasher`, `SipHasher` and `SipHasher13` don't implement
any of the `write_xyz` methods, so all their write operations end up
calling `sip::Hasher::write`.

(I confirmed this by inserting a `panic!` in `sip::Hasher::short_write`
and running the tests -- they all passed.)

The alternative would be to add all the missing `write_xyz` methods.
This does give some significant speed-ups, but it hurts compile times a
little in some cases. See rust-lang#69152 for details. This commit does the
conservative thing and doesn't change existing behaviour.
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 26, 2020
@nnethercote
Copy link
Contributor Author

This should have zero perf impact because it just removes dead code. But I was surprised by the perf impact of #69152 so I will check.

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Collaborator

bors commented Feb 26, 2020

⌛ Trying commit 54d1c50 with merge ba8f508...

bors added a commit that referenced this pull request Feb 26, 2020
Remove `sip::Hasher::short_write`.

`sip::Hasher::short_write` is currently unused. It is called by
`sip::Hasher::write_{u8,usize}`, but those methods are also unused,
because `DefaultHasher`, `SipHasher` and `SipHasher13` don't implement
any of the `write_xyz` methods, so all their write operations end up
calling `sip::Hasher::write`.

(I confirmed this by inserting a `panic!` in `sip::Hasher::short_write`
and running the tests -- they all passed.)

The alternative would be to add all the missing `write_xyz` methods.
This does give some significant speed-ups, but it hurts compile times a
little in some cases. See #69152 for details. This commit does the
conservative thing and doesn't change existing behaviour.

r? @rust-lang/libs
@bors
Copy link
Collaborator

bors commented Feb 26, 2020

☀️ Try build successful - checks-azure
Build commit: ba8f508 (ba8f5083f4f623d237142b020a95ef6bb82e6280)

@rust-timer
Copy link
Collaborator

Queued ba8f508 with parent 6fd8798, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit ba8f508, comparison URL.

@nnethercote
Copy link
Contributor Author

The performance effect is right on the edge of "noise" and "miniscule improvement", more or less as expected.

@Mark-Simulacrum
Copy link
Member

Let's try r? @dtolnay perhaps?

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding #69152 (comment), I agree that this is the right tradeoff. Thanks!

@dtolnay
Copy link
Member

dtolnay commented Mar 12, 2020

@bors r+

@bors
Copy link
Collaborator

bors commented Mar 12, 2020

📌 Commit 54d1c50 has been approved by dtolnay

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 12, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 14, 2020
…te, r=dtolnay

Remove `sip::Hasher::short_write`.

`sip::Hasher::short_write` is currently unused. It is called by
`sip::Hasher::write_{u8,usize}`, but those methods are also unused,
because `DefaultHasher`, `SipHasher` and `SipHasher13` don't implement
any of the `write_xyz` methods, so all their write operations end up
calling `sip::Hasher::write`.

(I confirmed this by inserting a `panic!` in `sip::Hasher::short_write`
and running the tests -- they all passed.)

The alternative would be to add all the missing `write_xyz` methods.
This does give some significant speed-ups, but it hurts compile times a
little in some cases. See rust-lang#69152 for details. This commit does the
conservative thing and doesn't change existing behaviour.

r? @rust-lang/libs
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 14, 2020
…te, r=dtolnay

Remove `sip::Hasher::short_write`.

`sip::Hasher::short_write` is currently unused. It is called by
`sip::Hasher::write_{u8,usize}`, but those methods are also unused,
because `DefaultHasher`, `SipHasher` and `SipHasher13` don't implement
any of the `write_xyz` methods, so all their write operations end up
calling `sip::Hasher::write`.

(I confirmed this by inserting a `panic!` in `sip::Hasher::short_write`
and running the tests -- they all passed.)

The alternative would be to add all the missing `write_xyz` methods.
This does give some significant speed-ups, but it hurts compile times a
little in some cases. See rust-lang#69152 for details. This commit does the
conservative thing and doesn't change existing behaviour.

r? @rust-lang/libs
bors added a commit that referenced this pull request Mar 15, 2020
Rollup of 7 pull requests

Successful merges:

 - #69357 (Emit 1-based column numbers in debuginfo)
 - #69471 (Remove `sip::Hasher::short_write`.)
 - #69498 (Change "method" to "associated function")
 - #69967 (Remove a few `Rc`s from RegionInferenceCtxt)
 - #69987 (Add self to .mailmap)
 - #69991 (fix E0117 message out of sync)
 - #69993 (Add long error explanation for E0693)

Failed merges:

r? @ghost
bors added a commit that referenced this pull request Mar 15, 2020
Rollup of 7 pull requests

Successful merges:

 - #69357 (Emit 1-based column numbers in debuginfo)
 - #69471 (Remove `sip::Hasher::short_write`.)
 - #69498 (Change "method" to "associated function")
 - #69967 (Remove a few `Rc`s from RegionInferenceCtxt)
 - #69987 (Add self to .mailmap)
 - #69991 (fix E0117 message out of sync)
 - #69993 (Add long error explanation for E0693)

Failed merges:

r? @ghost
@bors bors merged commit 0619e46 into rust-lang:master Mar 15, 2020
@nnethercote nnethercote deleted the rm-sip-Hasher-short_write branch March 15, 2020 22:14
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants