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

Rewritten the Java region class #186

Merged
merged 9 commits into from
Sep 5, 2022
Merged

Rewritten the Java region class #186

merged 9 commits into from
Sep 5, 2022

Conversation

gentlegiantJGC
Copy link
Member

The main aim of this refactor is to reduce the amount of data that is held in memory.

The previous implementation loaded and wrote the whole region file meaning all the data had to be in memory.
The new implementation removes the buffer and directly reads and writes to the file on disk removing any need for a buffer of the data.
A second class has been implemented extending the first with a buffer to emulate the old behaviour. This is only temporary to keep backwards compatibility and will be depreciated and removed in the future.
Ideally where possible the format wrappers should just be a view into the real data and should not implement any form of buffering.

The main aim of this refactor is to reduce the amount of data that is held in memory.

The previous implementation loaded and wrote the whole region file meaning all the data had to be in memory.
The new implementation removes the buffer and directly reads and writes to the file on disk removing any need for a buffer of the data.
A second class has been implemented extending the first with a buffer to emulate the old behaviour. This is only temporary to keep backwards compatibility and will be depreciated and removed in the future.
Ideally where possible the format wrappers should just be a view into the real data and should not implement any form of buffering.
This short circuit could probably cause some issues so I am removing it.
The data needed parsing first
@Podshot Podshot self-requested a review August 13, 2022 10:53
Switched to the new region class that does not cache chunk data.
Refactored the region manager class to create region classes only when required rather than parsing all at the start.
Removed save and close methods because they no longer do anything.
@gentlegiantJGC gentlegiantJGC marked this pull request as ready for review August 13, 2022 12:28
@gentlegiantJGC gentlegiantJGC merged commit c06989b into master Sep 5, 2022
@gentlegiantJGC gentlegiantJGC deleted the improv-region branch September 5, 2022 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant