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

Fix miscalculation of tree size in concurrent editing #891

Merged
merged 3 commits into from
Jun 7, 2024
Merged

Conversation

raararaara
Copy link
Contributor

@raararaara raararaara commented Jun 7, 2024

What this PR does / why we need it?

Fix miscalculation of tree size in concurrent editing

This commit addresses the issue where the updateAncestorsSize method
subtracts 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:

  • Added relevant tests or not required
  • Didn't break anything

Summary by CodeRabbit

  • Bug Fixes

    • Improved logic for updating ancestors' and descendants' sizes to ensure accurate calculations and prevent errors when nodes are marked as removed.
  • Tests

    • Added new test cases for concurrent editing and tree consistency checks in document collaboration scenarios to ensure reliability and correctness.

Copy link

coderabbitai bot commented Jun 7, 2024

Warning

Review failed

The pull request is closed.

Walkthrough

The recent changes address tree structure and size consistency in the TreeNode and Node structs within the document collaboration system. Updates simplify ancestor size management, modify descendant size handling, and introduce new test cases to ensure tree consistency during concurrent edits. Additionally, debug print statements have been added to the ApplyChanges function for specific index values.

Changes

Files Change Summary
pkg/document/crdt/tree.go Simplified logic in TreeNode's remove method for updating ancestors' size and parent's length.
pkg/document/internal_document.go Added fmt import and a debug print statement in ApplyChanges for index 158.
pkg/index/tree.go Updated UpdateAncestorsSize to break loop if parent's value is removed; modified UpdateDescendantsSize to skip removed nodes.
test/integration/tree_test.go Added imports for converter and crdt packages; introduced new test cases for concurrent editing and tree consistency.

Sequence Diagram(s) (Beta)

No sequence diagrams provided as the changes are primarily logical simplifications and enhancements.

Assessment against linked issues

Objective (Issue #889) Addressed Explanation
Ensure size for index calculation in XML Tree is consistent
Ensure attributes of Trees generated by Changes and Snapshot match

Poem

In the code, the trees now stand,
Ancestors' sizes, simplified, grand.
Descendants skip the nodes removed,
A smoother process, finely tuned.
Debug prints for index keen,
Collaboration flows, pristine.
🌳✨


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Jun 7, 2024

Codecov Report

Attention: Patch coverage is 11.11111% with 8 lines in your changes missing coverage. Please review.

Project coverage is 50.64%. Comparing base (ef70028) to head (49081a0).

Files Patch % Lines
pkg/index/tree.go 0.00% 7 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

@raararaara raararaara marked this pull request as ready for review June 7, 2024 02:21
Copy link

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between ef70028 and 1055529.

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 for converter and crdt packages are correctly added for new test functionalities.

pkg/document/internal_document.go Outdated Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a 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.

@hackerwins hackerwins self-requested a review June 7, 2024 02:54
@hackerwins hackerwins merged commit 12f7baa into main Jun 7, 2024
4 checks passed
@hackerwins hackerwins deleted the tree-size branch June 7, 2024 02:55
@hackerwins
Copy link
Member

@raararaara Thanks for your contribution.

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