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

Restructure the chunk meshes to reduce memory usage #1188

Closed
IntegratedQuantum opened this issue Mar 9, 2025 · 0 comments
Closed

Restructure the chunk meshes to reduce memory usage #1188

IntegratedQuantum opened this issue Mar 9, 2025 · 0 comments
Labels
optimization a performance problem that should be addressed or an optimization idea refactor shuffle a lot of code around

Comments

@IntegratedQuantum
Copy link
Member

FaceData currently makes up ~30% of the total memory usage (at render distance 24)

This is really not necessary. The face data is stored twice: Once in a large array, and once in multiple arraylists for types/neighbors/lod neighbors.
I think the optimal behavior would be to only keep these arraylists locally on the stack when creating the mesh. Then they should be merged/added into the big list right away, instead of collecting them in bulk at the end. This will require some more copying, but I think overall it should be better than keeping so many lists of duplicate data.

@IntegratedQuantum IntegratedQuantum added optimization a performance problem that should be addressed or an optimization idea refactor shuffle a lot of code around labels Mar 9, 2025
@IntegratedQuantum IntegratedQuantum added this to the Short-Term Goals milestone Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization a performance problem that should be addressed or an optimization idea refactor shuffle a lot of code around
Projects
None yet
Development

No branches or pull requests

1 participant