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
src/PrecisCodePoints.re
fromCodePoint: codePoint => precisType
src/PrecisCodePoints.re
lowerCaseMap: codePoint => codePoint
All switch statements over a certain size should be optimized this way.
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
src/PrecisCodePoints.re
fromCodePoint: codePoint => precisType
src/PrecisCodePoints.re
lowerCaseMap: codePoint => codePoint
All switch statements over a certain size should be optimized this way.