osa1 / lexgen

A fully-featured lexer generator, implemented as a proc macro
MIT License
63 stars 7 forks source link

Use perfect hashing rather than binary search #61

Closed seanyoung closed 1 year ago

seanyoung commented 1 year ago

Right now when we have search table we use binary search. We could use perfect hashing for this and improve performance, at the cost compilation time.

seanyoung commented 1 year ago

Actually we are searching character ranges so perfect hashing doesn't help here. We could flatten the ranges into a list but this would use far too much memory.