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

Inline some encoding and decoding methods. #69281

Merged

Conversation

nnethercote
Copy link
Contributor

This is a small performance win.

r? @Centril

This is a small performance win.
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 19, 2020
@nnethercote
Copy link
Contributor Author

Local check results:

clap-rs-check
        avg: -0.5%      min: -1.1%      max: 0.0%
ucd-check
        avg: -0.3%      min: -0.7%      max: -0.0%
html5ever-check
        avg: -0.2%      min: -0.3%      max: -0.0%
wg-grammar-check
        avg: -0.1%      min: -0.3%      max: -0.0%
tuple-stress-check
        avg: -0.1%      min: -0.3%      max: -0.0%
script-servo-check
        avg: -0.1%      min: -0.2%      max: 0.0%
keccak-check
        avg: -0.1%      min: -0.2%      max: 0.0%
coercions-check
        avg: -0.0%?     min: -0.2%?     max: 0.1%?
cranelift-codegen-check
        avg: -0.1%      min: -0.2%      max: -0.0%
ctfe-stress-4-check
        avg: 0.1%?      min: -0.0%?     max: 0.2%?
wf-projection-stress-65510-che...
        avg: -0.1%      min: -0.2%      max: -0.0%
await-call-tree-check
        avg: -0.1%      min: -0.2%      max: -0.1%
cargo-check
        avg: -0.1%      min: -0.1%      max: -0.0%
regression-31157-check
        avg: -0.1%      min: -0.1%      max: -0.0%
regex-check
        avg: -0.1%      min: -0.1%      max: -0.0%
piston-image-check
        avg: -0.1%      min: -0.1%      max: -0.0%
inflate-check
        avg: -0.0%      min: -0.1%      max: -0.0%
webrender-check
        avg: -0.1%      min: -0.1%      max: -0.0%
helloworld-check
        avg: -0.1%      min: -0.1%      max: -0.1%
serde-serde_derive-check
        avg: -0.1%      min: -0.1%      max: -0.0%
unify-linearly-check
        avg: -0.1%      min: -0.1%      max: -0.0%
unused-warnings-check
        avg: -0.1%      min: -0.1%      max: -0.0%
syn-check
        avg: -0.1%      min: -0.1%      max: -0.0%
issue-46449-check
        avg: -0.1%      min: -0.1%      max: -0.1%
deeply-nested-check
        avg: -0.1%      min: -0.1%      max: -0.0%
futures-check
        avg: -0.1%      min: -0.1%      max: 0.0%
hyper-2-check
        avg: -0.0%      min: -0.1%      max: -0.0%
style-servo-check
        avg: -0.0%      min: -0.1%      max: 0.0%
trait-stress-check
        avg: -0.0%      min: -0.1%      max: -0.0%
serde-check
        avg: -0.0%      min: -0.1%      max: 0.0%
encoding-check
        avg: -0.1%      min: -0.1%      max: -0.0%
ripgrep-check
        avg: -0.1%      min: -0.1%      max: -0.0%
deep-vector-check
        avg: -0.0%      min: -0.1%      max: -0.0%
webrender-wrench-check
        avg: -0.1%      min: -0.1%      max: -0.0%
tokio-webpush-simple-check
        avg: -0.0%      min: -0.1%      max: -0.0%
unicode_normalization-check
        avg: -0.0%      min: -0.1%      max: 0.1%
packed-simd-check
        avg: -0.0%      min: -0.1%      max: -0.0%
token-stream-stress-check
        avg: -0.0%      min: -0.0%      max: -0.0%

A small but clear win, not bad for such a simple change.

@nnethercote
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@nnethercote
Copy link
Contributor Author

@bors rollup=never, because it affects performance.

@bors
Copy link
Contributor

bors commented Feb 20, 2020

⌛ Trying commit 139c3ca with merge c503f7d1956eee59812f2d542b674e2c7e2777e7...

@Centril
Copy link
Contributor

Centril commented Feb 20, 2020

r=me with perf improved

@bors
Copy link
Contributor

bors commented Feb 20, 2020

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

@rust-timer
Copy link
Collaborator

Queued c503f7d1956eee59812f2d542b674e2c7e2777e7 with parent 7760cd0, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit c503f7d1956eee59812f2d542b674e2c7e2777e7, comparison URL.

@nnethercote
Copy link
Contributor Author

It's a miniscule win, but a win nonetheless.

@bors r=Centril

@bors
Copy link
Contributor

bors commented Feb 21, 2020

📌 Commit 139c3ca has been approved by Centril

@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 Feb 21, 2020
@bors
Copy link
Contributor

bors commented Feb 21, 2020

⌛ Testing commit 139c3ca with merge 2851e59...

@bors
Copy link
Contributor

bors commented Feb 21, 2020

☀️ Test successful - checks-azure
Approved by: Centril
Pushing 2851e59 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 21, 2020
@bors bors merged commit 2851e59 into rust-lang:master Feb 21, 2020
@nnethercote nnethercote deleted the inline-some-encoding-decoding-methods branch February 23, 2020 22:09
@@ -943,6 +943,7 @@ where

macro_rules! encoder_methods {
($($name:ident($ty:ty);)*) => {
#[inline]
$(fn $name(&mut self, value: $ty) -> Result<(), Self::Error> {
Copy link
Contributor

@ecstatic-morse ecstatic-morse Apr 16, 2020

Choose a reason for hiding this comment

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

The #[inline] here is only applied to the first method. Always putting $( on its own line would have avoided this. cc rust-lang/rustfmt#8 cc #71208

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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