You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 ~5.5x 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.0649818
Calculating checksum using the new method... Hash: 8203D033719B6B96; Time: 00:00:00.7251845
The calculated hash is different (although still stable and correct)
because the new code uses tables generated using a slightly different
set of parameters. Instead of using a single lookup table, the new
code takes the slice-by-8 approach (explained e.g. here https://create.stephan-brumme.com/crc32/#slicing-by-8-overview)
which processes 8 bytes at a time, using 8 lookup tables instead of one.
Copy file name to clipboardExpand all lines: tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/JavaCallableWrapperGeneratorTests.cs
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -124,7 +124,7 @@ public void GenerateIndirectApplication (
Copy file name to clipboardExpand all lines: tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/JavaNativeTypeManagerTests.cs
Copy file name to clipboardExpand all lines: tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers/TypeNameMapGeneratorTests.cs
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -59,12 +59,12 @@ public void WriteJavaToManaged ()
0 commit comments