Skip to content

Inline some encoding and decoding methods. - #69281

Merged
bors merged 1 commit into
rust-lang:masterfrom
nnethercote:inline-some-encoding-decoding-methods
Feb 21, 2020
Merged

Inline some encoding and decoding methods.#69281
bors merged 1 commit into
rust-lang:masterfrom
nnethercote:inline-some-encoding-decoding-methods

Conversation

@nnethercote

Copy link
Copy Markdown
Contributor

This is a small performance win.

r? @Centril

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

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
ContributorAuthor

@bors try @rust-timer queue

@rust-timer

Copy link
Copy Markdown
Collaborator

Awaiting bors try build completion

@nnethercote

Copy link
Copy Markdown
ContributorAuthor

@bors rollup=never, because it affects performance.

@bors

bors commented Feb 20, 2020

Copy link
Copy Markdown
Collaborator

⌛ Trying commit 139c3ca with merge c503f7d1956eee59812f2d542b674e2c7e2777e7...

@Centril

Copy link
Copy Markdown
Contributor

r=me with perf improved

@bors

bors commented Feb 20, 2020

Copy link
Copy Markdown
Collaborator

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

@rust-timer

Copy link
Copy Markdown
Collaborator

Queued c503f7d1956eee59812f2d542b674e2c7e2777e7 with parent 7760cd0, future comparison URL.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking try commit c503f7d1956eee59812f2d542b674e2c7e2777e7, comparison URL.

@nnethercote

Copy link
Copy Markdown
ContributorAuthor

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

@bors r=Centril

@bors

bors commented Feb 21, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 139c3ca has been approved by Centril

@borsbors 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

bors commented Feb 21, 2020

Copy link
Copy Markdown
Collaborator

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

@bors

bors commented Feb 21, 2020

Copy link
Copy Markdown
Collaborator

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

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Feb 21, 2020
@bors
bors merged commit 2851e59 into rust-lang:masterFeb 21, 2020
@nnethercote
nnethercote deleted the inline-some-encoding-decoding-methods branch February 23, 2020 22:09
macro_rules! encoder_methods {
($($name:ident($ty:ty);)*) => {
#[inline]
$(fn $name(&mut self, value: $ty) -> Result<(), Self::Error> {

@ecstatic-morseecstatic-morseApr 16, 2020

Copy link
Copy Markdown
Contributor

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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: 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

@nnethercote@rust-timer@bors@Centril@ecstatic-morse@rust-highfive