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

mateofio
Copy link
Contributor

@mateofio mateofio 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

@mateofio mateofio force-pushed the array branch 3 times, most recently from 6f36e38 to 8871856 Compare August 19, 2020 08:02
@mateofio mateofio 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