Get the latest tech news

Computed goto for efficient dispatch tables (2012)


Recently, while idly browsing through the source code of Python, I came upon an interesting comment in the bytecode VM implementation (Python/ceval.c) about using the computed gotos extension of GCC [1]. Driven by curiosity, I decided to code a simple example to evaluate the difference between using a computed goto and a traditional switch statement for a simple VM.

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Computed goto

Computed goto