-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speed up full plugin parsing for correctness checking #5
Comments
Some basic benchmarks: No changes
With FormID collection commented out (but still parsed from records)
So FormID collection is the slowest bit, but even just parsing records is still too slow for libloadorder. |
Skipping allocation of record header fields when parsing for only the FormID speeds up collectionless parsing for a memory-mapped Hearthfires.esm down to 1 ms:
Here are the results with FormID collection:
Specialising the record parsing function to be game-specific (taking the conditions out of nom macros) doesn't have any effect on performance. Neither does skipping allocation of the FormIDs. This makes sense, as the collectionless results are probably close to my SSD's throughput (it's actually rated for 2,150MB/s, I'm getting 3,636MB/s, though here the reads aren't sustained so they're not really comparable). |
Without FormID collection:
|
With just the conversion from
then with that still commented out and pushing u32s to a single vec:
The This is interesting for speeding up LOOT's sorting, as that's what uses FormIDs. As they are, FormIDs are highly portable but also very inefficient, but portability isn't really a concern as they never get passed through the C FFI and so esplugin could instead have the FormIDs reference masters rather than each taking a copy. However, it's not very relevant to speeding up correctness checking, which has probably reached its limit... Full plugin parsing is 40% - 60% faster for large plugins, and memory mapping is used only when it's likely to give better performance, but it's still not enough for libloadorder to fully parse plugins to check for correctness. As such, closing this. |
libloadorder takes about 800x longer to fully parse a load order consisting of Skyrim.esm and 20 copies of Update.esm than it does when just parsing headers. It would be great if full plugin parsing was (much) faster, and in libloadorder's case it just cares if the file format is self-consistent (i.e. structure sizes are correct, actual data could be nonsense), so it might be worth offering a parse-and-discard mode.
The first step is adding some benchmarks though.
The text was updated successfully, but these errors were encountered: