mirror of
https://github.com/loot/loot-condition-interpreter.git
synced 2026-07-27 14:16:09 -07:00
Speed up CRC32 calculation
It turns out that passing in one byte at a time is really inefficient (which really should have been obvious...). For small files the difference is insignificant, but for Skyrim SE's Update.esm (18 MB) feeding in the buffered file content slice made the calculation twice as fast, and this seems to have non-linear effect, as the benchmark against Dragonborn.esm (63 MB) would have taken ~ 1137 seconds to run when passing one byte at a time (the benchmark using a buffer took ~ 5 seconds). On top of that, switching to the crc32fast crate has an insignificant effect on benchmarking with Blank.esm, but Update.esm's benchmark was twice as fast again, and when benchmarking with Dragonborn.esm, using crc32fast was ~ 170x faster than using the crc crate!
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ license = "MIT"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
crc = "1.0.0"
|
||||
crc32fast = "1.2.0"
|
||||
esplugin = "3.0.0"
|
||||
nom = "5.0.0"
|
||||
pelite = "0.8.0"
|
||||
|
||||
Reference in New Issue
Block a user