Speed up crc32 calculations subclassing crcproxy#319
Speed up crc32 calculations subclassing crcproxy#319decipherer wants to merge 6 commits intoicsharpcode:masterfrom
Conversation
syncing fork with original repository
|
I've made some updates to this pull request so that there are no longer any conflicts with the base branch. I've also fixed some of the issues codacy found a while ago. |
| throw new ArgumentNullException(nameof(buffer)); | ||
| } | ||
|
|
||
| Update(new ArraySegment<byte>(buffer, 0, buffer.Length)); |
There was a problem hiding this comment.
Pretty trivial, but just in case it's worth mentioning - is it worth creating an ArraySegment if the version of Update that takes an ArraySegment immediately unwraps it back into an array anyway?
There was a problem hiding this comment.
I did some benchmarks directly calling Proxy.Append, instead of calling the other version of Update. Unfortunately I did not see any speed benefit. But I do think the code is a bit inconsistent, there are 2 Update methods where Proxy.Append is called directly, then there is a 3rd Update method that calls one of the other 2 Update methods.
There was a problem hiding this comment.
I suppose that handling these sort of differences in where Span and friends can be useful, though I guess the extra dependency they have in versions of .Net prior to the latest would be unwanted?
|
See #306 |
This PR offers basically the same change as my last one (#318), but the implementation is slightly different, using subclassing instead of Func<>'s
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.