NineFX / bs-precis

Bucklescript Implementation for Precis; WIP NPM package for Precis string-prep
MIT License
1 stars 1 forks source link

Optimization of Long Switch Statements #2

Closed justinba1010 closed 5 years ago

justinba1010 commented 5 years ago

The implementation of some of the core unicode functions are generated by the python scripts in ./precis_gen/. They are also either long switch statements, or an optimized b-tree implementation. When trying to use lookup tables, we ran into memory issues. And straight switch statements gave us incredibly long run times. This is the solution I have at the moment, and am open to hearing others.

Examples of B-Tree Optimization

All switch statements over a certain size should be optimized this way.