bench: Update shootout-binarytrees to use unique boxes
Shared boxes have a huge performance overhead due to #1493
This commit is contained in:
parent
793e3b231c
commit
c6f62b6374
1 changed files with 5 additions and 5 deletions
|
|
@ -1,9 +1,9 @@
|
|||
use std;
|
||||
import int;
|
||||
|
||||
tag tree { nil; node(@tree, @tree, int); }
|
||||
tag tree { nil; node(~tree, ~tree, int); }
|
||||
|
||||
fn item_check(t: @tree) -> int {
|
||||
fn item_check(t: ~tree) -> int {
|
||||
alt *t {
|
||||
nil. { ret 0; }
|
||||
node(left, right, item) {
|
||||
|
|
@ -12,11 +12,11 @@ fn item_check(t: @tree) -> int {
|
|||
}
|
||||
}
|
||||
|
||||
fn bottom_up_tree(item: int, depth: int) -> @tree {
|
||||
fn bottom_up_tree(item: int, depth: int) -> ~tree {
|
||||
if depth > 0 {
|
||||
ret @node(bottom_up_tree(2 * item - 1, depth - 1),
|
||||
ret ~node(bottom_up_tree(2 * item - 1, depth - 1),
|
||||
bottom_up_tree(2 * item, depth - 1), item);
|
||||
} else { ret @nil; }
|
||||
} else { ret ~nil; }
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue