Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
``` test new_push_byte ... bench: 6985 ns/iter (+/- 487) = 17 MB/s test old_push_byte ... bench: 19335 ns/iter (+/- 1368) = 6 MB/s ``` ```rust extern crate test; use test::Bencher; static TEXT: &'static str = "\ Unicode est un standard informatique qui permet des échanges \ de textes dans différentes langues, à un niveau mondial."; #[bench] fn old_push_byte(bencher: &mut Bencher) { bencher.bytes = TEXT.len() as u64; bencher.iter(|| { let mut new = String::new(); for b in TEXT.bytes() { unsafe { new.as_mut_vec().push_all([b]) } } }) } #[bench] fn new_push_byte(bencher: &mut Bencher) { bencher.bytes = TEXT.len() as u64; bencher.iter(|| { let mut new = String::new(); for b in TEXT.bytes() { unsafe { new.as_mut_vec().push(b) } } }) } ```
- Loading branch information
ed3eee2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from alexcrichton
at SimonSapin@ed3eee2
ed3eee2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging SimonSapin/rust/patch-4 = ed3eee2 into auto
ed3eee2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SimonSapin/rust/patch-4 = ed3eee2 merged ok, testing candidate = f601c3e
ed3eee2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/207
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/208
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/207
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/208
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/210
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/211
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/210
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/216
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/211
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/210
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/213
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/211
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/210
ed3eee2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = f601c3e