Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Option to disable level json caching mechanism#1176

Open
parvit wants to merge 1 commit intodeepnight:master from
parvit:fix-1172
Open

Option to disable level json caching mechanism #1176
parvit wants to merge 1 commit intodeepnight:master from
parvit:fix-1172

Conversation

@parvit
Copy link

@parvit parvit commented Jul 18, 2025

This PR fixes #1172.

When loading projects which are bigger than usual (~40 levels) the level json caching mechanism allocates a lot of memory and requires more than 4GB of memory, which blocks the editor.

The PR adds a new global ui option levelJsonCacheActive with default value true, that allows create/load these big projects by disabling the caching mechanism.

Included in the change also the UI change to handle the option in line with similar options in the UI already present.

Please review and send feedback.

MikeECunningham reacted with thumbs up emoji
Copy link
Owner

The big drawback with caching being disabled is that all save operations will require to rebuild JSON for each level even if it didn't really change. Maybe there's a better way to achieve good saving speed without caching 🤔

I will have a look to this when I will get back to ldtk.

parvit reacted with thumbs up emoji

@deepnight deepnight self-assigned this Jul 24, 2025
Copy link
Author

parvit commented Jul 24, 2025
edited
Loading

The big drawback with caching being disabled is that all save operations will require to rebuild JSON for each level even if it didn't really change. Maybe there's a better way to achieve good saving speed without caching 🤔

I will have a look to this when I will get back to ldtk.

Of course, let me know if you have a different approach in mind and i'll investigate it.

EDIT: I just thought of something, maybe keeping an internal level boolean that indicates if the level has changed and copy the json from the original file on save might be a better solution?

Copy link
Author

parvit commented Aug 5, 2025

I've just sent a different PR which i think might have a better approach without disabling the cache, #1185 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Any way to support >4GB RAM allocations or save/load with a smaller mem footprint?

2 participants

Comments

AltStyle によって変換されたページ (->オリジナル) /