About this question
Medium · low_latency · Quant Developer interview question · computed-goto, dispatch, jump-table, low_latency, gcc-extension, message-handler
In high-frequency trading, market data handlers must dispatch messages to their corresponding processors with minimal latency. GCC's computed goto extension provides a mechanism to build an explicit jump table, bypassing the overhead of traditional switch statements. This technique is used by HFT firms to achieve sub-100 nanosecond message classification by eliminating bounds checks and reducing branch predictor pressure. Task Implement the function dispatch_message(int msg_type, double value)
Keep practicing