Created
December 22, 2014 06:24
-
-
Save julialang-jenkins/830ec67b393d0aab149b to your computer and use it in GitHub Desktop.
col test
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
elapsed time: 0.005279443 seconds (245720 bytes allocated) | |
elapsed time: 0.003476979 seconds (231920 bytes allocated) |
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
function collatz_branch(N::Integer) | |
i = 0 | |
while N > 1 | |
N = iseven(N) ? div(N,2) : 3N+1 | |
i += 1 | |
end | |
return i | |
end | |
function collatz_select(N::Integer) | |
i = 0 | |
while N > 1 | |
N = ifelse(iseven(N), div(N,2), 3N+1) | |
i += 1 | |
end | |
return i | |
end | |
test_branch(Ns::Vector{Int}) = map(collatz_branch, Ns) | |
test_select(Ns::Vector{Int}) = map(collatz_select, Ns) | |
gc_disable() | |
test_branch([1:10]) | |
test_select([1:10]) | |
const N = (length(ARGS) > 0 ? int(ARGS[1]) : 10000) | |
const Ns = [1:N] | |
@time test_branch(Ns) | |
@time test_select(Ns) | |
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
Julia Version 0.3.3 | |
Commit b24213b (2014-11-23 20:19 UTC) | |
Platform Info: | |
System: Linux (x86_64-linux-gnu) | |
CPU: Intel Xeon E312xx (Sandy Bridge) | |
WORD_SIZE: 64 | |
Ubuntu 12.04.5 LTS | |
uname: Linux 3.2.0-70-generic #105-Ubuntu SMP Wed Sep 24 19:49:16 UTC 2014 x86_64 x86_64 | |
Memory: 0.9721298217773438 GB (64.5390625 MB free) | |
Uptime: 2.478344e6 sec | |
Load Avg: 0.0029296875 0.0146484375 0.04541015625 | |
Intel Xeon E312xx (Sandy Bridge): | |
speed user nice sys idle irq | |
#1 2499 MHz 8487641 s 4690 s 1902778 s 236032240 s 471 s | |
#2 2499 MHz 7128747 s 221 s 1855668 s 238225036 s 0 s | |
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge) | |
LAPACK: libopenblas | |
LIBM: libopenlibm | |
LLVM: libLLVM-3.3 | |
Environment: | |
JENKINS_HOME = /var/lib/jenkins | |
LD_LIBRARY_PATH = /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/server:/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64:/usr/lib/jvm/java-6-openjdk-amd64/jre/../lib/amd64 | |
HOME = /var/lib/jenkins | |
TERM = screen | |
HUDSON_HOME = /var/lib/jenkins | |
PATH = /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games | |
Package Directory: /var/lib/jenkins/.julia/v0.3 | |
No packages installed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment