-
-
Notifications
You must be signed in to change notification settings - Fork 145
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
Fix miscalculation of tree size in concurrent editing #891
Conversation
Warning Review failedThe pull request is closed. WalkthroughThe recent changes address tree structure and size consistency in the Changes
Sequence Diagram(s) (Beta)No sequence diagrams provided as the changes are primarily logical simplifications and enhancements. Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #891 +/- ##
==========================================
- Coverage 50.67% 50.64% -0.03%
==========================================
Files 70 70
Lines 10471 10466 -5
==========================================
- Hits 5306 5301 -5
+ Misses 4638 4637 -1
- Partials 527 528 +1 ☔ View full report in Codecov by Sentry. |
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.
Actionable comments posted: 1
Outside diff range and nitpick comments (1)
test/integration/tree_test.go (1)
3506-3638
: The added test cases effectively cover tree consistency and size calculations during concurrent editing.Consider adding more descriptive comments within the test cases to enhance readability and maintainability.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- pkg/document/crdt/tree.go (1 hunks)
- pkg/document/internal_document.go (2 hunks)
- pkg/index/tree.go (2 hunks)
- test/integration/tree_test.go (2 hunks)
Additional comments not posted (4)
pkg/index/tree.go (2)
339-341
: Correctly handles tombstoned ancestor nodes.The addition of a check to halt updates when encountering a removed parent node correctly addresses the issue of incorrect size updates in the presence of tombstoned ancestors.
352-355
: Properly skips removed child nodes during size updates.The modification to skip processing of removed child nodes during descendant size updates is a necessary improvement to ensure accurate size calculations.
pkg/document/crdt/tree.go (1)
376-376
: Simplified removal logic by directly updating ancestor sizes.Ensure that comprehensive tests cover this change, particularly for concurrent modifications scenarios.
test/integration/tree_test.go (1)
23-24
: Imports forconverter
andcrdt
packages are correctly added for new test functionalities.
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.
Go Benchmark
Benchmark suite | Current: 7e25f90 | Previous: 1055529 | Ratio |
---|---|---|---|
BenchmarkDocument/constructor_test |
1493 ns/op 1337 B/op 24 allocs/op |
1510 ns/op 1337 B/op 24 allocs/op |
0.99 |
BenchmarkDocument/constructor_test - ns/op |
1493 ns/op |
1510 ns/op |
0.99 |
BenchmarkDocument/constructor_test - B/op |
1337 B/op |
1337 B/op |
1 |
BenchmarkDocument/constructor_test - allocs/op |
24 allocs/op |
24 allocs/op |
1 |
BenchmarkDocument/status_test |
941.3 ns/op 1305 B/op 22 allocs/op |
953.2 ns/op 1305 B/op 22 allocs/op |
0.99 |
BenchmarkDocument/status_test - ns/op |
941.3 ns/op |
953.2 ns/op |
0.99 |
BenchmarkDocument/status_test - B/op |
1305 B/op |
1305 B/op |
1 |
BenchmarkDocument/status_test - allocs/op |
22 allocs/op |
22 allocs/op |
1 |
BenchmarkDocument/equals_test |
7595 ns/op 7273 B/op 132 allocs/op |
7722 ns/op 7273 B/op 132 allocs/op |
0.98 |
BenchmarkDocument/equals_test - ns/op |
7595 ns/op |
7722 ns/op |
0.98 |
BenchmarkDocument/equals_test - B/op |
7273 B/op |
7273 B/op |
1 |
BenchmarkDocument/equals_test - allocs/op |
132 allocs/op |
132 allocs/op |
1 |
BenchmarkDocument/nested_update_test |
16867 ns/op 12138 B/op 262 allocs/op |
17046 ns/op 12138 B/op 262 allocs/op |
0.99 |
BenchmarkDocument/nested_update_test - ns/op |
16867 ns/op |
17046 ns/op |
0.99 |
BenchmarkDocument/nested_update_test - B/op |
12138 B/op |
12138 B/op |
1 |
BenchmarkDocument/nested_update_test - allocs/op |
262 allocs/op |
262 allocs/op |
1 |
BenchmarkDocument/delete_test |
22524 ns/op 15364 B/op 341 allocs/op |
22731 ns/op 15363 B/op 341 allocs/op |
0.99 |
BenchmarkDocument/delete_test - ns/op |
22524 ns/op |
22731 ns/op |
0.99 |
BenchmarkDocument/delete_test - B/op |
15364 B/op |
15363 B/op |
1.00 |
BenchmarkDocument/delete_test - allocs/op |
341 allocs/op |
341 allocs/op |
1 |
BenchmarkDocument/object_test |
9072 ns/op 6817 B/op 120 allocs/op |
9759 ns/op 6817 B/op 120 allocs/op |
0.93 |
BenchmarkDocument/object_test - ns/op |
9072 ns/op |
9759 ns/op |
0.93 |
BenchmarkDocument/object_test - B/op |
6817 B/op |
6817 B/op |
1 |
BenchmarkDocument/object_test - allocs/op |
120 allocs/op |
120 allocs/op |
1 |
BenchmarkDocument/array_test |
29274 ns/op 11947 B/op 276 allocs/op |
29763 ns/op 11947 B/op 276 allocs/op |
0.98 |
BenchmarkDocument/array_test - ns/op |
29274 ns/op |
29763 ns/op |
0.98 |
BenchmarkDocument/array_test - B/op |
11947 B/op |
11947 B/op |
1 |
BenchmarkDocument/array_test - allocs/op |
276 allocs/op |
276 allocs/op |
1 |
BenchmarkDocument/text_test |
30482 ns/op 14716 B/op 469 allocs/op |
31715 ns/op 14715 B/op 469 allocs/op |
0.96 |
BenchmarkDocument/text_test - ns/op |
30482 ns/op |
31715 ns/op |
0.96 |
BenchmarkDocument/text_test - B/op |
14716 B/op |
14715 B/op |
1.00 |
BenchmarkDocument/text_test - allocs/op |
469 allocs/op |
469 allocs/op |
1 |
BenchmarkDocument/text_composition_test |
28909 ns/op 18420 B/op 484 allocs/op |
29628 ns/op 18422 B/op 484 allocs/op |
0.98 |
BenchmarkDocument/text_composition_test - ns/op |
28909 ns/op |
29628 ns/op |
0.98 |
BenchmarkDocument/text_composition_test - B/op |
18420 B/op |
18422 B/op |
1.00 |
BenchmarkDocument/text_composition_test - allocs/op |
484 allocs/op |
484 allocs/op |
1 |
BenchmarkDocument/rich_text_test |
80252 ns/op 38477 B/op 1148 allocs/op |
81877 ns/op 38476 B/op 1148 allocs/op |
0.98 |
BenchmarkDocument/rich_text_test - ns/op |
80252 ns/op |
81877 ns/op |
0.98 |
BenchmarkDocument/rich_text_test - B/op |
38477 B/op |
38476 B/op |
1.00 |
BenchmarkDocument/rich_text_test - allocs/op |
1148 allocs/op |
1148 allocs/op |
1 |
BenchmarkDocument/counter_test |
17374 ns/op 10722 B/op 244 allocs/op |
17562 ns/op 10722 B/op 244 allocs/op |
0.99 |
BenchmarkDocument/counter_test - ns/op |
17374 ns/op |
17562 ns/op |
0.99 |
BenchmarkDocument/counter_test - B/op |
10722 B/op |
10722 B/op |
1 |
BenchmarkDocument/counter_test - allocs/op |
244 allocs/op |
244 allocs/op |
1 |
BenchmarkDocument/text_edit_gc_100 |
1171511 ns/op 870807 B/op 16689 allocs/op |
1191213 ns/op 870783 B/op 16689 allocs/op |
0.98 |
BenchmarkDocument/text_edit_gc_100 - ns/op |
1171511 ns/op |
1191213 ns/op |
0.98 |
BenchmarkDocument/text_edit_gc_100 - B/op |
870807 B/op |
870783 B/op |
1.00 |
BenchmarkDocument/text_edit_gc_100 - allocs/op |
16689 allocs/op |
16689 allocs/op |
1 |
BenchmarkDocument/text_edit_gc_1000 |
49070629 ns/op 50536364 B/op 181605 allocs/op |
50438571 ns/op 50536547 B/op 181606 allocs/op |
0.97 |
BenchmarkDocument/text_edit_gc_1000 - ns/op |
49070629 ns/op |
50438571 ns/op |
0.97 |
BenchmarkDocument/text_edit_gc_1000 - B/op |
50536364 B/op |
50536547 B/op |
1.00 |
BenchmarkDocument/text_edit_gc_1000 - allocs/op |
181605 allocs/op |
181606 allocs/op |
1.00 |
BenchmarkDocument/text_split_gc_100 |
1784447 ns/op 1528680 B/op 15541 allocs/op |
1814121 ns/op 1528723 B/op 15541 allocs/op |
0.98 |
BenchmarkDocument/text_split_gc_100 - ns/op |
1784447 ns/op |
1814121 ns/op |
0.98 |
BenchmarkDocument/text_split_gc_100 - B/op |
1528680 B/op |
1528723 B/op |
1.00 |
BenchmarkDocument/text_split_gc_100 - allocs/op |
15541 allocs/op |
15541 allocs/op |
1 |
BenchmarkDocument/text_split_gc_1000 |
114045352 ns/op 135077545 B/op 182089 allocs/op |
115662204 ns/op 135078210 B/op 182093 allocs/op |
0.99 |
BenchmarkDocument/text_split_gc_1000 - ns/op |
114045352 ns/op |
115662204 ns/op |
0.99 |
BenchmarkDocument/text_split_gc_1000 - B/op |
135077545 B/op |
135078210 B/op |
1.00 |
BenchmarkDocument/text_split_gc_1000 - allocs/op |
182089 allocs/op |
182093 allocs/op |
1.00 |
BenchmarkDocument/text_delete_all_10000 |
16221627 ns/op 10182234 B/op 40673 allocs/op |
17143569 ns/op 10185389 B/op 40673 allocs/op |
0.95 |
BenchmarkDocument/text_delete_all_10000 - ns/op |
16221627 ns/op |
17143569 ns/op |
0.95 |
BenchmarkDocument/text_delete_all_10000 - B/op |
10182234 B/op |
10185389 B/op |
1.00 |
BenchmarkDocument/text_delete_all_10000 - allocs/op |
40673 allocs/op |
40673 allocs/op |
1 |
BenchmarkDocument/text_delete_all_100000 |
306752143 ns/op 142694612 B/op 411740 allocs/op |
349440424 ns/op 142677269 B/op 411749 allocs/op |
0.88 |
BenchmarkDocument/text_delete_all_100000 - ns/op |
306752143 ns/op |
349440424 ns/op |
0.88 |
BenchmarkDocument/text_delete_all_100000 - B/op |
142694612 B/op |
142677269 B/op |
1.00 |
BenchmarkDocument/text_delete_all_100000 - allocs/op |
411740 allocs/op |
411749 allocs/op |
1.00 |
BenchmarkDocument/text_100 |
220287 ns/op 120037 B/op 5081 allocs/op |
218575 ns/op 120037 B/op 5081 allocs/op |
1.01 |
BenchmarkDocument/text_100 - ns/op |
220287 ns/op |
218575 ns/op |
1.01 |
BenchmarkDocument/text_100 - B/op |
120037 B/op |
120037 B/op |
1 |
BenchmarkDocument/text_100 - allocs/op |
5081 allocs/op |
5081 allocs/op |
1 |
BenchmarkDocument/text_1000 |
2376165 ns/op 1169039 B/op 50085 allocs/op |
2369337 ns/op 1169022 B/op 50085 allocs/op |
1.00 |
BenchmarkDocument/text_1000 - ns/op |
2376165 ns/op |
2369337 ns/op |
1.00 |
BenchmarkDocument/text_1000 - B/op |
1169039 B/op |
1169022 B/op |
1.00 |
BenchmarkDocument/text_1000 - allocs/op |
50085 allocs/op |
50085 allocs/op |
1 |
BenchmarkDocument/array_1000 |
1263722 ns/op 1091375 B/op 11831 allocs/op |
1230361 ns/op 1091278 B/op 11831 allocs/op |
1.03 |
BenchmarkDocument/array_1000 - ns/op |
1263722 ns/op |
1230361 ns/op |
1.03 |
BenchmarkDocument/array_1000 - B/op |
1091375 B/op |
1091278 B/op |
1.00 |
BenchmarkDocument/array_1000 - allocs/op |
11831 allocs/op |
11831 allocs/op |
1 |
BenchmarkDocument/array_10000 |
13631788 ns/op 9799877 B/op 120296 allocs/op |
13851213 ns/op 9798881 B/op 120292 allocs/op |
0.98 |
BenchmarkDocument/array_10000 - ns/op |
13631788 ns/op |
13851213 ns/op |
0.98 |
BenchmarkDocument/array_10000 - B/op |
9799877 B/op |
9798881 B/op |
1.00 |
BenchmarkDocument/array_10000 - allocs/op |
120296 allocs/op |
120292 allocs/op |
1.00 |
BenchmarkDocument/array_gc_100 |
155201 ns/op 132710 B/op 1260 allocs/op |
148513 ns/op 132703 B/op 1260 allocs/op |
1.05 |
BenchmarkDocument/array_gc_100 - ns/op |
155201 ns/op |
148513 ns/op |
1.05 |
BenchmarkDocument/array_gc_100 - B/op |
132710 B/op |
132703 B/op |
1.00 |
BenchmarkDocument/array_gc_100 - allocs/op |
1260 allocs/op |
1260 allocs/op |
1 |
BenchmarkDocument/array_gc_1000 |
1447973 ns/op 1159270 B/op 12877 allocs/op |
1432595 ns/op 1159117 B/op 12876 allocs/op |
1.01 |
BenchmarkDocument/array_gc_1000 - ns/op |
1447973 ns/op |
1432595 ns/op |
1.01 |
BenchmarkDocument/array_gc_1000 - B/op |
1159270 B/op |
1159117 B/op |
1.00 |
BenchmarkDocument/array_gc_1000 - allocs/op |
12877 allocs/op |
12876 allocs/op |
1.00 |
BenchmarkDocument/counter_1000 |
213555 ns/op 193080 B/op 5771 allocs/op |
207486 ns/op 193080 B/op 5771 allocs/op |
1.03 |
BenchmarkDocument/counter_1000 - ns/op |
213555 ns/op |
207486 ns/op |
1.03 |
BenchmarkDocument/counter_1000 - B/op |
193080 B/op |
193080 B/op |
1 |
BenchmarkDocument/counter_1000 - allocs/op |
5771 allocs/op |
5771 allocs/op |
1 |
BenchmarkDocument/counter_10000 |
2248243 ns/op 2087996 B/op 59778 allocs/op |
2264628 ns/op 2088013 B/op 59778 allocs/op |
0.99 |
BenchmarkDocument/counter_10000 - ns/op |
2248243 ns/op |
2264628 ns/op |
0.99 |
BenchmarkDocument/counter_10000 - B/op |
2087996 B/op |
2088013 B/op |
1.00 |
BenchmarkDocument/counter_10000 - allocs/op |
59778 allocs/op |
59778 allocs/op |
1 |
BenchmarkDocument/object_1000 |
1392131 ns/op 1428027 B/op 9848 allocs/op |
1395438 ns/op 1427815 B/op 9848 allocs/op |
1.00 |
BenchmarkDocument/object_1000 - ns/op |
1392131 ns/op |
1395438 ns/op |
1.00 |
BenchmarkDocument/object_1000 - B/op |
1428027 B/op |
1427815 B/op |
1.00 |
BenchmarkDocument/object_1000 - allocs/op |
9848 allocs/op |
9848 allocs/op |
1 |
BenchmarkDocument/object_10000 |
15157860 ns/op 12166557 B/op 100565 allocs/op |
15827308 ns/op 12166161 B/op 100562 allocs/op |
0.96 |
BenchmarkDocument/object_10000 - ns/op |
15157860 ns/op |
15827308 ns/op |
0.96 |
BenchmarkDocument/object_10000 - B/op |
12166557 B/op |
12166161 B/op |
1.00 |
BenchmarkDocument/object_10000 - allocs/op |
100565 allocs/op |
100562 allocs/op |
1.00 |
BenchmarkDocument/tree_100 |
1058205 ns/op 943703 B/op 6101 allocs/op |
1061273 ns/op 943702 B/op 6101 allocs/op |
1.00 |
BenchmarkDocument/tree_100 - ns/op |
1058205 ns/op |
1061273 ns/op |
1.00 |
BenchmarkDocument/tree_100 - B/op |
943703 B/op |
943702 B/op |
1.00 |
BenchmarkDocument/tree_100 - allocs/op |
6101 allocs/op |
6101 allocs/op |
1 |
BenchmarkDocument/tree_1000 |
77582454 ns/op 86460488 B/op 60115 allocs/op |
78021724 ns/op 86460448 B/op 60115 allocs/op |
0.99 |
BenchmarkDocument/tree_1000 - ns/op |
77582454 ns/op |
78021724 ns/op |
0.99 |
BenchmarkDocument/tree_1000 - B/op |
86460488 B/op |
86460448 B/op |
1.00 |
BenchmarkDocument/tree_1000 - allocs/op |
60115 allocs/op |
60115 allocs/op |
1 |
BenchmarkDocument/tree_10000 |
9676958884 ns/op 8580983280 B/op 600242 allocs/op |
10054988348 ns/op 8580652288 B/op 600214 allocs/op |
0.96 |
BenchmarkDocument/tree_10000 - ns/op |
9676958884 ns/op |
10054988348 ns/op |
0.96 |
BenchmarkDocument/tree_10000 - B/op |
8580983280 B/op |
8580652288 B/op |
1.00 |
BenchmarkDocument/tree_10000 - allocs/op |
600242 allocs/op |
600214 allocs/op |
1.00 |
BenchmarkDocument/tree_delete_all_1000 |
77757051 ns/op 87509839 B/op 75264 allocs/op |
77709379 ns/op 87508666 B/op 75263 allocs/op |
1.00 |
BenchmarkDocument/tree_delete_all_1000 - ns/op |
77757051 ns/op |
77709379 ns/op |
1.00 |
BenchmarkDocument/tree_delete_all_1000 - B/op |
87509839 B/op |
87508666 B/op |
1.00 |
BenchmarkDocument/tree_delete_all_1000 - allocs/op |
75264 allocs/op |
75263 allocs/op |
1.00 |
BenchmarkDocument/tree_edit_gc_100 |
3835948 ns/op 4146740 B/op 15140 allocs/op |
3932707 ns/op 4147705 B/op 15140 allocs/op |
0.98 |
BenchmarkDocument/tree_edit_gc_100 - ns/op |
3835948 ns/op |
3932707 ns/op |
0.98 |
BenchmarkDocument/tree_edit_gc_100 - B/op |
4146740 B/op |
4147705 B/op |
1.00 |
BenchmarkDocument/tree_edit_gc_100 - allocs/op |
15140 allocs/op |
15140 allocs/op |
1 |
BenchmarkDocument/tree_edit_gc_1000 |
310164196 ns/op 383746094 B/op 154853 allocs/op |
314776900 ns/op 383744912 B/op 154848 allocs/op |
0.99 |
BenchmarkDocument/tree_edit_gc_1000 - ns/op |
310164196 ns/op |
314776900 ns/op |
0.99 |
BenchmarkDocument/tree_edit_gc_1000 - B/op |
383746094 B/op |
383744912 B/op |
1.00 |
BenchmarkDocument/tree_edit_gc_1000 - allocs/op |
154853 allocs/op |
154848 allocs/op |
1.00 |
BenchmarkDocument/tree_split_gc_100 |
2676199 ns/op 2412610 B/op 11125 allocs/op |
2582172 ns/op 2412548 B/op 11125 allocs/op |
1.04 |
BenchmarkDocument/tree_split_gc_100 - ns/op |
2676199 ns/op |
2582172 ns/op |
1.04 |
BenchmarkDocument/tree_split_gc_100 - B/op |
2412610 B/op |
2412548 B/op |
1.00 |
BenchmarkDocument/tree_split_gc_100 - allocs/op |
11125 allocs/op |
11125 allocs/op |
1 |
BenchmarkDocument/tree_split_gc_1000 |
188143218 ns/op 222252624 B/op 121996 allocs/op |
188334420 ns/op 222251361 B/op 121990 allocs/op |
1.00 |
BenchmarkDocument/tree_split_gc_1000 - ns/op |
188143218 ns/op |
188334420 ns/op |
1.00 |
BenchmarkDocument/tree_split_gc_1000 - B/op |
222252624 B/op |
222251361 B/op |
1.00 |
BenchmarkDocument/tree_split_gc_1000 - allocs/op |
121996 allocs/op |
121990 allocs/op |
1.00 |
BenchmarkRPC/client_to_server |
388427525 ns/op 16843314 B/op 174482 allocs/op |
386144724 ns/op 17640490 B/op 174503 allocs/op |
1.01 |
BenchmarkRPC/client_to_server - ns/op |
388427525 ns/op |
386144724 ns/op |
1.01 |
BenchmarkRPC/client_to_server - B/op |
16843314 B/op |
17640490 B/op |
0.95 |
BenchmarkRPC/client_to_server - allocs/op |
174482 allocs/op |
174503 allocs/op |
1.00 |
BenchmarkRPC/client_to_client_via_server |
639699616 ns/op 33995684 B/op 319251 allocs/op |
651864638 ns/op 33561352 B/op 319265 allocs/op |
0.98 |
BenchmarkRPC/client_to_client_via_server - ns/op |
639699616 ns/op |
651864638 ns/op |
0.98 |
BenchmarkRPC/client_to_client_via_server - B/op |
33995684 B/op |
33561352 B/op |
1.01 |
BenchmarkRPC/client_to_client_via_server - allocs/op |
319251 allocs/op |
319265 allocs/op |
1.00 |
BenchmarkRPC/attach_large_document |
1232312419 ns/op 1907790152 B/op 8966 allocs/op |
1277115561 ns/op 1919849168 B/op 8868 allocs/op |
0.96 |
BenchmarkRPC/attach_large_document - ns/op |
1232312419 ns/op |
1277115561 ns/op |
0.96 |
BenchmarkRPC/attach_large_document - B/op |
1907790152 B/op |
1919849168 B/op |
0.99 |
BenchmarkRPC/attach_large_document - allocs/op |
8966 allocs/op |
8868 allocs/op |
1.01 |
BenchmarkRPC/adminCli_to_server |
552306663 ns/op 35948820 B/op 289523 allocs/op |
561541189 ns/op 35959432 B/op 289545 allocs/op |
0.98 |
BenchmarkRPC/adminCli_to_server - ns/op |
552306663 ns/op |
561541189 ns/op |
0.98 |
BenchmarkRPC/adminCli_to_server - B/op |
35948820 B/op |
35959432 B/op |
1.00 |
BenchmarkRPC/adminCli_to_server - allocs/op |
289523 allocs/op |
289545 allocs/op |
1.00 |
BenchmarkLocker |
63.66 ns/op 16 B/op 1 allocs/op |
63.22 ns/op 16 B/op 1 allocs/op |
1.01 |
BenchmarkLocker - ns/op |
63.66 ns/op |
63.22 ns/op |
1.01 |
BenchmarkLocker - B/op |
16 B/op |
16 B/op |
1 |
BenchmarkLocker - allocs/op |
1 allocs/op |
1 allocs/op |
1 |
BenchmarkLockerParallel |
38.92 ns/op 0 B/op 0 allocs/op |
84.79 ns/op 0 B/op 0 allocs/op |
0.46 |
BenchmarkLockerParallel - ns/op |
38.92 ns/op |
84.79 ns/op |
0.46 |
BenchmarkLockerParallel - B/op |
0 B/op |
0 B/op |
1 |
BenchmarkLockerParallel - allocs/op |
0 allocs/op |
0 allocs/op |
1 |
BenchmarkLockerMoreKeys |
143.4 ns/op 15 B/op 0 allocs/op |
145.6 ns/op 15 B/op 0 allocs/op |
0.98 |
BenchmarkLockerMoreKeys - ns/op |
143.4 ns/op |
145.6 ns/op |
0.98 |
BenchmarkLockerMoreKeys - B/op |
15 B/op |
15 B/op |
1 |
BenchmarkLockerMoreKeys - allocs/op |
0 allocs/op |
0 allocs/op |
1 |
BenchmarkChange/Push_10_Changes |
3950835 ns/op 121164 B/op 1284 allocs/op |
4110161 ns/op 120783 B/op 1284 allocs/op |
0.96 |
BenchmarkChange/Push_10_Changes - ns/op |
3950835 ns/op |
4110161 ns/op |
0.96 |
BenchmarkChange/Push_10_Changes - B/op |
121164 B/op |
120783 B/op |
1.00 |
BenchmarkChange/Push_10_Changes - allocs/op |
1284 allocs/op |
1284 allocs/op |
1 |
BenchmarkChange/Push_100_Changes |
14909205 ns/op 575693 B/op 6655 allocs/op |
15424477 ns/op 572198 B/op 6656 allocs/op |
0.97 |
BenchmarkChange/Push_100_Changes - ns/op |
14909205 ns/op |
15424477 ns/op |
0.97 |
BenchmarkChange/Push_100_Changes - B/op |
575693 B/op |
572198 B/op |
1.01 |
BenchmarkChange/Push_100_Changes - allocs/op |
6655 allocs/op |
6656 allocs/op |
1.00 |
BenchmarkChange/Push_1000_Changes |
119223809 ns/op 5272648 B/op 63151 allocs/op |
120766213 ns/op 5210112 B/op 63150 allocs/op |
0.99 |
BenchmarkChange/Push_1000_Changes - ns/op |
119223809 ns/op |
120766213 ns/op |
0.99 |
BenchmarkChange/Push_1000_Changes - B/op |
5272648 B/op |
5210112 B/op |
1.01 |
BenchmarkChange/Push_1000_Changes - allocs/op |
63151 allocs/op |
63150 allocs/op |
1.00 |
BenchmarkChange/Pull_10_Changes |
2944927 ns/op 100322 B/op 1004 allocs/op |
3015994 ns/op 99710 B/op 1005 allocs/op |
0.98 |
BenchmarkChange/Pull_10_Changes - ns/op |
2944927 ns/op |
3015994 ns/op |
0.98 |
BenchmarkChange/Pull_10_Changes - B/op |
100322 B/op |
99710 B/op |
1.01 |
BenchmarkChange/Pull_10_Changes - allocs/op |
1004 allocs/op |
1005 allocs/op |
1.00 |
BenchmarkChange/Pull_100_Changes |
4399370 ns/op 265137 B/op 3475 allocs/op |
4551116 ns/op 263611 B/op 3476 allocs/op |
0.97 |
BenchmarkChange/Pull_100_Changes - ns/op |
4399370 ns/op |
4551116 ns/op |
0.97 |
BenchmarkChange/Pull_100_Changes - B/op |
265137 B/op |
263611 B/op |
1.01 |
BenchmarkChange/Pull_100_Changes - allocs/op |
3475 allocs/op |
3476 allocs/op |
1.00 |
BenchmarkChange/Pull_1000_Changes |
8815734 ns/op 1493122 B/op 29853 allocs/op |
9172964 ns/op 1489697 B/op 29845 allocs/op |
0.96 |
BenchmarkChange/Pull_1000_Changes - ns/op |
8815734 ns/op |
9172964 ns/op |
0.96 |
BenchmarkChange/Pull_1000_Changes - B/op |
1493122 B/op |
1489697 B/op |
1.00 |
BenchmarkChange/Pull_1000_Changes - allocs/op |
29853 allocs/op |
29845 allocs/op |
1.00 |
BenchmarkSnapshot/Push_3KB_snapshot |
17425807 ns/op 711077 B/op 6658 allocs/op |
17737777 ns/op 718272 B/op 6656 allocs/op |
0.98 |
BenchmarkSnapshot/Push_3KB_snapshot - ns/op |
17425807 ns/op |
17737777 ns/op |
0.98 |
BenchmarkSnapshot/Push_3KB_snapshot - B/op |
711077 B/op |
718272 B/op |
0.99 |
BenchmarkSnapshot/Push_3KB_snapshot - allocs/op |
6658 allocs/op |
6656 allocs/op |
1.00 |
BenchmarkSnapshot/Push_30KB_snapshot |
122785357 ns/op 5561584 B/op 63149 allocs/op |
||
BenchmarkSnapshot/Push_30KB_snapshot - ns/op |
122785357 ns/op |
||
BenchmarkSnapshot/Push_30KB_snapshot - B/op |
5561584 B/op |
||
BenchmarkSnapshot/Push_30KB_snapshot - allocs/op |
63149 allocs/op |
||
BenchmarkSnapshot/Pull_3KB_snapshot |
6549277 ns/op 921230 B/op 15513 allocs/op |
||
BenchmarkSnapshot/Pull_3KB_snapshot - ns/op |
6549277 ns/op |
||
BenchmarkSnapshot/Pull_3KB_snapshot - B/op |
921230 B/op |
||
BenchmarkSnapshot/Pull_3KB_snapshot - allocs/op |
15513 allocs/op |
||
BenchmarkSnapshot/Pull_30KB_snapshot |
15138642 ns/op 7158315 B/op 150107 allocs/op |
||
BenchmarkSnapshot/Pull_30KB_snapshot - ns/op |
15138642 ns/op |
||
BenchmarkSnapshot/Pull_30KB_snapshot - B/op |
7158315 B/op |
||
BenchmarkSnapshot/Pull_30KB_snapshot - allocs/op |
150107 allocs/op |
||
BenchmarkSync/memory_sync_10_test |
6779 ns/op 1286 B/op 38 allocs/op |
8079 ns/op 1286 B/op 38 allocs/op |
0.84 |
BenchmarkSync/memory_sync_10_test - ns/op |
6779 ns/op |
8079 ns/op |
0.84 |
BenchmarkSync/memory_sync_10_test - B/op |
1286 B/op |
1286 B/op |
1 |
BenchmarkSync/memory_sync_10_test - allocs/op |
38 allocs/op |
38 allocs/op |
1 |
BenchmarkSync/memory_sync_100_test |
49929 ns/op 8665 B/op 274 allocs/op |
58944 ns/op 8975 B/op 294 allocs/op |
0.85 |
BenchmarkSync/memory_sync_100_test - ns/op |
49929 ns/op |
58944 ns/op |
0.85 |
BenchmarkSync/memory_sync_100_test - B/op |
8665 B/op |
8975 B/op |
0.97 |
BenchmarkSync/memory_sync_100_test - allocs/op |
274 allocs/op |
294 allocs/op |
0.93 |
BenchmarkSync/memory_sync_1000_test |
577840 ns/op 74549 B/op 2132 allocs/op |
485659 ns/op 80185 B/op 2486 allocs/op |
1.19 |
BenchmarkSync/memory_sync_1000_test - ns/op |
577840 ns/op |
485659 ns/op |
1.19 |
BenchmarkSync/memory_sync_1000_test - B/op |
74549 B/op |
80185 B/op |
0.93 |
BenchmarkSync/memory_sync_1000_test - allocs/op |
2132 allocs/op |
2486 allocs/op |
0.86 |
BenchmarkSync/memory_sync_10000_test |
7307918 ns/op 739300 B/op 20280 allocs/op |
7698290 ns/op 739643 B/op 20332 allocs/op |
0.95 |
BenchmarkSync/memory_sync_10000_test - ns/op |
7307918 ns/op |
7698290 ns/op |
0.95 |
BenchmarkSync/memory_sync_10000_test - B/op |
739300 B/op |
739643 B/op |
1.00 |
BenchmarkSync/memory_sync_10000_test - allocs/op |
20280 allocs/op |
20332 allocs/op |
1.00 |
BenchmarkTextEditing |
5059045427 ns/op 3901938264 B/op 18743525 allocs/op |
5444137642 ns/op 3901972848 B/op 18743614 allocs/op |
0.93 |
BenchmarkTextEditing - ns/op |
5059045427 ns/op |
5444137642 ns/op |
0.93 |
BenchmarkTextEditing - B/op |
3901938264 B/op |
3901972848 B/op |
1.00 |
BenchmarkTextEditing - allocs/op |
18743525 allocs/op |
18743614 allocs/op |
1.00 |
This comment was automatically generated by workflow using github-action-benchmark.
@raararaara Thanks for your contribution. |
What this PR does / why we need it?
Fix miscalculation of tree size in concurrent editing
This commit addresses the issue where the
updateAncestorsSize
methodsubtracts the size of a tombstoned node from its ancestors' sizes when
the node is removed. However, the previous logic did not consider
cases where ancestors node are tombstoned. In such cases, the update
should not propagate to the parent's ancestors. This commit introduces
recursive checks on ancestors and stops updating process if a
tombstoned ancestor is encountered.
Furthermore, the PR ensures consistency between the size maintenance
policies of updateDescendantsSize and updateAncestorsSize.
Any background context you want to provide?
What are the relevant tickets?
Address #889
Related to yorkie-team/yorkie-js-sdk#846
Checklist:
Summary by CodeRabbit
Bug Fixes
Tests