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

Add buffer configurations to readers and writers #40

Merged
merged 24 commits into from
Jan 2, 2025

Conversation

sebheitzmann
Copy link
Contributor

No description provided.

@sebheitzmann sebheitzmann marked this pull request as draft December 14, 2024 16:29
@@ -50,6 +51,7 @@ func executeFlush(db *DB, flushAction memStoreFlushAction) error {
err = memStoreToFlush.FlushWithTombstones(
sstables.WriteBasePath(writePath),
sstables.WithKeyComparator(db.cmp),
sstables.WriteBufferSizeBytes(16*1024),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think that it's enough no ? Should make some benchmark. But 4Mb for each flush is for my case a huge waste.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feel free to make it configurable as well, but 16k is absolutely fine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we should have a global config in the simpledb struct. I will do that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. Two options, one for reading, one for writing.

@sebheitzmann sebheitzmann marked this pull request as ready for review January 1, 2025 20:57
@sebheitzmann
Copy link
Contributor Author

Could you review this PR please ?

@thomasjungblut
Copy link
Owner

Sure, will get back to you by EoD :)

Comment on lines +192 to +196
func TestReaderInitNoPath(t *testing.T) {
_, err := NewFileReader()
assert.Equal(t, errors.New("NewFileReader: either os.File or string path must be supplied, never both"), err)
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry to be pedantic 🤣 but can you add another where to supply both?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@thomasjungblut
Copy link
Owner

one little test missing, can you squash your commits with a meaningful commit message as well?

@sebheitzmann
Copy link
Contributor Author

I've squashed my commit since the last merge. I thinks that's good now.

@thomasjungblut thomasjungblut changed the title Work on memory usage. Add some configurations Add buffer configurations to readers and writers Jan 2, 2025
@thomasjungblut thomasjungblut merged commit b06d88e into thomasjungblut:main Jan 2, 2025
4 checks passed
@thomasjungblut
Copy link
Owner

it is, thank you!

@sebheitzmann
Copy link
Contributor Author

could you please tag a new version ?

@thomasjungblut
Copy link
Owner

yep, will do in the evening.

@thomasjungblut
Copy link
Owner

@sebheitzmann done!

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.

2 participants