-
The original Julia code
function fcount(x::Vector{Bool}) sumx = sum(x) Dict{Bool, Int}(true => sumx, false => length(x) - sumx) end srand(2) bool = rand(Bool, 1000000000) @time fcount(bool) # 0.612951 seconds (629 allocations: 36.195 KiB) # Dict{Bool,Int64} with 2 entries: # false => 499978312 # true => 500021688
Please register or sign in to comment