-
Notifications
You must be signed in to change notification settings - Fork 206
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
Refactor write method in WalManager to improve performance #162
Comments
Thanks for writing this up. Here are some thoughts: WAL backend like So the trade offs are: (a) accept the dynamic dispatch overhead and achieve lazy materialization or (b) remove dynamic dispatch and do encode work in advance. At a glance both are all not large consumption. But I cannot figure out which is more efficient if I have to rank them. Maybe we need a benchmark to help us to made decision. Personally I prefer the second approach (also the way you proposed). It looks more neat to me 👀 |
Yes, aggree. Let me try to add a benchmark first. |
Provided a high throughout reducing some extra copies may make a difference to the performance. However, let the benchmark decide. Thanks @ygf11 . |
It seems the two |
Sure. It seems the |
Description
After #159, we pass
dyn Payload
to write method ofWalManager
, this may has performance issue.It is better to decouple encoder from write method.
Proposal
We can define
WalEncoder
(maybe other name), like:Encoder
can get fromwalManager
.So we need encode data before write to
WalManager
.Additional context
cc: @waynexia @ShiKaiWi
The text was updated successfully, but these errors were encountered: