Skip to content

Tweak MatcherPos::matches - #55558

Merged
bors merged 2 commits into
rust-lang:masterfrom
nnethercote:tweak-MatcherPos-matches
Nov 1, 2018
Merged

Tweak MatcherPos::matches#55558
bors merged 2 commits into
rust-lang:masterfrom
nnethercote:tweak-MatcherPos-matches

Conversation

@nnethercote

Copy link
Copy Markdown
Contributor

These changes reduce instruction counts on sentry-cli-check incremental builds by up to 2%.

`create_matches` creates a `Vec<Rc<Vec<NamedMatch>>>`. Even though all the
inner `Vec`s are empty, each one is created separately.
This commit changes `create_matches` so it instead creates one empty inner
`Vec`, and shares it.
The commit also changes `MatcherPos::matches` to a boxed slice, because its
length doesn't change.
@rust-highfive

Copy link
Copy Markdown
Contributor

r? @petrochenkov

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

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 1, 2018
@nnethercotennethercote changed the title Tweak matcher pos matchesTweak MatcherPos::matchesNov 1, 2018
@petrochenkov

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Nov 1, 2018

Copy link
Copy Markdown
Collaborator

📌 Commit 0d2abe4 has been approved by petrochenkov

@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 Nov 1, 2018
kennytm pushed a commit to emilyalbini/rust that referenced this pull request Nov 1, 2018
…s, r=petrochenkov
Tweak `MatcherPos::matches`
These changes reduce instruction counts on `sentry-cli-check` incremental builds by up to 2%.
bors added a commit that referenced this pull request Nov 1, 2018
Rollup of 13 pull requests
Successful merges:
- #55280 (Add libproc_macro to rust-src distribution)
- #55469 (Regression tests for issue #54477.)
- #55504 (Use vec![x; n] instead of iter::repeat(x).take(n).collect())
- #55522 (use String::from() instead of format!() macro to construct Strings.)
- #55536 (Pass suggestions as impl Iterator instead of Vec)
- #55542 (syntax: improve a few allocations)
- #55558 (Tweak `MatcherPos::matches`)
- #55561 (Fix double_check tests on big-endian targets)
- #55573 (Make sure the `aws` executable is in $PATH on macOS)
- #55574 (Use `SmallVec` within `MoveData`.)
- #55575 (Fix invalid_const_promotion test on some archs)
- #55578 (Made doc example of `impl Default for …` use `-> Self` instead of explicit self type)
- #55582 (Remove unused import copy from publish_toolstate.py)
@bors

bors commented Nov 1, 2018

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #55579) made this pull request unmergeable. Please resolve the merge conflicts.

@borsbors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 1, 2018
@bors
bors merged commit 0d2abe4 into rust-lang:masterNov 1, 2018
@nnethercote
nnethercote deleted the tweak-MatcherPos-matches branch November 1, 2018 21:18
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-authorStatus: This is awaiting some action (such as code changes or more information) from the author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@nnethercote@rust-highfive@petrochenkov@bors