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

Make uniform submaps Copy On Write #29674

Closed
kevingranade opened this issue Apr 18, 2019 · 1 comment
Closed

Make uniform submaps Copy On Write #29674

kevingranade opened this issue Apr 18, 2019 · 1 comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Character / World Generation Issues and enhancements concerning stages of creating a character or a world Code: Performance Performance boosting code (CPU, memory, etc.) Map / Mapgen Overmap, Mapgen, Map extras, Map display (P5 - Long-term) Long-term WIP, may stay on the list for a while.

Comments

@kevingranade
Copy link
Member

Is your feature request related to a problem? Please describe.
We waste a non-trivial amount of memory because "uniform" submaps each contain a copy of the submap data, even though it's totally redundant.

Describe the solution you'd like
Establish a cache of immutable uniform submaps.
When a uniform submap is generated, check for a match in the cache, if present just use that pointer, if not, insert a copy of the submap and capture the pointer.
If a uniform submap is written to, replace it with a copy of the uniform submap before writing to it.

@kevingranade kevingranade added Code: Performance Performance boosting code (CPU, memory, etc.) Map / Mapgen Overmap, Mapgen, Map extras, Map display [C++] Changes (can be) made in C++. Previously named `Code` Character / World Generation Issues and enhancements concerning stages of creating a character or a world labels Apr 18, 2019
@ZhilkinSerg ZhilkinSerg added the (P5 - Long-term) Long-term WIP, may stay on the list for a while. label Sep 18, 2019
@Maleclypse
Copy link
Member

Closed by #63762

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Character / World Generation Issues and enhancements concerning stages of creating a character or a world Code: Performance Performance boosting code (CPU, memory, etc.) Map / Mapgen Overmap, Mapgen, Map extras, Map display (P5 - Long-term) Long-term WIP, may stay on the list for a while.
Projects
None yet
Development

No branches or pull requests

3 participants