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

Set the minimum buffer size in Group::write() to be equal to the page size #7492

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### Enhancements
* <New feature description> (PR [#????](https://github.com/realm/realm-core/pull/????))
* None.
* Improve file compaction performance on platforms with page sizes greater than 4k (for example arm64 Apple platforms) for files less than 256 pages in size ([PR #7492](https://github.com/realm/realm-core/pull/7492)).

### Fixed
* <How do the end-user experience this issue? what was the impact?> ([#????](https://github.com/realm/realm-core/issues/????), since v?.?.?)
Expand Down
2 changes: 1 addition & 1 deletion src/realm/group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ void Group::write(File& file, const char* encryption_key, uint_fast64_t version_
// The aim is that the buffer size should be at least 1/256 of needed size but less than 64 Mb
constexpr size_t upper_bound = 64 * 1024 * 1024;
size_t min_space = std::min(get_used_space() >> 8, upper_bound);
size_t buffer_size = 4096;
size_t buffer_size = page_size();
while (buffer_size < min_space) {
buffer_size <<= 1;
}
Expand Down
Loading