Created
March 9, 2012 21:43
-
-
Save marijnh/2008845 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let x = vec::init_elt(5000u, 20), y = 0; | |
int::range(0, 10000, {|_i| | |
y += vec::foldl(1, x, {|a, b| a + b}); | |
vec::iteri(x, {|i, e| y += i as int + e;}); | |
y += vec::map(x, {|x| x + 2}).len() as int; | |
}); | |
log(error, y); | |
} | |
~/src/rust > x86_64-unknown-linux-gnu/stage2/bin/rustc -O foo.rs | |
~/src/rust > time ./foo | |
rust: 127025010000 | |
real 0m1.141s | |
user 0m1.120s | |
sys 0m0.010s | |
~/src/rust > x86_64-unknown-linux-gnu/stage0/bin/rustc -O foo.rs | |
~/src/rust > time ./foo | |
rust: 127025010000 | |
real 0m6.604s | |
user 0m6.580s | |
sys 0m0.010s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment