-
Notifications
You must be signed in to change notification settings - Fork 60
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
liblcf is reading the whole RPG_RT.ldb twice on init #169
Comments
Could be combined with a reader_struct refactor ;) |
Lazy reading incurs a branch on every read because you always have to check if it's loaded or not. Most things in the database are used frequently enough you'd want them in main memory all the time. One way we could speed up load times is by tricking the user. When starting up Player, we could load only the bare minimum required the operate the title screen and load menu. Then, while the user is on the title screen, we continue loading the rest of the database (and maybe the maps of his saves in order of most recent save) in a background thread. By the time the user picks new game or loads, a lot of, if not all of the lcf reading is done. |
Since 0.6.2, games load even faster than RPG_RT. Maybe this issue can be closed. |
Reading everything twice is still pretty bad and fixing this could speed up significantly more. For large games like Heroes Realm and HH3, the in memory LDB is the biggest memory hog of the entire engine. Maybe it's possible to do something which only loads enough partial string data to figure out encoding and exits. I'd like to leave this open until address the double load issue. |
this will be solved when Saves use DBString, before we can't get rid of the Encode functions in the parsing code. |
Some games have large database files and it can be slow parsing it completely.
Furthermore, the file is parsed twice: first to get some strings to detect the encoding with ICU, and then parsed again with the detected encoding.
For a proof of concept, try the Hero's Realm HTML5 version:
https://easy-rpg.org/play/master/?game=heros_realm
It should allow to do selective parsing of data instead of eager loading.
The text was updated successfully, but these errors were encountered: