liblcf
liblcf copied to clipboard
Optimize the parsers
I was thinking about how to optimize the parsing code. I had the following ideas for things to try.
- [ ] Use a tuple based approach for Fields
The Field abstraction relies on iterating over heap allocated objects and virtual calls. Replace fields[] with a std::tuple<Field> for each Struct to optimize the memory layout and avoid the heap. Remove the virtual calls and iterate using templates instead.
- [ ] Optimize
field_mapandtag_map
A hash table or sorted array would perform better than std::map