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

Rollup of 15 pull requests #22281

Closed
wants to merge 34 commits into from
Closed

Conversation

sanxiyn and others added 30 commits February 13, 2015 00:47
According to @dotdash it enables more aggressive optimizations from LLVM
This PR is an optimization of the `FromIterator` implementation of `Vec`

Benchmark: https://gist.github.com/alexcrichton/03d666159a28a80e7c70

Before:
    test macro_repeat1     ... bench:        57 ns/iter (+/- 1)
    test macro_repeat2     ... bench:        56 ns/iter (+/- 1)
    test map_clone1        ... bench:       828 ns/iter (+/- 13)
    test map_clone2        ... bench:       828 ns/iter (+/- 8)
    test repeat1           ... bench:      1104 ns/iter (+/- 10)
    test repeat2           ... bench:      1106 ns/iter (+/- 11)

After:
    test macro_repeat1     ... bench:        75 ns/iter (+/- 21)
    test macro_repeat2     ... bench:        59 ns/iter (+/- 31)
    test map_clone1        ... bench:        34 ns/iter (+/- 22)
    test map_clone2        ... bench:        52 ns/iter (+/- 21)
    test repeat1           ... bench:        34 ns/iter (+/- 11)
    test repeat2           ... bench:        33 ns/iter (+/- 12)

The idea behind this optimization is to avoid all bounds checks for space
already allocated into the vector. This may involve running the iterator twice,
but the first run of the iterator should be optimizable to a memcpy or memset if
possible.

The same treatment can in theory be applied to `Vec::extend` but the benchmarks
for that currently get *worse* if the change is applied. This appears to be some
LLVM optimizations going awry but it's seems prudent to land at least the
`collect` portion beforehand.
It is not totally clear if we should just use whitespace, or if the full
unicode word-breaking algorithm is more correct. If there is demand we
can reconsider this decision (and consider the precise algorithm to use
in detail).

cc rust-lang#15628.
In `std::f32` and `std::f64`:

- `MIN_VALUE` → `MIN`
- `MAX_VALUE` → `MAX`
- `MIN_POS_VALUE` → `MIN_POSITIVE`

This matches the corresponding integer constants.

[breaking-change]
Also add address of IRC server. Addresses rust-lang#22249.
This resolves rust-lang#22243, at least for one-letter variable names.
Remove incorrect claim, add example, reformat and re-word.

Fixes rust-lang#22266
Rollup merge (373cbab) of PR rust-lang#20723
accidentally reverted a portion of commit
8327bcc which shifted
`slicing_syntax` from Active to Accepted.
Added a second note about keeping the reference.md list up-to-date to
the bottom of the list, since not everyone (including me) reads the
big comment at the top of it.  :)

Ensured that the feature gate list in reference.md is kept in
alphabetical order.
if found on the `main()` function. This lets you write tests that live
in `compile-fail` but are expected to compile successfully. This is
handy when you have many small variations on a theme that you want to
keep together, and you are just testing the type checker, not the
runtime semantics.
This PR is an optimization of the `FromIterator` implementation of `Vec`

Benchmark: https://gist.github.com/alexcrichton/03d666159a28a80e7c70

Before:

    test macro_repeat1     ... bench:        57 ns/iter (+/- 1)
    test macro_repeat2     ... bench:        56 ns/iter (+/- 1)
    test map_clone1        ... bench:       828 ns/iter (+/- 13)
    test map_clone2        ... bench:       828 ns/iter (+/- 8)
    test repeat1           ... bench:      1104 ns/iter (+/- 10)
    test repeat2           ... bench:      1106 ns/iter (+/- 11)

After:

    test macro_repeat1     ... bench:        75 ns/iter (+/- 21)
    test macro_repeat2     ... bench:        59 ns/iter (+/- 31)
    test map_clone1        ... bench:        34 ns/iter (+/- 22)
    test map_clone2        ... bench:        52 ns/iter (+/- 21)
    test repeat1           ... bench:        34 ns/iter (+/- 11)
    test repeat2           ... bench:        33 ns/iter (+/- 12)

The idea behind this optimization is to avoid all bounds checks for space
already allocated into the vector. This may involve running the iterator twice,
but the first run of the iterator should be optimizable to a memcpy or memset if
possible.

The same treatment can in theory be applied to `Vec::extend` but the benchmarks
for that currently get *worse* if the change is applied. This appears to be some
LLVM optimizations going awry but it's seems prudent to land at least the
`collect` portion beforehand.
According to @dotdash it enables more aggressive optimizations from LLVM
It is not totally clear if we should just use whitespace, or if the full
unicode word-breaking algorithm is more correct. If there is demand we
can reconsider this decision (and consider the precise algorithm to use
in detail).

cc rust-lang#15628.
In `std::f32` and `std::f64`:

- `MIN_VALUE` → `MIN`
- `MAX_VALUE` → `MAX`
- `MIN_POS_VALUE` → `MIN_POSITIVE`

This matches the corresponding integer constants.

[breaking-change]
…akis

Removes the link to the rust-dev mailing list in the bug report submission page and also adds the address of the IRC server (`irc.mozilla.org`). Addresses rust-lang#22249.
…tsakis

Remove incorrect claim, add example, reformat and re-word.

Fixes rust-lang#22266
…cepted, r=nikomatsakis

Rollup merge (373cbab) of PR rust-lang#20723
accidentally reverted a portion of commit
8327bcc which shifted
`slicing_syntax` from Active to Accepted.
This resolves rust-lang#22243 for the single-letter variables that I could grep. Some occurences could not be replaced.
…ate-list, r=steveklabnik

Added all active features to the list in reference.md.

Added a second note about keeping the reference.md list up-to-date to the bottom of the list, since not everyone (including me) reads the big comment at the top of it.  :)

Ensured that the feature gate list in reference.md is kept in alphabetical order.
…sakis

Add `#[rustc_error]` annotation, which causes trans to signal an error
if found on the `main()` function. This lets you write tests that live
in `compile-fail` but are expected to compile successfully. This is
handy when you have many small variations on a theme that you want to
keep together, and you are just testing the type checker, not the
runtime semantics.

r? @pnkfelix
@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

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

@steveklabnik
Copy link
Member Author

@bors: r+ ee96742

@bors
Copy link
Contributor

bors commented Feb 13, 2015

⌛ Testing commit ee96742 with merge 21a3d9e...

@bors
Copy link
Contributor

bors commented Feb 13, 2015

💔 Test failed - auto-linux-64-nopt-t

... as it is no longer needed.
@steveklabnik
Copy link
Member Author

@bors: r+ 7ac46el

@bors
Copy link
Contributor

bors commented Feb 13, 2015

🙀 You have the wrong number! Please try again with 7ac46e1.

@steveklabnik
Copy link
Member Author

@bors: r+ 7ac46e1

@huonw
Copy link
Member

huonw commented Feb 14, 2015

@bors p=1

@bors
Copy link
Contributor

bors commented Feb 14, 2015

⌛ Testing commit 7ac46e1 with merge 5d7625a...

@bors
Copy link
Contributor

bors commented Feb 14, 2015

💔 Test failed - auto-linux-64-opt

@steveklabnik
Copy link
Member Author

Closing in favor of a bigger rollup

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Feb 19, 2015
This overlaps with rust-lang#22276 (I left make check running overnight) but covers a number of additional cases and has a few rewrites where the clones are not even necessary.

This also implements `RandomAccessIterator` for `iter::Cloned`

cc @steveklabnik, you may want to glance at this before rust-lang#22281 gets the bors treatment
@Centril Centril added the rollup A PR which is a rollup label Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet