Skip to content

Commit c6f62b6

Browse files
committed
bench: Update shootout-binarytrees to use unique boxes
Shared boxes have a huge performance overhead due to #1493
1 parent 793e3b2 commit c6f62b6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/test/bench/shootout-binarytrees.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use std;
22
import int;
33

4-
tag tree { nil; node(@tree, @tree, int); }
4+
tag tree { nil; node(~tree, ~tree, int); }
55

6-
fn item_check(t: @tree) -> int {
6+
fn item_check(t: ~tree) -> int {
77
alt *t {
88
nil. { ret 0; }
99
node(left, right, item) {
@@ -12,11 +12,11 @@ fn item_check(t: @tree) -> int {
1212
}
1313
}
1414

15-
fn bottom_up_tree(item: int, depth: int) -> @tree {
15+
fn bottom_up_tree(item: int, depth: int) -> ~tree {
1616
if depth > 0 {
17-
ret @node(bottom_up_tree(2 * item - 1, depth - 1),
17+
ret ~node(bottom_up_tree(2 * item - 1, depth - 1),
1818
bottom_up_tree(2 * item, depth - 1), item);
19-
} else { ret @nil; }
19+
} else { ret ~nil; }
2020
}
2121

2222
fn main() {

0 commit comments

Comments
 (0)