Change string building benchmarks.
This commit is contained in:
parent
dc3a217b2f
commit
e58b57b6e7
@ -126,9 +126,9 @@ fn bench_eval_loop_number(bench: &mut Bencher) {
|
|||||||
#[bench]
|
#[bench]
|
||||||
fn bench_eval_loop_strings_build(bench: &mut Bencher) {
|
fn bench_eval_loop_strings_build(bench: &mut Bencher) {
|
||||||
let script = r#"
|
let script = r#"
|
||||||
let s = "hello";
|
let s;
|
||||||
for x in range(0, 10000) {
|
for x in range(0, 10000) {
|
||||||
s += "x";
|
s = "hello, world!" + "hello, world!";
|
||||||
}
|
}
|
||||||
"#;
|
"#;
|
||||||
|
|
||||||
@ -143,9 +143,9 @@ fn bench_eval_loop_strings_build(bench: &mut Bencher) {
|
|||||||
#[bench]
|
#[bench]
|
||||||
fn bench_eval_loop_strings_no_build(bench: &mut Bencher) {
|
fn bench_eval_loop_strings_no_build(bench: &mut Bencher) {
|
||||||
let script = r#"
|
let script = r#"
|
||||||
let s = "hello";
|
let s;
|
||||||
for x in range(0, 10000) {
|
for x in range(0, 10000) {
|
||||||
s += "";
|
s = "hello" + "";
|
||||||
}
|
}
|
||||||
"#;
|
"#;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user