News for hackers. Stuff that matters.
Re:How the CPython compiler works by anon946 on Thursday September 24, 2020 @12:47PM (#24580603)
For more than a few cases in the switch:

If the case values are dense (such as just the integers from 0 to 9), the compiler will turn it into a jump table.

https://godbolt.org/z/1Khahr

If too sparse for jump table, then typically will be turned into a binary search tree.

There are no comments on this comment yet.