This PR improves InflaterHuffmanTree.BuildTree in the following ways:
Take in ReadOnlySpan<byte> instead of IList<byte>, IList causes interface dispatch and could change in size in theory which makes it hard to optimize for runtime, ROS ensures fast iteration and fixed size
made this new constructor internal so old there shouldn't be a breaking change for library consumers, in the future the span based version would be better in public API
Move tree byte building from static constructor to ROS<byte> => new [] { b1, b2 } which ensures data is loaded from assembly static data section without the need of allocations, created test case to generate the data using same logic that was in the static constructor
I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the SharpZipLib open source product (the "Contribution"). My Contribution is licensed under the MIT License.
This PR improves
InflaterHuffmanTree.BuildTree
in the following ways:ReadOnlySpan<byte>
instead ofIList<byte>
,IList
causes interface dispatch and could change in size in theory which makes it hard to optimize for runtime,ROS
ensures fast iteration and fixed sizeROS<byte> => new [] { b1, b2 }
which ensures data is loaded from assembly static data section without the need of allocations, created test case to generate the data using same logic that was in the static constructorResults
ICSharpCode.SharpZipLib.Benchmark.Zip.ZipFile
ICSharpCode.SharpZipLib.Benchmark.Zip.ZipInputStream
I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the SharpZipLib open source product (the "Contribution"). My Contribution is licensed under the MIT License.