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

Projects
None yet
5 participants
@nnethercote
Copy link
Contributor

nnethercote commented 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%.

r? @petrochenkov

@petrochenkov

This comment has been minimized.

Copy link
Contributor

petrochenkov commented Mar 28, 2019

@bors try

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 28, 2019

⌛️ Trying commit 08df22a with merge 5862551...

bors added a commit that referenced this pull request Mar 28, 2019

Auto merge of #59476 - nnethercote:TokenStreamBuilder-SmallVec, r=<try>
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
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Mar 28, 2019

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

This comment has been minimized.

Copy link
Contributor

bors commented Mar 28, 2019

☀️ Try build successful - checks-travis
Build commit: 5862551

@nnethercote

This comment has been minimized.

Copy link
Contributor Author

nnethercote commented Mar 28, 2019

@rust-timer

This comment has been minimized.

Copy link

rust-timer commented Mar 28, 2019

Success: Queued 5862551 with parent d20e000, comparison URL.

@rust-timer

This comment has been minimized.

Copy link

rust-timer commented Mar 28, 2019

Finished benchmarking try commit 5862551

@petrochenkov

This comment has been minimized.

Copy link
Contributor

petrochenkov commented Mar 28, 2019

r=me with libsyntax tests fixed

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%.

It also reduces instruction counts by up to 1.4% across a range of
rustc-perf benchmark runs.

@nnethercote nnethercote force-pushed the nnethercote:TokenStreamBuilder-SmallVec branch from 08df22a to 17a8aff Mar 28, 2019

@nnethercote

This comment has been minimized.

Copy link
Contributor Author

nnethercote commented Mar 28, 2019

I fixed the libsyntax test.

@bors r=petrochenkov

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 28, 2019

📌 Commit 17a8aff has been approved by petrochenkov

Centril added a commit to Centril/rust that referenced this pull request Mar 29, 2019

Rollup merge of rust-lang#59476 - nnethercote:TokenStreamBuilder-Smal…
…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

Auto merge of #59513 - Centril:rollup, r=Centril
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

Auto merge of #59513 - Centril:rollup, r=Centril
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

matklad added a commit to matklad/rust that referenced this pull request Apr 17, 2019

Auto merge of rust-lang#59513 - Centril:rollup, r=Centril
Rollup of 11 pull requests

Successful merges:

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

Failed merges:

r? @ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.