Skip to content

Instantly share code, notes, and snippets.

@haampie
Created August 24, 2018 13:39
Show Gist options
  • Save haampie/79b32f5b9cc05d88429aa312b7c5195a to your computer and use it in GitHub Desktop.
Save haampie/79b32f5b9cc05d88429aa312b7c5195a to your computer and use it in GitHub Desktop.
tuple.jl
module TupleBench
using BenchmarkTools
const t32 = ntuple(identity, Val(32))
const t256 = ntuple(identity, Val(256))
const t1024 = ntuple(identity, Val(1024))
const v32 = collect(1:32)
const v256 = collect(1:256)
const v1024 = collect(1:1024)
function go()
a = @benchmark 9000 in $t32
b = @benchmark 9000 in $t256
c = @benchmark 9000 in $t1024
d = @benchmark 9000 in $v32
e = @benchmark 9000 in $v256
f = @benchmark 9000 in $v1024
a, b, c, d, e, f
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment