Re:Goto (2007)
by codr7 on Thursday October 21, 2021 @12:33PM
(#28946991)
https://github.com/codr7/ampl/blob/main/src/ampl/eval.cpp
[ Parent
| on HN ]
Re:Goto (2007)
by slaymaker1907 on Thursday October 21, 2021 @12:48PM
(#28947259)
Replying to infiniterand, a table of function pointers is going to generally have way more overhead than an indirect goto. An indirect goto is essentially a single assembly jump instruction. This is also often faster than a while loop plus switch since it is friendlier to the branch predictor.
Re:Goto (2007)
by InfiniteRand on Thursday October 21, 2021 @12:39PM
(#28947113)
I'm sure there's probably a reason for doing things this way, but it seems like that code would make more sense as a function pointer table and a series of functions. Was that not preferred for aesthetic reasons or for some specific technical reason?