Skip to content

Conversation

@dengr1065
Copy link
Collaborator

@dengr1065 dengr1065 commented Apr 18, 2025

Needs some testing. The compression and decompression is definitely faster, but I'm not so sure about the UI performance - feels laggier? Perhaps that's because I'm comparing vanilla CE to upstream with Component Eagle installed. While a much bigger chunk of data is transferred through IPC now, it does not use an intermediate format - all slowdowns in this area have existed before with JSON.stringify and lz-string.

Storage separation is partially done, the framework for adding mod-specific storages is there. Singular fs-job handler was reworked into small components, helper fs-job types were added to facilitate import and export of savegame and other files.

Closes #66.

Preparation for further changes. Savegames that are not compressed are
much bigger, but this is a rather complex algorithm that shouldn't
exist.
Make it slightly easier to replace the storage interface used for
app_settings.bin and savegames.bin in case it's ever needed. Savegames
always use app.storage for now, but this should be easier to change as
well.
Keep track of the storage ID in each renderer Storage instance and pass
it to the IPC bridge. Jobs are dispatched to the relevant handler (only
saves/ for now) and all (de)compression is handled there.

Add dedicated fs-job types to read or write and (de)compress data
from/to the file picked by the user. Remove redundant utility functions
that used web APIs instead.
Remove the CRC dependency and "binary file salt" in globalConfig.
@dengr1065 dengr1065 added the performance An improvement in performance is desired label Apr 18, 2025
@dengr1065
Copy link
Collaborator Author

Merging this for better exposure. This is definitely a step in the right direction, issues can be solved if any are found.

@dengr1065 dengr1065 merged commit 2b89046 into master May 2, 2025
1 check passed
@dengr1065 dengr1065 deleted the dengr1065/new-savegame-storage branch May 2, 2025 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance An improvement in performance is desired

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Savegame storage refactor

2 participants