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

Balancing Tree to Prevent Skewness #1025

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

m4ushold
Copy link
Contributor

@m4ushold m4ushold commented Oct 2, 2024

To prevent the tree from becoming skewed, I balanced it by splaying the first node of the sequence every 500 linear insert operations. The value 500 was determined experimentally.

What this PR does / why we need it:

Description:
This pull request (PR) introduces an enhanced method for balancing a tree during insert operations to prevent skewness. The goal is to optimize performance by replacing the inefficient height-based splay operations with a more effective approach.

Changes Made:

  1. Linear Operation Detection and Balancing:

    • Detects sequences of linear insert operations that can cause the tree to become skewed.
    • Balances the tree by splaying the first node of the sequence when consecutive inserts originate from the root.
  2. Optimization of Splay Trigger Frequency:

    • Sets the splay operation to trigger every 500 linear insert operations. Through testing, it was determined that a threshold of 500 offers optimal performance among various alternatives.

Code Modifications:

  • Added linearCount and firstNode fields to the Tree structure to track consecutive insert operations.
  • Modified the InsertAfter method to conditionally perform a splay operation and reset linearCount.
// Additional fields in the Tree structure:
type Tree[V Value] struct {
    root        *Node[V]
    linearCount int
    firstNode   *Node[V]
}

// Changes in the InsertAfter method:
func (t *Tree[V]) InsertAfter(prev *Node[V], node *Node[V]) *Node[V] {
    if prev == t.root {
        t.linearCount++
        if t.linearCount == 1 {
            t.firstNode = node
        } else if t.linearCount > 500 {
            t.Splay(t.firstNode)
            t.linearCount = 0
        }
    } else {
        t.linearCount = 0
    }
    t.Splay(prev)
    t.root = node
    node.right = prev.right
}

Performance Improvements:

  • Tree height reduced by 80%.
  • Maximum rotations per operation decreased by 85%.
  • Total number of rotations reduced by 3%, significantly enhancing performance.
  • CRDT.Text benchmark(BenchmarkTextEditing) reduced by 42.53%(7.305 -> 4.198).
    image

For more details, you can check this

Which issue(s) this PR fixes:

Fixes #941

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Additional documentation:


Checklist:

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

Summary by CodeRabbit

  • New Features
    • Enhanced tree structure to track consecutive insertions and manage node references effectively.
    • Implemented a mechanism to trigger specific actions based on insertion counts, improving performance and functionality.

To prevent the tree from becoming skewed, I balanced it by splaying
the first node of the sequence every 500 linear insert operations.
The value 500 was determined experimentally.
Copy link

coderabbitai bot commented Oct 2, 2024

Walkthrough

The changes in this pull request involve modifications to the Tree structure within the pkg/splay/splay.go file. Two new fields, linearCount and firstNode, have been added to track consecutive insertions at the root and reference the first inserted node, respectively. The NewTree constructor initializes linearCount to zero, and the InsertAfter method has been updated to manage linearCount, triggering a splay operation when it exceeds 500. These changes aim to enhance the performance of the Splay tree used in the crdt.Text data structure.

Changes

File Change Summary
pkg/splay/splay.go Added fields linearCount int and firstNode *Node[V] to Tree struct; updated NewTree and InsertAfter methods.

Assessment against linked issues

Objective Addressed Explanation
Improve performance of Splay Tree in crdt.Text data structure to prevent skewness (#941)

Possibly related issues

🐰 In the garden where trees sway,
A new count helps keep skewness at bay.
With nodes that dance and roots that play,
Performance blooms in a bright array!
🌳✨


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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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 Oct 2, 2024

Codecov Report

Attention: Patch coverage is 46.15385% with 7 lines in your changes missing coverage. Please review.

Project coverage is 38.28%. Comparing base (c7797cf) to head (d97fc4b).

Files with missing lines Patch % Lines
pkg/splay/splay.go 46.15% 6 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1025   +/-   ##
=======================================
  Coverage   38.28%   38.28%           
=======================================
  Files         171      171           
  Lines       25775    25787   +12     
=======================================
+ Hits         9867     9872    +5     
- Misses      15075    15081    +6     
- Partials      833      834    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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 (3)
pkg/splay/splay.go (3)

96-97: Add documentation for new fields in Tree struct

To improve code readability and maintainability, please add comments explaining the purpose of the new fields linearCount and firstNode in the Tree struct. This will help other developers understand how these fields are used to prevent skewness in the splay tree.


126-126: Reset firstNode after splaying

After splaying firstNode and resetting linearCount, it's advisable to also reset firstNode to nil. This prevents holding a reference to a node that may have been altered or deleted later, which can help avoid potential memory leaks or unintended behavior.

Apply this diff:

        t.Splay(t.firstNode)
        t.linearCount = 0
+       t.firstNode = nil

124-126: Define splay threshold as a named constant

Using the magic number 500 as the splay threshold can reduce code clarity. Consider defining it as a named constant or making it configurable. This enhances readability and makes future adjustments easier.

Apply this diff:

+const splayThreshold = 500

...

        } else if t.linearCount > splayThreshold {
            t.Splay(t.firstNode)
            t.linearCount = 0
        }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between fcf6fbf and ca47fc7.

📒 Files selected for processing (1)
  • pkg/splay/splay.go (2 hunks)

Comment on lines +122 to +127
if t.linearCount == 1 {
t.firstNode = node
} else if t.linearCount > 500 {
t.Splay(t.firstNode)
t.linearCount = 0
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Ensure firstNode is valid before splaying

There's a potential risk that firstNode might have been modified or removed from the tree before the splay operation when linearCount exceeds the threshold. This could lead to unexpected behavior or runtime errors. Consider adding a check to ensure that firstNode is still a valid node in the tree before performing the splay operation.

Apply this diff to include a validity check:

        } else if t.linearCount > 500 {
+           if t.isValidNode(t.firstNode) {
                t.Splay(t.firstNode)
+           }
            t.linearCount = 0
        }

And implement the isValidNode method:

func (t *Tree[V]) isValidNode(node *Node[V]) bool {
    return node != nil && node.hasLinks()
}

@m4ushold m4ushold self-assigned this Oct 4, 2024
@m4ushold m4ushold added the enhancement 🌟 New feature or request label Oct 4, 2024
@m4ushold m4ushold changed the title optimize splay tree to prevent skewness Balancing Tree to Prevent Skewness Oct 16, 2024
@hackerwins hackerwins force-pushed the main branch 2 times, most recently from e687d61 to 8d1f1ae Compare February 20, 2025 07:46
Copy link

@hackerwins-yorkie hackerwins-yorkie 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 Analysis 📊

This is a comparison result between the previous(e687d61) and the current commit(551025a).

Significant Changes (≥20% difference)

Benchmark suite Previous Current Change
BenchmarkDocument/text_delete_all_100000/ (allocs/op) 566,133 allocs 417,334 allocs 🟢 -26.28%
BenchmarkDocument/text_delete_all_10000/ (allocs/op) 56,134 allocs 41,943 allocs 🟢 -25.28%
BenchmarkDocument/text_test/ (ns/op) 32155.00 ns 38790.00 ns 🔴 +20.63%

