Convert memtable rotation to a channel message #78
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
performance
Currently the memtable rotation happens in the write hot path when the memtable size threshold is reached https://github.com/fjall-rs/fjall/blob/main/src/partition/mod.rs#L748-L749.
The performance hit mostly comes from the journal rotation which needs to fsync to disk.
It would be better for performance to send a message via channel, announcing that the partition needs to be flushed, nullifying rotation costs inside the write hot path, which should give quite a performance boost for write heavy applications (currently it is slightly slower than Rocks).
The messages should be picked up by a worker that rotates the partition asynchronously, essentially performing the
Partition::rotate_memtable
(https://github.com/fjall-rs/fjall/blob/main/src/partition/mod.rs#L633) function.The text was updated successfully, but these errors were encountered: