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 9 pull requests #39643

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
e866d07
lint/ctypes: Don't warn on non-unsized structs with PhantomData.
emilio Feb 2, 2017
b4e6f70
[llvm] Use 32-bits for alignment
Feb 4, 2017
c7bea76
Use u32 for alignments instead of u64
Feb 5, 2017
7c8c45e
Extract collections benchmarks to libcollections/benches
phungleson Feb 6, 2017
b975786
regr test
nikomatsakis Feb 6, 2017
4f5fc4e
fix case where some edges can't be recreated by expanding the graph
nikomatsakis Feb 6, 2017
1ee88e5
A few documentation improvements for `syntax::print::pp`
bjorn3 Feb 5, 2017
2a345bb
make Child::try_wait return io::Result<Option<ExitStatus>>
oconnor663 Feb 3, 2017
87b8c9e
Add Emscripten-specific linker
RReverser Feb 3, 2017
7916e00
Bump stable release date
brson Feb 7, 2017
e53eaa3
Rename manifest_version to manifest-version
alexcrichton Feb 7, 2017
a261924
Rollup merge of #39462 - emilio:improper-ctypes, r=nikomatsakis
frewsxcv Feb 8, 2017
08f4ea4
Rollup merge of #39490 - RReverser:em-linker, r=alexcrichton
frewsxcv Feb 8, 2017
ed172ee
Rollup merge of #39512 - oconnor663:try_wait, r=alexcrichton
frewsxcv Feb 8, 2017
fef8b92
Rollup merge of #39529 - dylanmckay:llvm-4.0-align32, r=alexcrichton
frewsxcv Feb 8, 2017
3ee6fae
Rollup merge of #39557 - bjorn3:pp-docs, r=jseyfried
frewsxcv Feb 8, 2017
1270c28
Rollup merge of #39561 - phungleson:libcollectionsbench, r=alexcrichton
frewsxcv Feb 8, 2017
fefcbc7
Rollup merge of #39582 - nikomatsakis:incr-comp-issue-39569, r=michae…
frewsxcv Feb 8, 2017
09a2db5
Rollup merge of #39624 - brson:relnotes-master, r=alexcrichton
frewsxcv Feb 8, 2017
163f981
Rollup merge of #39630 - alexcrichton:update-manifest, r=brson
frewsxcv Feb 8, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Version 1.15.1 (2017-02-07)
Version 1.15.1 (2017-02-08)
===========================

* [Fix IntoIter::as_mut_slice's signature][39466]
Expand Down
1 change: 1 addition & 0 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions src/libcollections/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ std_unicode = { path = "../libstd_unicode" }
name = "collectionstest"
path = "../libcollectionstest/lib.rs"

# FIXME: need to extract benchmarks to separate crate
#[[bench]]
#name = "collectionstest"
#path = "../libcollectionstest/lib.rs"
[[bench]]
name = "collectionsbenches"
path = "../libcollections/benches/lib.rs"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -8,13 +8,17 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.


use std::iter::Iterator;
use std::vec::Vec;
use std::collections::BTreeMap;
use std::__rand::{Rng, thread_rng};
use test::{Bencher, black_box};

macro_rules! map_insert_rand_bench {
($name: ident, $n: expr, $map: ident) => (
#[bench]
pub fn $name(b: &mut ::test::Bencher) {
use std::__rand::{thread_rng, Rng};
use test::black_box;

pub fn $name(b: &mut Bencher) {
let n: usize = $n;
let mut map = $map::new();
// setup
Expand All @@ -39,9 +43,7 @@ macro_rules! map_insert_rand_bench {
macro_rules! map_insert_seq_bench {
($name: ident, $n: expr, $map: ident) => (
#[bench]
pub fn $name(b: &mut ::test::Bencher) {
use test::black_box;

pub fn $name(b: &mut Bencher) {
let mut map = $map::new();
let n: usize = $n;
// setup
Expand All @@ -64,12 +66,7 @@ macro_rules! map_insert_seq_bench {
macro_rules! map_find_rand_bench {
($name: ident, $n: expr, $map: ident) => (
#[bench]
pub fn $name(b: &mut ::test::Bencher) {
use std::iter::Iterator;
use std::__rand::{thread_rng, Rng};
use std::vec::Vec;
use test::black_box;

pub fn $name(b: &mut Bencher) {
let mut map = $map::new();
let n: usize = $n;

Expand Down Expand Up @@ -97,9 +94,7 @@ macro_rules! map_find_rand_bench {
macro_rules! map_find_seq_bench {
($name: ident, $n: expr, $map: ident) => (
#[bench]
pub fn $name(b: &mut ::test::Bencher) {
use test::black_box;

pub fn $name(b: &mut Bencher) {
let mut map = $map::new();
let n: usize = $n;

Expand All @@ -118,3 +113,45 @@ macro_rules! map_find_seq_bench {
}
)
}

map_insert_rand_bench!{insert_rand_100, 100, BTreeMap}
map_insert_rand_bench!{insert_rand_10_000, 10_000, BTreeMap}

map_insert_seq_bench!{insert_seq_100, 100, BTreeMap}
map_insert_seq_bench!{insert_seq_10_000, 10_000, BTreeMap}

map_find_rand_bench!{find_rand_100, 100, BTreeMap}
map_find_rand_bench!{find_rand_10_000, 10_000, BTreeMap}

map_find_seq_bench!{find_seq_100, 100, BTreeMap}
map_find_seq_bench!{find_seq_10_000, 10_000, BTreeMap}

fn bench_iter(b: &mut Bencher, size: i32) {
let mut map = BTreeMap::<i32, i32>::new();
let mut rng = thread_rng();

for _ in 0..size {
map.insert(rng.gen(), rng.gen());
}

b.iter(|| {
for entry in &map {
black_box(entry);
}
});
}

#[bench]
pub fn iter_20(b: &mut Bencher) {
bench_iter(b, 20);
}

#[bench]
pub fn iter_1000(b: &mut Bencher) {
bench_iter(b, 1000);
}

#[bench]
pub fn iter_100000(b: &mut Bencher) {
bench_iter(b, 100000);
}
11 changes: 11 additions & 0 deletions src/libcollections/benches/btree/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

mod map;
24 changes: 24 additions & 0 deletions src/libcollections/benches/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![deny(warnings)]

#![feature(rand)]
#![feature(test)]

extern crate test;

mod btree;
mod linked_list;
mod string;
mod str;
mod slice;
mod vec;
mod vec_deque;
87 changes: 87 additions & 0 deletions src/libcollections/benches/linked_list.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::collections::LinkedList;
use test::Bencher;

#[bench]
fn bench_collect_into(b: &mut Bencher) {
let v = &[0; 64];
b.iter(|| {
let _: LinkedList<_> = v.iter().cloned().collect();
})
}

#[bench]
fn bench_push_front(b: &mut Bencher) {
let mut m: LinkedList<_> = LinkedList::new();
b.iter(|| {
m.push_front(0);
})
}

#[bench]
fn bench_push_back(b: &mut Bencher) {
let mut m: LinkedList<_> = LinkedList::new();
b.iter(|| {
m.push_back(0);
})
}

#[bench]
fn bench_push_back_pop_back(b: &mut Bencher) {
let mut m: LinkedList<_> = LinkedList::new();
b.iter(|| {
m.push_back(0);
m.pop_back();
})
}

#[bench]
fn bench_push_front_pop_front(b: &mut Bencher) {
let mut m: LinkedList<_> = LinkedList::new();
b.iter(|| {
m.push_front(0);
m.pop_front();
})
}

#[bench]
fn bench_iter(b: &mut Bencher) {
let v = &[0; 128];
let m: LinkedList<_> = v.iter().cloned().collect();
b.iter(|| {
assert!(m.iter().count() == 128);
})
}
#[bench]
fn bench_iter_mut(b: &mut Bencher) {
let v = &[0; 128];
let mut m: LinkedList<_> = v.iter().cloned().collect();
b.iter(|| {
assert!(m.iter_mut().count() == 128);
})
}
#[bench]
fn bench_iter_rev(b: &mut Bencher) {
let v = &[0; 128];
let m: LinkedList<_> = v.iter().cloned().collect();
b.iter(|| {
assert!(m.iter().rev().count() == 128);
})
}
#[bench]
fn bench_iter_mut_rev(b: &mut Bencher) {
let v = &[0; 128];
let mut m: LinkedList<_> = v.iter().cloned().collect();
b.iter(|| {
assert!(m.iter_mut().rev().count() == 128);
})
}
Loading