kevin-montrose / Cesil

Modern CSV (De)Serializer
MIT License
65 stars 3 forks source link

Remove allocations from NameLookup creation #4

Closed kevin-montrose closed 3 years ago

kevin-montrose commented 4 years ago

NameLookup is a struct used to speed up looking up dynamic members. In use it is allocation free and most construction code places data on the client provider MemoryPool<char> - but there are three places that directly allocate on the heap. These should be replaced either with no allocation code (which appears quite tricky) or with code that only uses memory obtained from a MemoryPool<char>.

This code is performance critical - there three benchmarks to verify that improvements on allocations do not cause regressions in runtime.