Hi all, a few quick questions.
A) does the linux_amd64 gc produce jump tables from iota-const-enum switch statements?
B) are there any major restrictions on this, i.e. no offsets from zero allowed, must be contiguous etc?
C) alas I don't know what I'm looking at in the assembly, if A is true could someone please post some code that compiles to a jump table on aforementioned compiler, I'd like a sane example to study from/experiment with?
Reasons: at this point mainly curiosity, I've been trying to make a big set of conditionals run faster. It checks for a custom entityType byte in each of a slice of objects once per global iteration, then calls a function based on the entityType. Another option I'm toying with is replacing the entityType byte with a function pointer to its update function, which is a closure factory-generated at entity init.
D) lastly, I don't know what performance gains a jump table would get me, but I'm willing to put some work in over xmas and benchmark the results, so don't criticize me for blindly groping. All I remember is from intro to electric circuits :s.
Thanks a-bundle, and a merry christmas(or other if you prefer)
Simon Watt.
--