Commit 8f9a355
committed
[performance] Improve speed of our CRC-64 hasher
Modify the implementation to use splicing in order to process data in a
smaller number of iterations, at the expense of a bit more memory for
the extra tables. A quick test of calculating checksum for a 1GB file
shows a ~4x improvement:
Allocating 1043332542 bytes to hold file data
Reading file 'android-ndk-r21-linux-x86_64.zip' into memory
Calculating checksum using the old method... Hash: 197913BA13B9A1CC; Time: 00:00:04.0452013
Calculating checksum using the new method... Hash: 8203D033719B6B96; Time: 00:00:01.3510739
The calculated hash is different (although still stable and correct)
because the new code uses tables generated using a slightly different
set of parameters.1 parent 93df5a2 commit 8f9a355
File tree
2 files changed
+565
-137
lines changed- src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers
2 files changed
+565
-137
lines changed
0 commit comments