-
Notifications
You must be signed in to change notification settings - Fork 306
perf: Optimize diff algorithm with insights from #646 #658
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
Conversation
What do you think about this change, @tac0turtle @cool-develope , the existing round-trip test is pretty exhaustive, and I've done complete run on our testnet data, so the correctness should be pretty solid. |
diff.go
Outdated
newLeafNodes []*Node | ||
// orphaned leaf nodes in previous version, which represents all deletions and updates. | ||
// both `newLeafNodes` and `orphanedLeafNodes` are ordered by key. | ||
orphanedLeafNodes []*Node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for me, newLeaves
makes sense than newLeafNodes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good, done.
I am still worried about the memory usage if we use |
I'll see what I can do. |
done, it's still not strictly constant memory, but I guess it's the best we can do here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
can we backport to 0.19.x @tac0turtle |
@Mergifyio backport release/v0.19.x |
✅ Backports have been created
|
…osmos#658) (cosmos#665) Co-authored-by: yihuang <huang@crypto.com>
it's being running on our testnet,
not finished yet, but so far so good, the result is identical to previous version.EDIT: the task previously takes 19hours to run, now takes 14h20m, not bad.