Computed goto for efficient dispatch tables
Summary
Computed goto for efficient dispatch tables analyzes using GCC's computed goto (labels-as-values) to implement a dispatch table for a tiny VM, comparing it to a traditional switch-based loop. The article provides sample implementations (interp_switch vs interp_cgoto), benchmarking results showing speedups, and discusses why the computed goto approach can outperform a switch, including effects of bounds checks and branch prediction, with notes on how other VMs employ similar techniques.