Key Observations 🔍

  • The benchmark suite BenchmarkDocument shows a notable decrease in memory allocations in the following benchmarks:

    • text_delete_all_100000/: Allocs/op decreased by approximately 26.28%.
    • text_delete_all_10000/: Allocs/op decreased by around 25.28%.
    • These reductions in memory allocations indicate potential optimization improvements in memory management for these operations.
  • The benchmark suite BenchmarkRPC demonstrates improvements in performance for various benchmarks:

    • client_to_server/: ns/op decreased by about 3.80%.
    • client_to_client_via_server/: ns/op decreased by approximately 2.26%.
    • attach_large_document/: ns/op decreased by roughly 2.87%.
    • These performance enhancements indicate potential efficiency gains in the RPC-related functionalities.
  • The benchmark suite BenchmarkSync showcases a mixed pattern of performance changes:

    • memory_sync_10000_test/: ns/op increased by around 6.96%, reflecting potential areas for optimization in handling larger data sizes.
    • memory_sync_1000_test/: ns/op increased slightly by 0.40%, indicating a moderate performance impact.
    • memory_sync_10_test/: ns/op decreased by approximately 0.81%, showcasing some optimizations in this particular scenario.

Since no other significant changes (≥20%) were observed in the provided data, the above trends highlight both areas of improvement and stability across different benchmark suites.

Detailed Test Results

