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

Use SmallVec in TokenStreamBuilder. #59476

Merged
merged 1 commit into from
Mar 29, 2019

Conversation

nnethercote
Copy link
Contributor

This reduces by 12% the number of allocations done for a "clean incremental" of webrender_api, which reduces the instruction count by about 0.5%.

r? @petrochenkov

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 28, 2019
@petrochenkov
Copy link
Contributor

@bors try

@bors
Copy link
Contributor

bors commented Mar 28, 2019

⌛ Trying commit 08df22a905333c0384b36ef4bdcdec842324677f with merge 58625519613b737ca78737fa9055ab1160d45ba8...

@petrochenkov petrochenkov added S-waiting-on-perf Status: Waiting on a perf run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 28, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:052f5e9a:start=1553750927572300497,finish=1553751065547230830,duration=137974930333
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
Setting environment variables from .travis.yml
---
travis_time:start:test_assembly
Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:23:08] 
[01:23:08] running 9 tests
[01:23:08] iiiiiiiii
[01:23:08] 
[01:23:08]  finished in 0.168
[01:23:08] travis_fold:end:test_assembly

---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:23:25] 
[01:23:25] running 120 tests
[01:23:55] .iiiii...i.....i..i...i..i.i...i.ii...i.....i..i....i..........iiii..........i...ii...i.......ii.i.i 100/120
[01:24:00] .i......iii.i.....ii
[01:24:00] 
[01:24:00]  finished in 34.859
[01:24:00] travis_fold:end:test_debuginfo

---
travis_time:start:test_stage1-syntax
Testing syntax stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:48:55]    Compiling syntax v0.0.0 (/checkout/src/libsyntax)
[01:49:06] error[E0308]: mismatched types
[01:49:06]    --> <::alloc::macros::vec macros>:3:1
[01:49:06]     |
[01:49:06] 1   | / ( $ elem : expr ; $ n : expr ) => (
[01:49:06] 2   | | $ crate :: vec :: from_elem ( $ elem , $ n ) ) ; ( $ ( $ x : expr ) , * ) => (
[01:49:06] 3   | | < [ _ ] > :: into_vec ( box [ $ ( $ x ) , * ] ) ) ; ( $ ( $ x : expr , ) * )
[01:49:06]     | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[01:49:06]     | | expected struct `smallvec::SmallVec`, found struct `std::vec::Vec`
[01:49:06]     | | expected struct `smallvec::SmallVec`, found struct `std::vec::Vec`
[01:49:06] 4   | | => ( vec ! [ $ ( $ x ) , * ] )
[01:49:06]     | 
[01:49:06]    ::: src/libsyntax/tokenstream.rs:577:52
[01:49:06]     |
[01:49:06]     |
[01:49:06] 577 |               let eq_res = TokenStream::from_streams(vec![test_fst, test_snd]);
[01:49:06]     |
[01:49:06]     |
[01:49:06]     = note: expected type `smallvec::SmallVec<[tokenstream::TokenStream; 2]>`
[01:49:06]                found type `std::vec::Vec<tokenstream::TokenStream>`
[01:49:07] error: aborting due to previous error
[01:49:07] 
[01:49:07] For more information about this error, try `rustc --explain E0308`.
[01:49:07] error: Could not compile `syntax`.
[01:49:07] error: Could not compile `syntax`.
[01:49:07] 
[01:49:07] To learn more, run the command again with --verbose.
[01:49:07] 
[01:49:07] 
[01:49:07] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "-p" "syntax" "--" "--quiet"
[01:49:07] 
[01:49:07] 
[01:49:07] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:49:07] Build completed unsuccessfully in 0:38:41
[01:49:07] Build completed unsuccessfully in 0:38:41
[01:49:07] make: *** [check] Error 1
[01:49:07] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:327d7648
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Thu Mar 28 07:20:23 UTC 2019

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors
Copy link
Contributor

bors commented Mar 28, 2019

☀️ Try build successful - checks-travis
Build commit: 58625519613b737ca78737fa9055ab1160d45ba8

@nnethercote
Copy link
Contributor Author

@rust-timer build 58625519613b737ca78737fa9055ab1160d45ba8

@rust-timer
Copy link
Collaborator

Success: Queued 58625519613b737ca78737fa9055ab1160d45ba8 with parent d20e000, comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit 58625519613b737ca78737fa9055ab1160d45ba8

@petrochenkov
Copy link
Contributor

r=me with libsyntax tests fixed

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Mar 28, 2019
This reduces by 12% the number of allocations done for a "clean
incremental" of `webrender_api`, which reduces the instruction count by
about 0.5%.

It also reduces instruction counts by up to 1.4% across a range of
rustc-perf benchmark runs.
@nnethercote nnethercote force-pushed the TokenStreamBuilder-SmallVec branch from 08df22a to 17a8aff Compare March 28, 2019 22:34
@nnethercote
Copy link
Contributor Author

I fixed the libsyntax test.

@bors r=petrochenkov

@bors
Copy link
Contributor

bors commented Mar 28, 2019

📌 Commit 17a8aff has been approved by petrochenkov

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 28, 2019
Centril added a commit to Centril/rust that referenced this pull request Mar 29, 2019
…lVec, r=petrochenkov

Use `SmallVec` in `TokenStreamBuilder`.

This reduces by 12% the number of allocations done for a "clean incremental" of `webrender_api`, which reduces the instruction count by about 0.5%.

r? @petrochenkov
bors added a commit that referenced this pull request Mar 29, 2019
Rollup of 11 pull requests

Successful merges:

 - #58019 (Combine all builtin late lints and make lint checking parallel)
 - #59358 (Use `track_errors` instead of hand rolling)
 - #59394 (warn -> deny duplicate match bindings)
 - #59401 (bootstrap: build crates under libtest with -Z emit-stack-sizes)
 - #59423 (Visit path in `walk_mac`)
 - #59468 (musl: build toolchain libs with -fPIC)
 - #59476 (Use `SmallVec` in `TokenStreamBuilder`.)
 - #59496 (Remove unnecessary with_globals calls)
 - #59498 (Use 'write_all' instead of 'write' in example code)
 - #59503 (Stablize {f32,f64}::copysign().)
 - #59511 (Fix missed fn rename in #59284)

Failed merges:

r? @ghost
bors added a commit that referenced this pull request Mar 29, 2019
Rollup of 11 pull requests

Successful merges:

 - #58019 (Combine all builtin late lints and make lint checking parallel)
 - #59358 (Use `track_errors` instead of hand rolling)
 - #59394 (warn -> deny duplicate match bindings)
 - #59401 (bootstrap: build crates under libtest with -Z emit-stack-sizes)
 - #59423 (Visit path in `walk_mac`)
 - #59468 (musl: build toolchain libs with -fPIC)
 - #59476 (Use `SmallVec` in `TokenStreamBuilder`.)
 - #59496 (Remove unnecessary with_globals calls)
 - #59498 (Use 'write_all' instead of 'write' in example code)
 - #59503 (Stablize {f32,f64}::copysign().)
 - #59511 (Fix missed fn rename in #59284)

Failed merges:

r? @ghost
@bors bors merged commit 17a8aff into rust-lang:master Mar 29, 2019
@nnethercote nnethercote deleted the TokenStreamBuilder-SmallVec branch July 17, 2019 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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.

5 participants