Skip to content
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

Use DBArray for all LDB, LMT, and LMU structs #383

Draft
wants to merge 47 commits into
base: master
Choose a base branch
from

Conversation

fmatthew5876
Copy link
Contributor

@fmatthew5876 fmatthew5876 commented Aug 19, 2020

Depends on #379

This PR adds C++20 compatible lcf::Span and a new DBArray array class, which has a similar storage policy and small memory footprint like DBString. It also adds a DBBitArray bit vector replacement for vector<bool>.

This is a WIP, a lot of refactoring is needed in liblcf to get this new Array type working for all the chunks.

Here are some initial numbers where we just convert EventCommand::parameters to use DBArray

Game Ldb Size std::string + std::vector DBString + std::vector DBString + DBArray
HH3 16MB 135.7MB 94.7MB 68.7 MB
Heroes Realm 27MB 301.6MB 204.3MB 143.3 MB
Violated Heroine 11MB 75.9MB 54.6MB 41.4 MB
Yume 2kki 1.4MB 8.0MB 6.0MB 4.9 MB

@fmatthew5876 fmatthew5876 changed the title Optimize memory usage with DBArray Use DBArray for all LDB, LMT, and LMU structs Aug 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants