my_tuple[:foo]
end
fun enum_value : Int32
MyEnum::Foo.value
end
~~~
somewhere in the file you'll see this:
~~~
; Function Attrs: norecurse nounwind readnone uwtable
define i32 @tuple_value() local_unnamed_addr #9 !dbg !13637 {
alloca:
ret i32 1, !dbg !13639
}
; Function Attrs: norecurse nounwind readnone uwtable
define i32 @enum_value() local_unnamed_addr #9 !dbg !13640 {
entry:
ret i32 0, !dbg !13641
}
~~~
That means that LLVM was able to optimize it to constants so there shouldn't be a real difference.
That said, it would be interesting to benchmark the benchmarker and check why it gives different values for different indexes inside a same run. It's curious that if you swap the order in your code it still gives the slower one as slowest.