Get the latest tech news

Faster interpreters in Go: Catching up with C++


A novel technique for implementing dynamic language interpreters in Go, applied to the Vitess SQL evaluation engine

But after implementing a good chunk of specialized instructions for the different types of operators in SQL and attempting to runtime rewrite them, I noticed an opportunity to take the idea even further by making it more efficient and, crucially, simpler. It turns out that the semantic analysis we perform in Vitess is advanced enough that, through careful integration with the upstream MySQL server and its information schema, it can be used to statically type the AST of the SQL expressions we were executing. One further detail which is not shown on the graphs, but can be seen on the raw benchmark data, is that the new virtual machine does not allocate memory to perform evaluation — a very nice side effect of the fully specialized instructions thanks to the static type checking.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of C++

C++

Photo of Faster interpreters

Faster interpreters

Related news:

News photo

C and C++ prioritize performance over correctness (2023)

News photo

Taming the UB Monsters in C++

News photo

Writing your own C++ standard library from scratch