BenchmarkDocument
Benchmark suite Previous Current Change
constructor_test/ (ns/op) 1439.00 ns 1454.00 ns 🔴 +1.04%
constructor_test/ (B/op) 1.39 KB 1.39 KB ⚪ 0%
constructor_test/ (allocs/op) 24 allocs 24 allocs ⚪ 0%
status_test/ (ns/op) 1028.00 ns 1041.00 ns 🔴 +1.26%
status_test/ (B/op) 1.35 KB 1.35 KB ⚪ 0%
status_test/ (allocs/op) 22 allocs 22 allocs ⚪ 0%
equals_test/ (ns/op) 7864.00 ns 7934.00 ns 🔴 +0.89%
equals_test/ (B/op) 7.56 KB 7.56 KB ⚪ 0%
equals_test/ (allocs/op) 129 allocs 129 allocs ⚪ 0%
nested_update_test/ (ns/op) 17079.00 ns 16927.00 ns 🟢 -0.89%
nested_update_test/ (B/op) 12.31 KB 12.36 KB 🔴 +0.39%
nested_update_test/ (allocs/op) 258 allocs 258 allocs ⚪ 0%
delete_test/ (ns/op) 27313.00 ns 22943.00 ns 🟢 -16.00%
delete_test/ (B/op) 15.79 KB 15.84 KB 🔴 +0.30%
delete_test/ (allocs/op) 339 allocs 339 allocs ⚪ 0%
object_test/ (ns/op) 8546.00 ns 8579.00 ns 🔴 +0.39%
object_test/ (B/op) 7.03 KB 7.03 KB 🔴 +0.01%
object_test/ (allocs/op) 118 allocs 118 allocs ⚪ 0%
array_test/ (ns/op) 28984.00 ns 29013.00 ns 🔴 +0.10%
array_test/ (B/op) 12.14 KB 12.19 KB 🔴 +0.40%
array_test/ (allocs/op) 273 allocs 273 allocs ⚪ 0%
text_test/ (ns/op) 32155.00 ns 38790.00 ns 🔴 +20.63%
text_test/ (B/op) 15.19 KB 15.24 KB 🔴 +0.32%
text_test/ (allocs/op) 484 allocs 484 allocs ⚪ 0%
text_composition_test/ (ns/op) 31674.00 ns 32839.00 ns 🔴 +3.68%
text_composition_test/ (B/op) 18.70 KB 18.75 KB 🔴 +0.26%
text_composition_test/ (allocs/op) 501 allocs 501 allocs ⚪ 0%
rich_text_test/ (ns/op) 87424.00 ns 86667.00 ns 🟢 -0.87%
rich_text_test/ (B/op) 39.36 KB 39.41 KB 🔴 +0.13%
rich_text_test/ (allocs/op) 1,146 allocs 1,146 allocs ⚪ 0%
counter_test/ (ns/op) 18201.00 ns 18142.00 ns 🟢 -0.32%
counter_test/ (B/op) 11.81 KB 11.81 KB ⚪ 0%
counter_test/ (allocs/op) 253 allocs 253 allocs ⚪ 0%
text_edit_gc_100/ (ns/op) 1.39 ms 1.42 ms 🔴 +2.18%
text_edit_gc_100/ (B/op) 864.90 KB 864.91 KB ⚪ 0%
text_edit_gc_100/ (allocs/op) 17,281 allocs 17,281 allocs ⚪ 0%
text_edit_gc_1000/ (ns/op) 53.39 ms 52.55 ms 🟢 -1.57%
text_edit_gc_1000/ (B/op) 46.84 MB 46.84 MB ⚪ 0%
text_edit_gc_1000/ (allocs/op) 185,598 allocs 186,124 allocs 🔴 +0.28%
text_split_gc_100/ (ns/op) 2.12 ms 2.13 ms 🔴 +0.21%
text_split_gc_100/ (B/op) 1.58 MB 1.58 MB ⚪ 0%
text_split_gc_100/ (allocs/op) 15,950 allocs 15,951 allocs ⚪ 0%
text_split_gc_1000/ (ns/op) 128.25 ms 127.28 ms 🟢 -0.75%
text_split_gc_1000/ (B/op) 137.79 MB 137.79 MB ⚪ 0%
text_split_gc_1000/ (allocs/op) 185,000 allocs 184,989 allocs ⚪ 0%
text_delete_all_10000/ (ns/op) 18.43 ms 15.52 ms 🟢 -15.80%
text_delete_all_10000/ (B/op) 10.58 MB 10.55 MB 🟢 -0.26%
text_delete_all_10000/ (allocs/op) 56,134 allocs 41,943 allocs 🟢 -25.28%
text_delete_all_100000/ (ns/op) 312.31 ms 261.71 ms 🟢 -16.20%
text_delete_all_100000/ (B/op) 105.54 MB 105.19 MB 🟢 -0.34%
text_delete_all_100000/ (allocs/op) 566,133 allocs 417,334 allocs 🟢 -26.28%
text_100/ (ns/op) 234634.00 ns 236434.00 ns 🔴 +0.77%
text_100/ (B/op) 120.94 KB 120.95 KB ⚪ 0%
text_100/ (allocs/op) 5,181 allocs 5,181 allocs ⚪ 0%
text_1000/ (ns/op) 2.46 ms 2.62 ms 🔴 +6.40%
text_1000/ (B/op) 1.16 MB 1.16 MB 🔴 +0.38%
text_1000/ (allocs/op) 51,084 allocs 53,086 allocs 🔴 +3.92%
array_1000/ (ns/op) 1.24 ms 1.26 ms 🔴 +1.37%
array_1000/ (B/op) 1.09 MB 1.09 MB 🔴 +0.01%
array_1000/ (allocs/op) 11,879 allocs 11,879 allocs ⚪ 0%
array_10000/ (ns/op) 13.33 ms 14.01 ms 🔴 +5.08%
array_10000/ (B/op) 9.89 MB 9.89 MB ⚪ 0%
array_10000/ (allocs/op) 120,735 allocs 120,731 allocs ⚪ 0%
array_gc_100/ (ns/op) 131750.00 ns 132276.00 ns 🔴 +0.40%
array_gc_100/ (B/op) 99.89 KB 99.93 KB 🔴 +0.04%
array_gc_100/ (allocs/op) 1,266 allocs 1,266 allocs ⚪ 0%
array_gc_1000/ (ns/op) 1.42 ms 1.45 ms 🔴 +1.90%
array_gc_1000/ (B/op) 1.14 MB 1.14 MB ⚪ 0%
array_gc_1000/ (allocs/op) 12,926 allocs 12,926 allocs ⚪ 0%
counter_1000/ (ns/op) 202098.00 ns 201759.00 ns 🟢 -0.17%
counter_1000/ (B/op) 178.13 KB 178.14 KB ⚪ 0%
counter_1000/ (allocs/op) 5,771 allocs 5,771 allocs ⚪ 0%
counter_10000/ (ns/op) 2.17 ms 2.16 ms 🟢 -0.62%
counter_10000/ (B/op) 2.07 MB 2.07 MB ⚪ 0%
counter_10000/ (allocs/op) 59,778 allocs 59,778 allocs ⚪ 0%
object_1000/ (ns/op) 1.39 ms 1.41 ms 🔴 +1.64%
object_1000/ (B/op) 1.44 MB 1.44 MB 🔴 +0.01%
object_1000/ (allocs/op) 9,925 allocs 9,925 allocs ⚪ 0%
object_10000/ (ns/op) 14.82 ms 14.99 ms 🔴 +1.14%
object_10000/ (B/op) 12.35 MB 12.35 MB ⚪ 0%
object_10000/ (allocs/op) 101,232 allocs 101,230 allocs ⚪ 0%
tree_100/ (ns/op) 1.02 ms 1.08 ms 🔴 +5.57%
tree_100/ (B/op) 951.02 KB 951.03 KB ⚪ 0%
tree_100/ (allocs/op) 6,102 allocs 6,102 allocs ⚪ 0%
tree_1000/ (ns/op) 74.23 ms 78.33 ms 🔴 +5.52%
tree_1000/ (B/op) 86.58 MB 86.58 MB ⚪ 0%
tree_1000/ (allocs/op) 60,111 allocs 60,112 allocs ⚪ 0%
tree_10000/ (ns/op) 9.68 s 9.38 s 🟢 -3.12%
tree_10000/ (B/op) 8.58 GB 8.58 GB ⚪ 0%
tree_10000/ (allocs/op) 600,173 allocs 600,202 allocs ⚪ 0%
tree_delete_all_1000/ (ns/op) 78.41 ms 76.40 ms 🟢 -2.55%
tree_delete_all_1000/ (B/op) 87.57 MB 87.57 MB ⚪ 0%
tree_delete_all_1000/ (allocs/op) 75,289 allocs 75,290 allocs ⚪ 0%
tree_edit_gc_100/ (ns/op) 3.96 ms 3.84 ms 🟢 -3.07%
tree_edit_gc_100/ (B/op) 4.15 MB 4.15 MB ⚪ 0%
tree_edit_gc_100/ (allocs/op) 15,147 allocs 15,146 allocs ⚪ 0%
tree_edit_gc_1000/ (ns/op) 332.75 ms 310.36 ms 🟢 -6.73%
tree_edit_gc_1000/ (B/op) 384.04 MB 384.04 MB ⚪ 0%
tree_edit_gc_1000/ (allocs/op) 154,952 allocs 154,934 allocs 🟢 -0.01%
tree_split_gc_100/ (ns/op) 2.67 ms 2.62 ms 🟢 -1.76%
tree_split_gc_100/ (B/op) 2.41 MB 2.41 MB ⚪ 0%
tree_split_gc_100/ (allocs/op) 11,131 allocs 11,131 allocs ⚪ 0%
tree_split_gc_1000/ (ns/op) 197.74 ms 187.34 ms 🟢 -5.26%
tree_split_gc_1000/ (B/op) 222.50 MB 222.50 MB ⚪ 0%
tree_split_gc_1000/ (allocs/op) 122,053 allocs 122,055 allocs ⚪ 0%
BenchmarkRPC
Benchmark suite Previous Current Change
client_to_server/ (ns/op) 431.85 ms 415.45 ms 🟢 -3.80%
client_to_server/ (B/op) 16.13 MB 16.15 MB 🔴 +0.12%
client_to_server/ (allocs/op) 223,674 allocs 224,071 allocs 🔴 +0.18%
client_to_client_via_server/ (ns/op) 788.62 ms 770.77 ms 🟢 -2.26%
client_to_client_via_server/ (B/op) 37.20 MB 34.56 MB 🟢 -7.09%
client_to_client_via_server/ (allocs/op) 478,656 allocs 475,312 allocs 🟢 -0.70%
attach_large_document/ (ns/op) 1.32 s 1.29 s 🟢 -2.87%
attach_large_document/ (B/op) 1.89 GB 1.89 GB 🟢 -0.05%
attach_large_document/ (allocs/op) 12,321 allocs 12,485 allocs 🔴 +1.33%
adminCli_to_server/ (ns/op) 542.08 ms 559.42 ms 🔴 +3.20%
adminCli_to_server/ (B/op) 21.76 MB 21.30 MB 🟢 -2.10%
adminCli_to_server/ (allocs/op) 291,952 allocs 316,692 allocs 🔴 +8.47%
BenchmarkLocker
Benchmark suite Previous Current Change
(ns/op) 82.86 ns 85.60 ns 🔴 +3.31%
(B/op) 32.00 B 32.00 B ⚪ 0%
(allocs/op) 1 allocs 1 allocs ⚪ 0%
BenchmarkLockerParallel
Benchmark suite Previous Current Change
(ns/op) 45.80 ns 47.42 ns 🔴 +3.54%
(B/op) 0.00 B 0.00 B ⚪ 0%
(allocs/op) 0 allocs 0 allocs ⚪ 0%
BenchmarkLockerMoreKeys
Benchmark suite Previous Current Change
(ns/op) 180.50 ns 185.60 ns 🔴 +2.83%
(B/op) 31.00 B 30.00 B 🟢 -3.23%
(allocs/op) 0 allocs 0 allocs ⚪ 0%
BenchmarkRWLocker
Benchmark suite Previous Current Change
RWLock_rate_2/ (ns/op) 50.25 ns 52.31 ns 🔴 +4.10%
RWLock_rate_2/ (B/op) 0.00 B 0.00 B ⚪ 0%
RWLock_rate_2/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
RWLock_rate_10/ (ns/op) 44.88 ns 47.37 ns 🔴 +5.55%
RWLock_rate_10/ (B/op) 0.00 B 0.00 B ⚪ 0%
RWLock_rate_10/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
RWLock_rate_100/ (ns/op) 63.08 ns 64.98 ns 🔴 +3.01%
RWLock_rate_100/ (B/op) 2.00 B 2.00 B ⚪ 0%
RWLock_rate_100/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
RWLock_rate_1000/ (ns/op) 91.91 ns 88.92 ns 🟢 -3.25%
RWLock_rate_1000/ (B/op) 8.00 B 8.00 B ⚪ 0%
RWLock_rate_1000/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
BenchmarkChange
Benchmark suite Previous Current Change
Push_10_Changes/ (ns/op) 4.54 ms 4.62 ms 🔴 +1.82%
Push_10_Changes/ (B/op) 150.42 KB 150.48 KB 🔴 +0.04%
Push_10_Changes/ (allocs/op) 1,623 allocs 1,623 allocs ⚪ 0%
Push_100_Changes/ (ns/op) 16.52 ms 16.40 ms 🟢 -0.72%
Push_100_Changes/ (B/op) 770.59 KB 780.24 KB 🔴 +1.25%
Push_100_Changes/ (allocs/op) 8,509 allocs 8,510 allocs 🔴 +0.01%
Push_1000_Changes/ (ns/op) 129.20 ms 128.46 ms 🟢 -0.57%
Push_1000_Changes/ (B/op) 7.22 MB 7.20 MB 🟢 -0.29%
Push_1000_Changes/ (allocs/op) 79,325 allocs 79,324 allocs ⚪ 0%
Pull_10_Changes/ (ns/op) 3.70 ms 3.81 ms 🔴 +2.98%
Pull_10_Changes/ (B/op) 124.59 KB 123.92 KB 🟢 -0.54%
Pull_10_Changes/ (allocs/op) 1,456 allocs 1,456 allocs ⚪ 0%
Pull_100_Changes/ (ns/op) 5.32 ms 5.36 ms 🔴 +0.70%
Pull_100_Changes/ (B/op) 354.61 KB 353.22 KB 🟢 -0.39%
Pull_100_Changes/ (allocs/op) 5,182 allocs 5,182 allocs ⚪ 0%
Pull_1000_Changes/ (ns/op) 10.88 ms 10.89 ms 🔴 +0.10%
Pull_1000_Changes/ (B/op) 2.20 MB 2.20 MB 🟢 -0.08%
Pull_1000_Changes/ (allocs/op) 44,681 allocs 44,682 allocs ⚪ 0%
BenchmarkSnapshot
Benchmark suite Previous Current Change
Push_3KB_snapshot/ (ns/op) 19.55 ms 18.66 ms 🟢 -4.59%
Push_3KB_snapshot/ (B/op) 905.58 KB 911.16 KB 🔴 +0.62%
Push_3KB_snapshot/ (allocs/op) 8,516 allocs 8,515 allocs 🟢 -0.01%
Push_30KB_snapshot/ (ns/op) 132.18 ms 132.66 ms 🔴 +0.37%
Push_30KB_snapshot/ (B/op) 8.24 MB 8.19 MB 🟢 -0.59%
Push_30KB_snapshot/ (allocs/op) 89,008 allocs 89,446 allocs 🔴 +0.49%
Pull_3KB_snapshot/ (ns/op) 7.80 ms 7.60 ms 🟢 -2.68%
Pull_3KB_snapshot/ (B/op) 1.12 MB 1.11 MB 🟢 -0.15%
Pull_3KB_snapshot/ (allocs/op) 20,064 allocs 20,059 allocs 🟢 -0.02%
Pull_30KB_snapshot/ (ns/op) 19.91 ms 20.16 ms 🔴 +1.24%
Pull_30KB_snapshot/ (B/op) 9.31 MB 9.31 MB ⚪ 0%
Pull_30KB_snapshot/ (allocs/op) 193,610 allocs 193,608 allocs ⚪ 0%
BenchmarkSplayTree
Benchmark suite Previous Current Change
stress_test_100000/ (ns/op) 0.19 ns 0.19 ns 🔴 +0.21%
stress_test_100000/ (B/op) 0.00 B 0.00 B ⚪ 0%
stress_test_100000/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
stress_test_200000/ (ns/op) 0.40 ns 0.42 ns 🔴 +5.11%
stress_test_200000/ (B/op) 0.00 B 0.00 B ⚪ 0%
stress_test_200000/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
stress_test_300000/ (ns/op) 0.57 ns 0.58 ns 🔴 +2.04%
stress_test_300000/ (B/op) 0.00 B 0.00 B ⚪ 0%
stress_test_300000/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
random_access_100000/ (ns/op) 0.01 ns 0.01 ns 🟢 -1.34%
random_access_100000/ (B/op) 0.00 B 0.00 B ⚪ 0%
random_access_100000/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
random_access_200000/ (ns/op) 0.03 ns 0.03 ns 🟢 -12.60%
random_access_200000/ (B/op) 0.00 B 0.00 B ⚪ 0%
random_access_200000/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
random_access_300000/ (ns/op) 0.04 ns 0.04 ns 🟢 -11.29%
random_access_300000/ (B/op) 0.00 B 0.00 B ⚪ 0%
random_access_300000/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
editing_trace_bench/ (ns/op) 0.00 ns 0.00 ns 🔴 +6.11%
editing_trace_bench/ (B/op) 0.00 B 0.00 B ⚪ 0%
editing_trace_bench/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
BenchmarkSync
Benchmark suite Previous Current Change
memory_sync_10_test/ (ns/op) 7288.00 ns 7229.00 ns 🟢 -0.81%
memory_sync_10_test/ (B/op) 1.34 KB 1.34 KB 🔴 +0.07%
memory_sync_10_test/ (allocs/op) 35 allocs 35 allocs ⚪ 0%
memory_sync_100_test/ (ns/op) 55353.00 ns 54931.00 ns 🟢 -0.76%
memory_sync_100_test/ (B/op) 9.51 KB 9.52 KB 🔴 +0.12%
memory_sync_100_test/ (allocs/op) 268 allocs 268 allocs ⚪ 0%
memory_sync_1000_test/ (ns/op) 616285.00 ns 618734.00 ns 🔴 +0.40%
memory_sync_1000_test/ (B/op) 75.92 KB 75.53 KB 🟢 -0.51%
memory_sync_1000_test/ (allocs/op) 2,111 allocs 2,099 allocs 🟢 -0.57%
memory_sync_10000_test/ (ns/op) 7.47 ms 7.99 ms 🔴 +6.96%
memory_sync_10000_test/ (B/op) 761.49 KB 754.36 KB 🟢 -0.94%
memory_sync_10000_test/ (allocs/op) 20,475 allocs 20,390 allocs 🟢 -0.42%
BenchmarkTextEditing
Benchmark suite Previous Current Change
(ns/op) 5.18 s 5.36 s 🔴 +3.52%
(B/op) 3.92 GB 3.92 GB ⚪ 0%
(allocs/op) 20,619,777 allocs 20,600,651 allocs 🟢 -0.09%
BenchmarkTree
Benchmark suite Previous Current Change
10000_vertices_to_protobuf/ (ns/op) 4.17 ms 4.37 ms 🔴 +4.81%
10000_vertices_to_protobuf/ (B/op) 6.36 MB 6.36 MB ⚪ 0%
10000_vertices_to_protobuf/ (allocs/op) 70,025 allocs 70,025 allocs ⚪ 0%
10000_vertices_from_protobuf/ (ns/op) 217.30 ms 225.09 ms 🔴 +3.59%
10000_vertices_from_protobuf/ (B/op) 442.30 MB 442.30 MB ⚪ 0%
10000_vertices_from_protobuf/ (allocs/op) 290,038 allocs 290,038 allocs ⚪ 0%
20000_vertices_to_protobuf/ (ns/op) 8.84 ms 9.12 ms 🔴 +3.22%
20000_vertices_to_protobuf/ (B/op) 12.89 MB 12.89 MB ⚪ 0%
20000_vertices_to_protobuf/ (allocs/op) 140,028 allocs 140,028 allocs ⚪ 0%
20000_vertices_from_protobuf/ (ns/op) 884.61 ms 906.87 ms 🔴 +2.52%
20000_vertices_from_protobuf/ (B/op) 1.70 GB 1.70 GB ⚪ 0%
20000_vertices_from_protobuf/ (allocs/op) 580,043 allocs 580,047 allocs ⚪ 0%
30000_vertices_to_protobuf/ (ns/op) 14.26 ms 14.77 ms 🔴 +3.56%
30000_vertices_to_protobuf/ (B/op) 18.98 MB 18.98 MB ⚪ 0%
30000_vertices_to_protobuf/ (allocs/op) 210,029 allocs 210,029 allocs ⚪ 0%
30000_vertices_from_protobuf/ (ns/op) 2.00 s 2.00 s 🟢 -0.03%
30000_vertices_from_protobuf/ (B/op) 3.75 GB 3.75 GB ⚪ 0%
30000_vertices_from_protobuf/ (allocs/op) 870,147 allocs 870,144 allocs ⚪ 0%
BenchmarkVersionVector
Benchmark suite Previous Current Change
clients_10/ (ns/op) 160.21 ms 161.06 ms 🔴 +0.53%
clients_10/ (1_changepack(bytes)) 745.00 B 745.00 B ⚪ 0%
clients_10/ (2_snapshot(bytes)) 379.00 B 379.00 B ⚪ 0%
clients_10/ (3_pushpull(ms)) 8.00 ms 8.00 ms ⚪ 0%
clients_10/ (4_attach(ms)) 6.00 ms 6.00 ms ⚪ 0%
clients_10/ (5_changepack_after_detach(bytes)) 805.00 B 805.00 B ⚪ 0%
clients_10/ (6_snapshot_after_detach(bytes)) 136.00 B 136.00 B ⚪ 0%
clients_10/ (7_pushpull_after_detach(ms)) 8.00 ms 8.00 ms ⚪ 0%
clients_10/ (B/op) 19.93 MB 18.23 MB 🟢 -8.56%
clients_10/ (allocs/op) 83,762 allocs 83,724 allocs 🟢 -0.05%
clients_100/ (ns/op) 1.41 s 1.43 s 🔴 +1.32%
clients_100/ (1_changepack(bytes)) 6.14 KB 6.14 KB ⚪ 0%
clients_100/ (2_snapshot(bytes)) 3.08 KB 3.08 KB ⚪ 0%
clients_100/ (3_pushpull(ms)) 11.00 ms 11.00 ms ⚪ 0%
clients_100/ (4_attach(ms)) 11.00 ms 11.00 ms ⚪ 0%
clients_100/ (5_changepack_after_detach(bytes)) 6.21 KB 6.21 KB ⚪ 0%
clients_100/ (6_snapshot_after_detach(bytes)) 137.00 B 137.00 B ⚪ 0%
clients_100/ (7_pushpull_after_detach(ms)) 9.00 ms 9.00 ms ⚪ 0%
clients_100/ (B/op) 230.31 MB 228.70 MB 🟢 -0.70%
clients_100/ (allocs/op) 1,539,768 allocs 1,539,696 allocs ⚪ 0%
clients_1000/ (ns/op) 60.97 s 61.59 s 🔴 +1.01%
clients_1000/ (1_changepack(bytes)) 60.16 KB 60.16 KB ⚪ 0%
clients_1000/ (2_snapshot(bytes)) 30.08 KB 30.08 KB ⚪ 0%
clients_1000/ (3_pushpull(ms)) 95.00 ms 95.00 ms ⚪ 0%
clients_1000/ (4_attach(ms)) 249.00 ms 220.00 ms 🟢 -11.65%
clients_1000/ (5_changepack_after_detach(bytes)) 60.22 KB 60.22 KB ⚪ 0%
clients_1000/ (6_snapshot_after_detach(bytes)) 139.00 B 139.00 B ⚪ 0%
clients_1000/ (7_pushpull_after_detach(ms)) 26.00 ms 23.00 ms 🟢 -11.54%
clients_1000/ (B/op) 22.07 GB 22.07 GB ⚪ 0%
clients_1000/ (allocs/op) 111,762,106 allocs 111,762,565 allocs ⚪ 0%

Copy link

@hackerwins-yorkie hackerwins-yorkie 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 Analysis 📊

This is a comparison result between the previous(c7797cf) and the current commit(35a6359).

Significant Changes (≥20% difference)

Benchmark suite Previous Current Change
BenchmarkDocument/text_delete_all_100000/ (allocs/op) 566,122 allocs 417,502 allocs 🟢 -26.25%
BenchmarkDocument/text_delete_all_10000/ (allocs/op) 56,138 allocs 41,944 allocs 🟢 -25.28%

Key Observations 🔍

  • In the BenchmarkDocument suite:

    • The benchmarks text_delete_all_100000 and text_delete_all_10000 showed a significant decrease in allocations per operation, with a reduction of 26.25% and 25.28%, respectively. This indicates an improvement in memory management efficiency.
    • While most benchmarks in the suite showed minor fluctuations, the array_test benchmark stood out with an 18.67% increase in allocations per operation, suggesting a potential area for optimization.
  • Across different benchmark suites:

    • The BenchmarkRPC suite demonstrated improvements in memory allocation efficiency, with notable reductions in bytes allocated per operation for client_to_server and client_to_client_via_server benchmarks.
    • The BenchmarkSync suite showcased slight performance improvements in terms of reduced allocations per operation across different memory synchronization tests.
  • Overall, the majority of benchmarks showed relatively stable performance without any significant changes of 20% or more, indicating consistent and reliable results in most test scenarios.

Detailed Test Results

BenchmarkDocument
Benchmark suite Previous Current Change
constructor_test/ (ns/op) 1472.00 ns 1482.00 ns 🔴 +0.68%
constructor_test/ (B/op) 1.43 KB 1.43 KB ⚪ 0%
constructor_test/ (allocs/op) 25 allocs 25 allocs ⚪ 0%
status_test/ (ns/op) 1334.00 ns 1109.00 ns 🟢 -16.87%
status_test/ (B/op) 1.40 KB 1.40 KB ⚪ 0%
status_test/ (allocs/op) 23 allocs 23 allocs ⚪ 0%
equals_test/ (ns/op) 7938.00 ns 7936.00 ns 🟢 -0.03%
equals_test/ (B/op) 7.71 KB 7.71 KB ⚪ 0%
equals_test/ (allocs/op) 132 allocs 132 allocs ⚪ 0%
nested_update_test/ (ns/op) 17081.00 ns 16969.00 ns 🟢 -0.66%
nested_update_test/ (B/op) 12.36 KB 12.40 KB 🔴 +0.39%
nested_update_test/ (allocs/op) 259 allocs 259 allocs ⚪ 0%
delete_test/ (ns/op) 22790.00 ns 23382.00 ns 🔴 +2.60%
delete_test/ (B/op) 15.84 KB 15.88 KB 🔴 +0.30%
delete_test/ (allocs/op) 340 allocs 340 allocs ⚪ 0%
object_test/ (ns/op) 8539.00 ns 8746.00 ns 🔴 +2.42%
object_test/ (B/op) 7.08 KB 7.08 KB ⚪ 0%
object_test/ (allocs/op) 119 allocs 119 allocs ⚪ 0%
array_test/ (ns/op) 28405.00 ns 33707.00 ns 🔴 +18.67%
array_test/ (B/op) 12.19 KB 12.23 KB 🔴 +0.39%
array_test/ (allocs/op) 274 allocs 274 allocs ⚪ 0%
text_test/ (ns/op) 31656.00 ns 31973.00 ns 🔴 +1.00%
text_test/ (B/op) 15.24 KB 15.28 KB 🔴 +0.32%
text_test/ (allocs/op) 485 allocs 485 allocs ⚪ 0%
text_composition_test/ (ns/op) 31389.00 ns 32412.00 ns 🔴 +3.26%
text_composition_test/ (B/op) 18.75 KB 18.80 KB 🔴 +0.26%
text_composition_test/ (allocs/op) 502 allocs 502 allocs ⚪ 0%
rich_text_test/ (ns/op) 86962.00 ns 85694.00 ns 🟢 -1.46%
rich_text_test/ (B/op) 39.41 KB 39.45 KB 🔴 +0.12%
rich_text_test/ (allocs/op) 1,147 allocs 1,147 allocs ⚪ 0%
counter_test/ (ns/op) 18075.00 ns 18232.00 ns 🔴 +0.87%
counter_test/ (B/op) 11.86 KB 11.86 KB ⚪ 0%
counter_test/ (allocs/op) 254 allocs 254 allocs ⚪ 0%
text_edit_gc_100/ (ns/op) 1.38 ms 1.38 ms 🟢 -0.02%
text_edit_gc_100/ (B/op) 864.90 KB 864.98 KB ⚪ 0%
text_edit_gc_100/ (allocs/op) 17,282 allocs 17,283 allocs ⚪ 0%
text_edit_gc_1000/ (ns/op) 52.51 ms 52.76 ms 🔴 +0.48%
text_edit_gc_1000/ (B/op) 46.84 MB 46.84 MB ⚪ 0%
text_edit_gc_1000/ (allocs/op) 185,593 allocs 186,131 allocs 🔴 +0.29%
text_split_gc_100/ (ns/op) 2.09 ms 2.10 ms 🔴 +0.17%
text_split_gc_100/ (B/op) 1.58 MB 1.58 MB ⚪ 0%
text_split_gc_100/ (allocs/op) 15,952 allocs 15,952 allocs ⚪ 0%
text_split_gc_1000/ (ns/op) 127.97 ms 126.50 ms 🟢 -1.15%
text_split_gc_1000/ (B/op) 137.79 MB 137.79 MB ⚪ 0%
text_split_gc_1000/ (allocs/op) 184,998 allocs 184,990 allocs ⚪ 0%
text_delete_all_10000/ (ns/op) 16.81 ms 15.06 ms 🟢 -10.40%
text_delete_all_10000/ (B/op) 10.58 MB 10.55 MB 🟢 -0.26%
text_delete_all_10000/ (allocs/op) 56,138 allocs 41,944 allocs 🟢 -25.28%
text_delete_all_100000/ (ns/op) 290.19 ms 244.42 ms 🟢 -15.77%
text_delete_all_100000/ (B/op) 105.54 MB 105.25 MB 🟢 -0.28%
text_delete_all_100000/ (allocs/op) 566,122 allocs 417,502 allocs 🟢 -26.25%
text_100/ (ns/op) 228221.00 ns 228304.00 ns 🔴 +0.04%
text_100/ (B/op) 120.95 KB 121.00 KB 🔴 +0.04%
text_100/ (allocs/op) 5,182 allocs 5,182 allocs ⚪ 0%
text_1000/ (ns/op) 2.43 ms 2.52 ms 🔴 +3.54%
text_1000/ (B/op) 1.16 MB 1.16 MB 🔴 +0.35%
text_1000/ (allocs/op) 51,085 allocs 53,087 allocs 🔴 +3.92%
array_1000/ (ns/op) 1.24 ms 1.27 ms 🔴 +2.53%
array_1000/ (B/op) 1.09 MB 1.09 MB 🔴 +0.02%
array_1000/ (allocs/op) 11,880 allocs 11,880 allocs ⚪ 0%
array_10000/ (ns/op) 13.36 ms 13.90 ms 🔴 +4.04%
array_10000/ (B/op) 9.89 MB 9.89 MB ⚪ 0%
array_10000/ (allocs/op) 120,736 allocs 120,733 allocs ⚪ 0%
array_gc_100/ (ns/op) 131033.00 ns 132244.00 ns 🔴 +0.92%
array_gc_100/ (B/op) 99.93 KB 99.99 KB 🔴 +0.06%
array_gc_100/ (allocs/op) 1,267 allocs 1,267 allocs ⚪ 0%
array_gc_1000/ (ns/op) 1.41 ms 1.43 ms 🔴 +1.78%
array_gc_1000/ (B/op) 1.14 MB 1.14 MB ⚪ 0%
array_gc_1000/ (allocs/op) 12,927 allocs 12,927 allocs ⚪ 0%
counter_1000/ (ns/op) 199973.00 ns 200671.00 ns 🔴 +0.35%
counter_1000/ (B/op) 178.18 KB 178.19 KB ⚪ 0%
counter_1000/ (allocs/op) 5,772 allocs 5,772 allocs ⚪ 0%
counter_10000/ (ns/op) 2.14 ms 2.15 ms 🔴 +0.46%
counter_10000/ (B/op) 2.07 MB 2.07 MB ⚪ 0%
counter_10000/ (allocs/op) 59,779 allocs 59,779 allocs ⚪ 0%
object_1000/ (ns/op) 1.41 ms 1.40 ms 🟢 -0.40%
object_1000/ (B/op) 1.44 MB 1.44 MB ⚪ 0%
object_1000/ (allocs/op) 9,926 allocs 9,926 allocs ⚪ 0%
object_10000/ (ns/op) 14.97 ms 15.45 ms 🔴 +3.20%
object_10000/ (B/op) 12.35 MB 12.35 MB ⚪ 0%
object_10000/ (allocs/op) 101,232 allocs 101,230 allocs ⚪ 0%
tree_100/ (ns/op) 1.04 ms 1.03 ms 🟢 -0.96%
tree_100/ (B/op) 951.08 KB 951.08 KB ⚪ 0%
tree_100/ (allocs/op) 6,103 allocs 6,103 allocs ⚪ 0%
tree_1000/ (ns/op) 74.45 ms 73.79 ms 🟢 -0.88%
tree_1000/ (B/op) 86.58 MB 86.58 MB ⚪ 0%
tree_1000/ (allocs/op) 60,113 allocs 60,113 allocs ⚪ 0%
tree_10000/ (ns/op) 9.39 s 9.49 s 🔴 +1.06%
tree_10000/ (B/op) 8.58 GB 8.58 GB ⚪ 0%
tree_10000/ (allocs/op) 600,205 allocs 600,176 allocs ⚪ 0%
tree_delete_all_1000/ (ns/op) 77.01 ms 76.21 ms 🟢 -1.04%
tree_delete_all_1000/ (B/op) 87.57 MB 87.57 MB ⚪ 0%
tree_delete_all_1000/ (allocs/op) 75,291 allocs 75,291 allocs ⚪ 0%
tree_edit_gc_100/ (ns/op) 3.83 ms 3.83 ms 🔴 +0.11%
tree_edit_gc_100/ (B/op) 4.15 MB 4.15 MB ⚪ 0%
tree_edit_gc_100/ (allocs/op) 15,147 allocs 15,147 allocs ⚪ 0%
tree_edit_gc_1000/ (ns/op) 314.96 ms 305.02 ms 🟢 -3.16%
tree_edit_gc_1000/ (B/op) 384.04 MB 384.04 MB ⚪ 0%
tree_edit_gc_1000/ (allocs/op) 154,937 allocs 154,942 allocs ⚪ 0%
tree_split_gc_100/ (ns/op) 2.59 ms 2.62 ms 🔴 +0.80%
tree_split_gc_100/ (B/op) 2.41 MB 2.41 MB ⚪ 0%
tree_split_gc_100/ (allocs/op) 11,132 allocs 11,132 allocs ⚪ 0%
tree_split_gc_1000/ (ns/op) 189.14 ms 187.48 ms 🟢 -0.88%
tree_split_gc_1000/ (B/op) 222.50 MB 222.50 MB ⚪ 0%
tree_split_gc_1000/ (allocs/op) 122,064 allocs 122,056 allocs ⚪ 0%
BenchmarkRPC
Benchmark suite Previous Current Change
client_to_server/ (ns/op) 420.53 ms 417.58 ms 🟢 -0.70%
client_to_server/ (B/op) 17.87 MB 16.13 MB 🟢 -9.71%
client_to_server/ (allocs/op) 223,725 allocs 223,540 allocs 🟢 -0.08%
client_to_client_via_server/ (ns/op) 771.40 ms 781.38 ms 🔴 +1.29%
client_to_client_via_server/ (B/op) 39.09 MB 35.50 MB 🟢 -9.18%
client_to_client_via_server/ (allocs/op) 470,568 allocs 475,096 allocs 🔴 +0.96%
attach_large_document/ (ns/op) 1.26 s 1.30 s 🔴 +2.91%
attach_large_document/ (B/op) 1.90 GB 1.91 GB 🔴 +0.56%
attach_large_document/ (allocs/op) 12,439 allocs 12,537 allocs 🔴 +0.79%
adminCli_to_server/ (ns/op) 543.02 ms 545.61 ms 🔴 +0.48%
adminCli_to_server/ (B/op) 21.30 MB 21.71 MB 🔴 +1.90%
adminCli_to_server/ (allocs/op) 316,652 allocs 316,689 allocs 🔴 +0.01%
BenchmarkLocker
Benchmark suite Previous Current Change
(ns/op) 85.81 ns 81.28 ns 🟢 -5.28%
(B/op) 32.00 B 32.00 B ⚪ 0%
(allocs/op) 1 allocs 1 allocs ⚪ 0%
BenchmarkLockerParallel
Benchmark suite Previous Current Change
(ns/op) 45.89 ns 45.58 ns 🟢 -0.68%
(B/op) 0.00 B 0.00 B ⚪ 0%
(allocs/op) 0 allocs 0 allocs ⚪ 0%
BenchmarkLockerMoreKeys
Benchmark suite Previous Current Change
(ns/op) 187.90 ns 179.80 ns 🟢 -4.31%
(B/op) 30.00 B 31.00 B 🔴 +3.33%
(allocs/op) 0 allocs 0 allocs ⚪ 0%
BenchmarkRWLocker
Benchmark suite Previous Current Change
RWLock_rate_2/ (ns/op) 50.93 ns 49.17 ns 🟢 -3.46%
RWLock_rate_2/ (B/op) 0.00 B 0.00 B ⚪ 0%
RWLock_rate_2/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
RWLock_rate_10/ (ns/op) 45.77 ns 43.21 ns 🟢 -5.59%
RWLock_rate_10/ (B/op) 0.00 B 0.00 B ⚪ 0%
RWLock_rate_10/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
RWLock_rate_100/ (ns/op) 61.23 ns 58.94 ns 🟢 -3.74%
RWLock_rate_100/ (B/op) 2.00 B 2.00 B ⚪ 0%
RWLock_rate_100/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
RWLock_rate_1000/ (ns/op) 89.26 ns 89.12 ns 🟢 -0.16%
RWLock_rate_1000/ (B/op) 8.00 B 8.00 B ⚪ 0%
RWLock_rate_1000/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
BenchmarkChange
Benchmark suite Previous Current Change
Push_10_Changes/ (ns/op) 4.49 ms 4.51 ms 🔴 +0.60%
Push_10_Changes/ (B/op) 150.94 KB 150.80 KB 🟢 -0.09%
Push_10_Changes/ (allocs/op) 1,625 allocs 1,625 allocs ⚪ 0%
Push_100_Changes/ (ns/op) 16.40 ms 16.39 ms 🟢 -0.05%
Push_100_Changes/ (B/op) 776.10 KB 778.20 KB 🔴 +0.27%
Push_100_Changes/ (allocs/op) 8,511 allocs 8,513 allocs 🔴 +0.02%
Push_1000_Changes/ (ns/op) 131.30 ms 129.91 ms 🟢 -1.06%
Push_1000_Changes/ (B/op) 7.18 MB 7.12 MB 🟢 -0.75%
Push_1000_Changes/ (allocs/op) 79,325 allocs 79,328 allocs ⚪ 0%
Pull_10_Changes/ (ns/op) 3.69 ms 3.65 ms 🟢 -1.13%
Pull_10_Changes/ (B/op) 124.60 KB 124.50 KB 🟢 -0.08%
Pull_10_Changes/ (allocs/op) 1,454 allocs 1,454 allocs ⚪ 0%
Pull_100_Changes/ (ns/op) 5.26 ms 5.25 ms 🟢 -0.15%
Pull_100_Changes/ (B/op) 354.65 KB 354.92 KB 🔴 +0.08%
Pull_100_Changes/ (allocs/op) 5,180 allocs 5,180 allocs ⚪ 0%
Pull_1000_Changes/ (ns/op) 10.49 ms 10.67 ms 🔴 +1.70%
Pull_1000_Changes/ (B/op) 2.20 MB 2.20 MB 🔴 +0.01%
Pull_1000_Changes/ (allocs/op) 44,680 allocs 44,679 allocs ⚪ 0%
BenchmarkSnapshot
Benchmark suite Previous Current Change
Push_3KB_snapshot/ (ns/op) 18.53 ms 18.66 ms 🔴 +0.73%
Push_3KB_snapshot/ (B/op) 902.00 KB 907.61 KB 🔴 +0.62%
Push_3KB_snapshot/ (allocs/op) 8,514 allocs 8,516 allocs 🔴 +0.02%
Push_30KB_snapshot/ (ns/op) 132.49 ms 134.14 ms 🔴 +1.24%
Push_30KB_snapshot/ (B/op) 8.01 MB 8.07 MB 🔴 +0.73%
Push_30KB_snapshot/ (allocs/op) 86,458 allocs 87,347 allocs 🔴 +1.03%
Pull_3KB_snapshot/ (ns/op) 7.36 ms 7.38 ms 🔴 +0.26%
Pull_3KB_snapshot/ (B/op) 1.06 MB 1.06 MB 🔴 +0.09%
Pull_3KB_snapshot/ (allocs/op) 19,256 allocs 19,258 allocs 🔴 +0.01%
Pull_30KB_snapshot/ (ns/op) 19.29 ms 19.10 ms 🟢 -0.98%
Pull_30KB_snapshot/ (B/op) 8.77 MB 8.77 MB 🔴 +0.07%
Pull_30KB_snapshot/ (allocs/op) 185,629 allocs 185,673 allocs 🔴 +0.02%
BenchmarkSplayTree
Benchmark suite Previous Current Change
stress_test_100000/ (ns/op) 0.20 ns 0.20 ns 🔴 +2.40%
stress_test_100000/ (B/op) 0.00 B 0.00 B ⚪ 0%
stress_test_100000/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
stress_test_200000/ (ns/op) 0.38 ns 0.38 ns 🟢 -1.52%
stress_test_200000/ (B/op) 0.00 B 0.00 B ⚪ 0%
stress_test_200000/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
stress_test_300000/ (ns/op) 0.60 ns 0.58 ns 🟢 -3.66%
stress_test_300000/ (B/op) 0.00 B 0.00 B ⚪ 0%
stress_test_300000/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
random_access_100000/ (ns/op) 0.01 ns 0.01 ns 🔴 +0.87%
random_access_100000/ (B/op) 0.00 B 0.00 B ⚪ 0%
random_access_100000/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
random_access_200000/ (ns/op) 0.03 ns 0.03 ns 🔴 +6.80%
random_access_200000/ (B/op) 0.00 B 0.00 B ⚪ 0%
random_access_200000/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
random_access_300000/ (ns/op) 0.04 ns 0.04 ns 🟢 -6.82%
random_access_300000/ (B/op) 0.00 B 0.00 B ⚪ 0%
random_access_300000/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
editing_trace_bench/ (ns/op) 0.00 ns 0.00 ns 🔴 +14.30%
editing_trace_bench/ (B/op) 0.00 B 0.00 B ⚪ 0%
editing_trace_bench/ (allocs/op) 0 allocs 0 allocs ⚪ 0%
BenchmarkSync
Benchmark suite Previous Current Change
memory_sync_10_test/ (ns/op) 7057.00 ns 7118.00 ns 🔴 +0.86%
memory_sync_10_test/ (B/op) 1.34 KB 1.34 KB ⚪ 0%
memory_sync_10_test/ (allocs/op) 35 allocs 35 allocs ⚪ 0%
memory_sync_100_test/ (ns/op) 54760.00 ns 55443.00 ns 🔴 +1.25%
memory_sync_100_test/ (B/op) 9.53 KB 9.52 KB 🟢 -0.10%
memory_sync_100_test/ (allocs/op) 269 allocs 268 allocs 🟢 -0.37%
memory_sync_1000_test/ (ns/op) 617621.00 ns 611725.00 ns 🟢 -0.95%
memory_sync_1000_test/ (B/op) 75.63 KB 76.21 KB 🔴 +0.77%
memory_sync_1000_test/ (allocs/op) 2,103 allocs 2,120 allocs 🔴 +0.81%
memory_sync_10000_test/ (ns/op) 7.83 ms 7.78 ms 🟢 -0.73%
memory_sync_10000_test/ (B/op) 752.23 KB 766.18 KB 🔴 +1.85%
memory_sync_10000_test/ (allocs/op) 20,417 allocs 20,607 allocs 🔴 +0.93%
BenchmarkTextEditing
Benchmark suite Previous Current Change
(ns/op) 5.20 s 5.29 s 🔴 +1.80%
(B/op) 3.92 GB 3.92 GB ⚪ 0%
(allocs/op) 20,619,784 allocs 20,600,728 allocs 🟢 -0.09%
BenchmarkTree
Benchmark suite Previous Current Change
10000_vertices_to_protobuf/ (ns/op) 4.29 ms 4.37 ms 🔴 +1.72%
10000_vertices_to_protobuf/ (B/op) 6.36 MB 6.36 MB ⚪ 0%
10000_vertices_to_protobuf/ (allocs/op) 70,025 allocs 70,025 allocs ⚪ 0%
10000_vertices_from_protobuf/ (ns/op) 222.46 ms 229.04 ms 🔴 +2.96%
10000_vertices_from_protobuf/ (B/op) 442.31 MB 442.31 MB ⚪ 0%
10000_vertices_from_protobuf/ (allocs/op) 290,039 allocs 290,039 allocs ⚪ 0%
20000_vertices_to_protobuf/ (ns/op) 9.14 ms 10.15 ms 🔴 +11.10%
20000_vertices_to_protobuf/ (B/op) 12.89 MB 12.89 MB ⚪ 0%
20000_vertices_to_protobuf/ (allocs/op) 140,028 allocs 140,028 allocs ⚪ 0%
20000_vertices_from_protobuf/ (ns/op) 877.37 ms 888.87 ms 🔴 +1.31%
20000_vertices_from_protobuf/ (B/op) 1.70 GB 1.70 GB ⚪ 0%
20000_vertices_from_protobuf/ (allocs/op) 580,090 allocs 580,088 allocs ⚪ 0%
30000_vertices_to_protobuf/ (ns/op) 13.15 ms 14.63 ms 🔴 +11.27%
30000_vertices_to_protobuf/ (B/op) 18.98 MB 18.98 MB ⚪ 0%
30000_vertices_to_protobuf/ (allocs/op) 210,029 allocs 210,029 allocs ⚪ 0%
30000_vertices_from_protobuf/ (ns/op) 2.02 s 1.98 s 🟢 -1.91%
30000_vertices_from_protobuf/ (B/op) 3.75 GB 3.75 GB ⚪ 0%
30000_vertices_from_protobuf/ (allocs/op) 870,086 allocs 870,057 allocs ⚪ 0%
BenchmarkVersionVector
Benchmark suite Previous Current Change
clients_10/ (ns/op) 157.85 ms 160.57 ms 🔴 +1.72%
clients_10/ (1_changepack(bytes)) 745.00 B 745.00 B ⚪ 0%
clients_10/ (2_snapshot(bytes)) 379.00 B 379.00 B ⚪ 0%
clients_10/ (3_pushpull(ms)) 7.00 ms 8.00 ms 🔴 +14.29%
clients_10/ (4_attach(ms)) 6.00 ms 6.00 ms ⚪ 0%
clients_10/ (5_changepack_after_detach(bytes)) 805.00 B 805.00 B ⚪ 0%
clients_10/ (6_snapshot_after_detach(bytes)) 136.00 B 136.00 B ⚪ 0%
clients_10/ (7_pushpull_after_detach(ms)) 8.00 ms 8.00 ms ⚪ 0%
clients_10/ (B/op) 20.71 MB 20.02 MB 🟢 -3.34%
clients_10/ (allocs/op) 83,248 allocs 83,235 allocs 🟢 -0.02%
clients_100/ (ns/op) 1.39 s 1.44 s 🔴 +3.52%
clients_100/ (1_changepack(bytes)) 6.14 KB 6.14 KB ⚪ 0%
clients_100/ (2_snapshot(bytes)) 3.08 KB 3.08 KB ⚪ 0%
clients_100/ (3_pushpull(ms)) 11.00 ms 12.00 ms 🔴 +9.09%
clients_100/ (4_attach(ms)) 9.00 ms 9.00 ms ⚪ 0%
clients_100/ (5_changepack_after_detach(bytes)) 6.21 KB 6.21 KB ⚪ 0%
clients_100/ (6_snapshot_after_detach(bytes)) 137.00 B 137.00 B ⚪ 0%
clients_100/ (7_pushpull_after_detach(ms)) 9.00 ms 9.00 ms ⚪ 0%
clients_100/ (B/op) 213.58 MB 217.63 MB 🔴 +1.90%
clients_100/ (allocs/op) 1,481,342 allocs 1,481,311 allocs ⚪ 0%
clients_1000/ (ns/op) 42.35 s 44.01 s 🔴 +3.93%
clients_1000/ (1_changepack(bytes)) 60.16 KB 60.16 KB ⚪ 0%
clients_1000/ (2_snapshot(bytes)) 30.08 KB 30.08 KB ⚪ 0%
clients_1000/ (3_pushpull(ms)) 116.00 ms 115.00 ms 🟢 -0.86%
clients_1000/ (4_attach(ms)) 72.00 ms 74.00 ms 🔴 +2.78%
clients_1000/ (5_changepack_after_detach(bytes)) 60.22 KB 60.22 KB ⚪ 0%
clients_1000/ (6_snapshot_after_detach(bytes)) 139.00 B 139.00 B ⚪ 0%
clients_1000/ (7_pushpull_after_detach(ms)) 27.00 ms 22.00 ms 🟢 -18.52%
clients_1000/ (B/op) 6.43 GB 6.43 GB ⚪ 0%
clients_1000/ (allocs/op) 93,354,528 allocs 93,355,142 allocs ⚪ 0%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🌟 New feature or request
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

Improve performance of Splay Tree in crdt.Text data structure to prevent skewness
4 participants