Makes changes to ITypeDescriber to remove (almost always) required allocations when writing dynamic rows.
Visible changes:
ITypeDescriber.GetCellsForDynamicRow() no longer returns an IEnumerable<DynamicCellValue>, it now returns an int and takes an additional Span<DynamicCellValue> parameter
Instead of yielding cells in a (almost always) newly allocated IEnumerable<T> it fills out a Span<T>. The allocation can be reused, and will almost always be the ideal size after the first row.
The returned int is the number of cells needed, if it's larger than the previously provided span the method is called a second time with a span of at least the required size
Options now has an MemoryPoolProvider property (with corresponding OptionsBuilder members) that implements the new IMemoryPoolProvider interface
MemoryPool<char> and MemoryPool<DynamicCellValue> instances are now obtained via this interface
Options no longer has a MemoryPool property
Internal changes:
Closes #6
Reworks ForceInOrder in dynamic writers to not allocate
This was relatively rare, since dynamic cells are typically in the correct order, but worth killing
BoundConfigurationBase<T> now hold references to MemoryPool<char> and MemoryPool<DynamicCellValue>, meaning a number of places that took an Options now also take whichever memory pool they needed (if any)
Makes changes to ITypeDescriber to remove (almost always) required allocations when writing
dynamic
rows.Visible changes:
ITypeDescriber.GetCellsForDynamicRow()
no longer returns anIEnumerable<DynamicCellValue>
, it now returns anint
and takes an additionalSpan<DynamicCellValue>
parameterIEnumerable<T>
it fills out aSpan<T>
. The allocation can be reused, and will almost always be the ideal size after the first row.int
is the number of cells needed, if it's larger than the previously provided span the method is called a second time with a span of at least the required sizeOptions
now has anMemoryPoolProvider
property (with correspondingOptionsBuilder
members) that implements the newIMemoryPoolProvider
interfaceMemoryPool<char>
andMemoryPool<DynamicCellValue>
instances are now obtained via this interfaceOptions
no longer has aMemoryPool
propertyInternal changes:
ForceInOrder
in dynamic writers to not allocateBoundConfigurationBase<T>
now hold references toMemoryPool<char>
andMemoryPool<DynamicCellValue>
, meaning a number of places that took anOptions
now also take whichever memory pool they needed (if any)