from Hacker News

A 1,500 line switch statement that powers your Python

by defaulty on 8/30/21, 8:41 PM with 1 comments

  • by sillycross on 8/30/21, 8:56 PM

    LuaJIT's interpreter loop is similar, except that it's written in assembly, and the motivation is that the compiler could not optimize the C version to the best possible extent.

    Kind of related, this post [1] mentioned some ideas to break it down into smaller modules without losing performance with tail calls.

    [1] https://blog.reverberate.org/2021/04/21/musttail-efficient-i...