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 dump_{alloc,allocs,local}() no-ops when tracing is disabled. #50246

Merged
merged 1 commit into from Apr 27, 2018

Conversation

Projects
None yet
6 participants
@nnethercote
Contributor

nnethercote commented Apr 26, 2018

Because they traverse data structures and build up strings, which is
wasted effort if those strings aren't printed.

The patch also removes some now-unnecessary log_enabled! tests at call
sites.

This is a big win for the Debug and Opt runs of coercions, tuple-stress, html5ever, and encoding.

coercions-opt
        avg: -7.8%      min: -14.8%     max: 0.1%
coercions
        avg: -8.0%      min: -12.8%     max: 0.1%
tuple-stress
        avg: -7.2%      min: -10.8%     max: -0.7%
tuple-stress-opt
        avg: -6.9%      min: -10.7%     max: 0.6%
html5ever
        avg: -4.6%      min: -7.3%      max: -0.3%
encoding
        avg: -2.4%      min: -4.5%      max: 0.1%
html5ever-opt
        avg: -2.7%      min: -4.2%      max: -0.2%
encoding-opt
        avg: -1.4%      min: -2.4%      max: 0.0%
Make dump_{alloc,allocs,local}() no-ops when tracing is disabled.
Because they traverse data structures and build up strings, which is
wasted effort if those strings aren't printed.

The patch also removes some now-unnecessary log_enabled! tests at call
sites.
@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Apr 26, 2018

r? @cramertj

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

@Mark-Simulacrum

This comment has been minimized.

Member

Mark-Simulacrum commented Apr 26, 2018

@bors r+

@bors

This comment has been minimized.

Contributor

bors commented Apr 26, 2018

📌 Commit 2e4f66a has been approved by Mark-Simulacrum

kennytm added a commit to kennytm/rust that referenced this pull request Apr 27, 2018

Rollup merge of rust-lang#50246 - nnethercote:no-dump_allocs, r=Mark-…
…Simulacrum

Make dump_{alloc,allocs,local}() no-ops when tracing is disabled.

Because they traverse data structures and build up strings, which is
wasted effort if those strings aren't printed.

The patch also removes some now-unnecessary log_enabled! tests at call
sites.

This is a big win for the Debug and Opt runs of coercions, tuple-stress, html5ever, and encoding.
```
coercions-opt
        avg: -7.8%      min: -14.8%     max: 0.1%
coercions
        avg: -8.0%      min: -12.8%     max: 0.1%
tuple-stress
        avg: -7.2%      min: -10.8%     max: -0.7%
tuple-stress-opt
        avg: -6.9%      min: -10.7%     max: 0.6%
html5ever
        avg: -4.6%      min: -7.3%      max: -0.3%
encoding
        avg: -2.4%      min: -4.5%      max: 0.1%
html5ever-opt
        avg: -2.7%      min: -4.2%      max: -0.2%
encoding-opt
        avg: -1.4%      min: -2.4%      max: 0.0%
```

bors added a commit that referenced this pull request Apr 27, 2018

Auto merge of #50275 - kennytm:rollup, r=kennytm
Rollup of 8 pull requests

Successful merges:

 - #49707 (Add "the Rustc book")
 - #49891 (compiletest: detect non-ICE compiler panics)
 - #50222 (Bump bootstrap compiler to 2018-04-24)
 - #50227 (Fix ICE with erroneous `impl Trait` in a trait impl)
 - #50229 (Add setting to go to item if there is only one result)
 - #50231 (Add more doc aliases)
 - #50246 (Make dump_{alloc,allocs,local}() no-ops when tracing is disabled.)
 - #50252 (Add #[inline] back on __getit (fixes #25088))

Failed merges:

kennytm added a commit to kennytm/rust that referenced this pull request Apr 27, 2018

Rollup merge of rust-lang#50246 - nnethercote:no-dump_allocs, r=Mark-…
…Simulacrum

Make dump_{alloc,allocs,local}() no-ops when tracing is disabled.

Because they traverse data structures and build up strings, which is
wasted effort if those strings aren't printed.

The patch also removes some now-unnecessary log_enabled! tests at call
sites.

This is a big win for the Debug and Opt runs of coercions, tuple-stress, html5ever, and encoding.
```
coercions-opt
        avg: -7.8%      min: -14.8%     max: 0.1%
coercions
        avg: -8.0%      min: -12.8%     max: 0.1%
tuple-stress
        avg: -7.2%      min: -10.8%     max: -0.7%
tuple-stress-opt
        avg: -6.9%      min: -10.7%     max: 0.6%
html5ever
        avg: -4.6%      min: -7.3%      max: -0.3%
encoding
        avg: -2.4%      min: -4.5%      max: 0.1%
html5ever-opt
        avg: -2.7%      min: -4.2%      max: -0.2%
encoding-opt
        avg: -1.4%      min: -2.4%      max: 0.0%
```

bors added a commit that referenced this pull request Apr 27, 2018

Auto merge of #50275 - kennytm:rollup, r=kennytm
Rollup of 7 pull requests

Successful merges:

 - #49707 (Add "the Rustc book")
 - #50222 (Bump bootstrap compiler to 2018-04-24)
 - #50227 (Fix ICE with erroneous `impl Trait` in a trait impl)
 - #50229 (Add setting to go to item if there is only one result)
 - #50231 (Add more doc aliases)
 - #50246 (Make dump_{alloc,allocs,local}() no-ops when tracing is disabled.)
 - #49894 (Rename InternedString to LocalInternedString and introduce a new thread-safe InternedString)

Failed merges:
@eddyb

This comment has been minimized.

Member

eddyb commented Apr 27, 2018

@bors bors merged commit 2e4f66a into rust-lang:master Apr 27, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@nnethercote nnethercote deleted the nnethercote:no-dump_allocs branch Apr 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment