Skip to content

Don't collect() when size_hint is useless - #53019

Merged
bors merged 1 commit into
rust-lang:masterfrom
ljedrz:bad_collects
Aug 13, 2018
Merged

Don't collect() when size_hint is useless#53019
bors merged 1 commit into
rust-lang:masterfrom
ljedrz:bad_collects

Conversation

@ljedrz

Copy link
Copy Markdown
Contributor

This adjusts PRs #52738 and #52697 by falling back to calculating capacity and extending or pushing in a loop where collect() can't be trusted to calculate the right capacity.

It is a performance win.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @estebank

(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 Aug 3, 2018
@oli-obk

Copy link
Copy Markdown
Contributor

Why is the collect not computing the right capacity? Can we fix the iterators instead?

@ljedrz

Copy link
Copy Markdown
ContributorAuthor

@oli-obkI tried

@estebank

Copy link
Copy Markdown
Contributor

@bors try

@Mark-Simulacrum perf?

@bors

bors commented Aug 8, 2018

Copy link
Copy Markdown
Collaborator

⌛ Trying commit b68b396 with merge 8e2e6c66ea86427aaa922f7b5e6eea92cc4f9a51...

@bors

bors commented Aug 8, 2018

Copy link
Copy Markdown
Collaborator

☀️ Test successful - status-travis
State: approved= try=True

@Mark-Simulacrum

Copy link
Copy Markdown
Member

@rust-timer build 8e2e6c66ea86427aaa922f7b5e6eea92cc4f9a51

@rust-timer

Copy link
Copy Markdown
Collaborator

Success: Queued 8e2e6c66ea86427aaa922f7b5e6eea92cc4f9a51 with parent 3f4f18f, comparison URL.

@estebank

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented Aug 9, 2018

Copy link
Copy Markdown
Collaborator

📌 Commit b68b396 has been approved by estebank

@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 Aug 9, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Aug 10, 2018
Don't collect() when size_hint is useless
This adjusts PRs rust-lang#52738 and rust-lang#52697 by falling back to calculating capacity and extending or pushing in a loop where `collect()` can't be trusted to calculate the right capacity.
It is a performance win.
@kennytmkennytm mentioned this pull request Aug 10, 2018
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Aug 12, 2018
Don't collect() when size_hint is useless
This adjusts PRs rust-lang#52738 and rust-lang#52697 by falling back to calculating capacity and extending or pushing in a loop where `collect()` can't be trusted to calculate the right capacity.
It is a performance win.
bors added a commit that referenced this pull request Aug 12, 2018
Rollup of 15 pull requests
Successful merges:
- #52955 (Update compiler test documentation)
- #53019 (Don't collect() when size_hint is useless)
- #53025 (Consider changing assert! to debug_assert! when it calls visit_with)
- #53059 (Remove explicit returns where unnecessary)
- #53165 ( Add aarch64-unknown-netbsd target)
- #53210 (Deny future duplication of rustc-ap-syntax)
- #53223 (A few cleanups for rustc_data_structures)
- #53230 ([nll] enable feature(nll) on various crates for bootstrap: part 4)
- #53231 (Add let keyword doc)
- #53240 (Add individual documentation for <integer>`.swap_bytes`/.`reverse_bits`)
- #53253 (Remove unwanted console log)
- #53264 (Show that Command can be reused and remodified)
- #53267 (Fix styles)
- #53273 (Add links to std::char::REPLACEMENT_CHARACTER from docs.)
- #53283 (wherein we suggest float for integer literals where a float was expected)
Failed merges:
r? @ghost
@bors
bors merged commit b68b396 into rust-lang:masterAug 13, 2018
@ljedrz
ljedrz deleted the bad_collects branch August 13, 2018 05:38
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

7 participants

@ljedrz@rust-highfive@oli-obk@estebank@bors@Mark-Simulacrum@rust-timer