Skip to content

Commit

Permalink
Apply the comment
Browse files Browse the repository at this point in the history
1. integrate text, counter, tree type interface
2. decouple the build json from buildCRDTElement
3. fix duplicated deregister
4. relevant testcode update
  • Loading branch information
highcloud100 committed Jan 10, 2024
1 parent 085c495 commit a7e7c90
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 72 deletions.
27 changes: 5 additions & 22 deletions pkg/document/crdt/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,14 @@ func (r *Root) RegisterElement(element Element) {
}

// DeregisterElement deregister the given element from hash tables.
func (r *Root) DeregisterElement(element Element) {
func (r *Root) DeregisterElement(element Element) int {
count := 0

deregisterElementInternal := func(elem Element) {
createdAt := elem.CreatedAt().Key()
delete(r.elementMapByCreatedAt, createdAt)
delete(r.removedElementPairMapByCreatedAt, createdAt)
count++
}

deregisterElementInternal(element)
Expand All @@ -111,6 +113,7 @@ func (r *Root) DeregisterElement(element Element) {
}
}

return count
}

// RegisterRemovedElementPair register the given element pair to hash table.
Expand Down Expand Up @@ -145,7 +148,7 @@ func (r *Root) GarbageCollect(ticket *time.Ticket) (int, error) {
return 0, err
}

count += r.garbageCollect(pair.elem)
count += r.DeregisterElement(pair.elem)
}
}

Expand Down Expand Up @@ -200,23 +203,3 @@ func (r *Root) GarbageLen() int {

return count
}

func (r *Root) garbageCollect(elem Element) int {
count := 0

callback := func(elem Element, parent Container) bool {
r.DeregisterElement(elem)
count++
return false
}

callback(elem, nil)
switch elem := elem.(type) {
case *Object:
elem.Descendants(callback)
case *Array:
elem.Descendants(callback)
}

return count
}
32 changes: 17 additions & 15 deletions pkg/document/json/counter.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,25 @@ import (
// it is used when the user manipulates the counter from the outside.
type Counter struct {
*crdt.Counter
context *change.Context
context *change.Context
valueType crdt.CounterType
value interface{}
}

// CreateCounter creates a new instance of Counter without context, crdt.Counter
func CreateCounter(t crdt.CounterType, n interface{}) *Counter {
return &Counter{
valueType: t,
value: n,
}
}

// InitializeCounter initializes Counter instance.
// func (p *Counter) InitializeCounter(ctx *change.Context, counter *crdt.Counter) {
// p.Counter = counter
// p.context = ctx
// }

// NewCounter create Counter instance.
func NewCounter(ctx *change.Context, counter *crdt.Counter) *Counter {
if !counter.IsNumericType() {
Expand All @@ -42,20 +58,6 @@ func NewCounter(ctx *change.Context, counter *crdt.Counter) *Counter {
}
}

// TempCounter is a transmission object for creating a counter inside.
type TempCounter struct {
valueType crdt.CounterType
value interface{}
}

// NewTempCounter creates a new instance of TempCounter.
func NewTempCounter(t crdt.CounterType, n interface{}) *TempCounter {
return &TempCounter{
valueType: t,
value: n,
}
}

// Increase adds an increase operations.
// Only numeric types are allowed as operand values, excluding
// uint64 and uintptr.
Expand Down
46 changes: 27 additions & 19 deletions pkg/document/json/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,25 @@ func toOriginal(elem crdt.Element) crdt.Element {
panic("unsupported type")
}

func toElement(ctx *change.Context, elem crdt.Element) crdt.Element {
switch elem := elem.(type) {
case *crdt.Object:
return NewObject(ctx, elem)
case *crdt.Array:
return NewArray(ctx, elem)
case *crdt.Text:
return NewText(ctx, elem)
case *crdt.Counter:
return NewCounter(ctx, elem)
case *crdt.Tree:
return NewTree(ctx, elem)
case *crdt.Primitive:
return elem
}

panic("unsupported type")
}

func buildCRDTElement(
context *change.Context,
value interface{},
Expand All @@ -59,53 +78,42 @@ func buildCRDTElement(
return primitive

case *TreeNode:

return NewTree(context, crdt.NewTree(buildRoot(context, elem, ticket), ticket))

return crdt.NewTree(buildRoot(context, elem, ticket), ticket)
case *Text:
return NewText(context, crdt.NewText(crdt.NewRGATreeSplit(crdt.InitialTextNode()), ticket))
case *TempCounter:
return crdt.NewText(crdt.NewRGATreeSplit(crdt.InitialTextNode()), ticket)
case *Counter:
switch elem.valueType {
case crdt.IntegerCnt:
counter, err := crdt.NewCounter(crdt.IntegerCnt, elem.value, ticket)
if err != nil {
panic(err)
}
return NewCounter(
context,
counter,
)
return counter
case crdt.LongCnt:
counter, err := crdt.NewCounter(crdt.LongCnt, elem.value, ticket)
if err != nil {
panic(err)
}
return NewCounter(
context,
counter,
)
return counter
default:
panic("unsupported type")
panic("unsupported counter type ")
}

case []interface{}:
array := NewArray(context, crdt.NewArray(crdt.NewRGATreeList(), ticket))
array := crdt.NewArray(crdt.NewRGATreeList(), ticket)
for _, v := range elem {
ticket := context.IssueTimeTicket()
value := buildCRDTElement(context, v, ticket)
value = toOriginal(value)
if err := array.InsertAfter(array.LastCreatedAt(), value); err != nil {
panic(err)
}
array.context.RegisterElement(value)
}
return array
case map[string]interface{}:
obj := NewObject(context, crdt.NewObject(crdt.NewElementRHT(), ticket))
obj := crdt.NewObject(crdt.NewElementRHT(), ticket)
members := buildObjectMember(context, elem)

for key, value := range members {
value = toOriginal(value)
_ = obj.Set(key, value)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/document/json/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (p *Object) SetNewObject(kv ...interface{}) *Object {
k := kv[0].(string)
v := p.setInternal(k, func(ticket *time.Ticket) crdt.Element {
json := kv[1].(map[string]interface{})
return buildCRDTElement(p.context, json, ticket)
return toElement(p.context, buildCRDTElement(p.context, json, ticket))
})

return v.(*Object)
Expand Down
5 changes: 5 additions & 0 deletions pkg/document/json/text.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ func NewText(ctx *change.Context, text *crdt.Text) *Text {
}
}

// CreateText creates a new instance of Text for json literal.
func CreateText() *Text {
return NewText(nil, nil)
}

// CreateRange creates a range from the given positions.
func (p *Text) CreateRange(from, to int) (*crdt.RGATreeSplitNodePos, *crdt.RGATreeSplitNodePos) {
fromPos, toPos, err := p.Text.CreateRange(from, to)
Expand Down
5 changes: 5 additions & 0 deletions pkg/document/json/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ func NewTree(ctx *change.Context, tree *crdt.Tree) *Tree {
}
}

// CreateTree creates a new instance of Tree for json literal.
func CreateTree(root *TreeNode) *TreeNode {
return root
}

// validateTextNode make sure that text node have non-empty string value
func validateTextNode(treeNode TreeNode) error {
if len(treeNode.Value) == 0 {
Expand Down
87 changes: 72 additions & 15 deletions test/integration/object_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ func TestObject(t *testing.T) {
"obj": map[string]interface{}{ // 2 : object, double
"key3": 42.2,
},
"cnt": json.NewTempCounter(crdt.LongCnt, 0), // 1
"txt": json.NewText(nil, nil), // 1
"cnt": json.CreateCounter(crdt.LongCnt, 0), // 1
"txt": json.NewText(nil, nil), // 1
}
root.SetNewObject("shape", data)
root.GetObject("shape").SetString("key", "changed") // 1 tombstone
Expand Down Expand Up @@ -228,11 +228,11 @@ func TestObject(t *testing.T) {

assert.NoError(t, err)

assert.Equal(t, d1.GarbageLen(), 11)
assert.Equal(t, d1.GarbageCollect(time.MaxTicket), 11)
assert.Equal(t, 11, d1.GarbageLen())
assert.Equal(t, 11, d1.GarbageCollect(time.MaxTicket))

assert.Equal(t, d2.GarbageLen(), 11)
assert.Equal(t, d2.GarbageCollect(time.MaxTicket), 11)
assert.Equal(t, 11, d2.GarbageLen())
assert.Equal(t, 11, d2.GarbageCollect(time.MaxTicket))

})

Expand All @@ -250,7 +250,7 @@ func TestObject(t *testing.T) {
err = d1.Update(func(root *json.Object, p *presence.Presence) error {

data := map[string]interface{}{
"tree": &json.TreeNode{
"tree": json.CreateTree(&json.TreeNode{
Type: "doc",
Children: []json.TreeNode{{
Type: "p",
Expand All @@ -265,7 +265,7 @@ func TestObject(t *testing.T) {
Type: "bp",
Children: []json.TreeNode{{Type: "text", Value: "gh"}},
}},
},
}),
}

root.SetNewObject("shape", data)
Expand All @@ -288,8 +288,8 @@ func TestObject(t *testing.T) {
})
assert.NoError(t, err)

assert.Equal(t, d1.GarbageLen(), 2)
assert.Equal(t, d1.GarbageCollect(time.MaxTicket), 2)
assert.Equal(t, 2, d1.GarbageLen())
assert.Equal(t, 2, d1.GarbageCollect(time.MaxTicket))
})

t.Run("Nested object sync test", func(t *testing.T) {
Expand Down Expand Up @@ -346,12 +346,12 @@ func TestObject(t *testing.T) {
err = c1.Sync(ctx)
assert.NoError(t, err)

assert.Equal(t, d1.GarbageLen(), 1)
assert.Equal(t, d1.GarbageCollect(time.MaxTicket), 1)
assert.Equal(t, 1, d1.GarbageLen())
assert.Equal(t, 1, d1.GarbageCollect(time.MaxTicket))

})

t.Run("nested object set/delete", func(t *testing.T) {
t.Run("Nested object set/delete test", func(t *testing.T) {
ctx := context.Background()
d1 := document.New(helper.TestDocKey(t))
err := c1.Attach(ctx, d1)
Expand Down Expand Up @@ -384,7 +384,7 @@ func TestObject(t *testing.T) {
syncClientsThenAssertEqual(t, []clientAndDocPair{{c1, d1}, {c2, d2}})
})

t.Run("nested object nil type", func(t *testing.T) {
t.Run("Nested object nil type test", func(t *testing.T) {
ctx := context.Background()
d1 := document.New(helper.TestDocKey(t))
err := c1.Attach(ctx, d1)
Expand All @@ -399,7 +399,64 @@ func TestObject(t *testing.T) {
})

assert.NoError(t, err)
assert.Equal(t, d1.Marshal(), `{"obj":{"emptry":null}}`)
assert.Equal(t, `{"obj":{"emptry":null}}`, d1.Marshal())
})

t.Run("Nested object array type test", func(t *testing.T) {
ctx := context.Background()
d1 := document.New(helper.TestDocKey(t))
err := c1.Attach(ctx, d1)
assert.NoError(t, err)

err = d1.Update(func(root *json.Object, p *presence.Presence) error {
json := map[string]interface{}{
"array": []interface{}{1, 2, 3},
}
root.SetNewObject("obj", json)
root.GetObject("obj").GetArray("array").AddInteger(4, 5)
return nil
})

assert.NoError(t, err)
assert.Equal(t, `{"obj":{"array":[1,2,3,4,5]}}`, d1.Marshal())
})

t.Run("Nested object counter type test", func(t *testing.T) {
ctx := context.Background()
d1 := document.New(helper.TestDocKey(t))
err := c1.Attach(ctx, d1)
assert.NoError(t, err)

err = d1.Update(func(root *json.Object, p *presence.Presence) error {
json := map[string]interface{}{
"counter": json.CreateCounter(crdt.LongCnt, 0),
}
root.SetNewObject("obj", json)
root.GetObject("obj").GetCounter("counter").Increase(3)
return nil
})

assert.NoError(t, err)
assert.Equal(t, `{"obj":{"counter":3}}`, d1.Marshal())
})

t.Run("Nested object text type test", func(t *testing.T) {
ctx := context.Background()
d1 := document.New(helper.TestDocKey(t))
err := c1.Attach(ctx, d1)
assert.NoError(t, err)

err = d1.Update(func(root *json.Object, p *presence.Presence) error {
json := map[string]interface{}{
"text": json.CreateText(),
}
root.SetNewObject("obj", json)
root.GetObject("obj").GetText("text").Edit(0, 0, "ABCD")
return nil
})

assert.NoError(t, err)
assert.Equal(t, `{"obj":{"text":[{"val":"ABCD"}]}}`, d1.Marshal())
})

}

1 comment on commit a7e7c90

@github-actions
Copy link

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: a7e7c90 Previous: a8c58f9 Ratio
BenchmarkDocument/constructor_test - ns/op 1441 ns/op 1457 ns/op 0.99
BenchmarkDocument/constructor_test - B/op 1224 B/op 1224 B/op 1
BenchmarkDocument/constructor_test - allocs/op 21 allocs/op 21 allocs/op 1
BenchmarkDocument/status_test - ns/op 831.5 ns/op 849.5 ns/op 0.98
BenchmarkDocument/status_test - B/op 1192 B/op 1192 B/op 1
BenchmarkDocument/status_test - allocs/op 19 allocs/op 19 allocs/op 1
BenchmarkDocument/equals_test - ns/op 7339 ns/op 7524 ns/op 0.98
BenchmarkDocument/equals_test - B/op 6977 B/op 6977 B/op 1
BenchmarkDocument/equals_test - allocs/op 124 allocs/op 124 allocs/op 1
BenchmarkDocument/nested_update_test - ns/op 16624 ns/op 18601 ns/op 0.89
BenchmarkDocument/nested_update_test - B/op 12059 B/op 12059 B/op 1
BenchmarkDocument/nested_update_test - allocs/op 260 allocs/op 260 allocs/op 1
BenchmarkDocument/delete_test - ns/op 22273 ns/op 22335 ns/op 1.00
BenchmarkDocument/delete_test - B/op 15284 B/op 15284 B/op 1
BenchmarkDocument/delete_test - allocs/op 339 allocs/op 339 allocs/op 1
BenchmarkDocument/object_test - ns/op 8501 ns/op 8516 ns/op 1.00
BenchmarkDocument/object_test - B/op 6753 B/op 6753 B/op 1
BenchmarkDocument/object_test - allocs/op 118 allocs/op 118 allocs/op 1
BenchmarkDocument/array_test - ns/op 31578 ns/op 28781 ns/op 1.10
BenchmarkDocument/array_test - B/op 11883 B/op 11883 B/op 1
BenchmarkDocument/array_test - allocs/op 274 allocs/op 274 allocs/op 1
BenchmarkDocument/text_test - ns/op 30332 ns/op 30487 ns/op 0.99
BenchmarkDocument/text_test - B/op 14916 B/op 14828 B/op 1.01
BenchmarkDocument/text_test - allocs/op 470 allocs/op 470 allocs/op 1
BenchmarkDocument/text_composition_test - ns/op 28782 ns/op 28865 ns/op 1.00
BenchmarkDocument/text_composition_test - B/op 18428 B/op 18310 B/op 1.01
BenchmarkDocument/text_composition_test - allocs/op 479 allocs/op 479 allocs/op 1
BenchmarkDocument/rich_text_test - ns/op 79956 ns/op 80677 ns/op 0.99
BenchmarkDocument/rich_text_test - B/op 38677 B/op 38572 B/op 1.00
BenchmarkDocument/rich_text_test - allocs/op 1149 allocs/op 1149 allocs/op 1
BenchmarkDocument/counter_test - ns/op 16791 ns/op 16759 ns/op 1.00
BenchmarkDocument/counter_test - B/op 10466 B/op 10242 B/op 1.02
BenchmarkDocument/counter_test - allocs/op 238 allocs/op 238 allocs/op 1
BenchmarkDocument/text_edit_gc_100 - ns/op 2953612 ns/op 2887897 ns/op 1.02
BenchmarkDocument/text_edit_gc_100 - B/op 1658339 B/op 1655169 B/op 1.00
BenchmarkDocument/text_edit_gc_100 - allocs/op 17094 allocs/op 17094 allocs/op 1
BenchmarkDocument/text_edit_gc_1000 - ns/op 231701032 ns/op 229415441 ns/op 1.01
BenchmarkDocument/text_edit_gc_1000 - B/op 144381641 B/op 144344868 B/op 1.00
BenchmarkDocument/text_edit_gc_1000 - allocs/op 200938 allocs/op 200908 allocs/op 1.00
BenchmarkDocument/text_split_gc_100 - ns/op 3368740 ns/op 3374708 ns/op 1.00
BenchmarkDocument/text_split_gc_100 - B/op 2316508 B/op 2313351 B/op 1.00
BenchmarkDocument/text_split_gc_100 - allocs/op 16194 allocs/op 16195 allocs/op 1.00
BenchmarkDocument/text_split_gc_1000 - ns/op 288176074 ns/op 287430465 ns/op 1.00
BenchmarkDocument/text_split_gc_1000 - B/op 228929652 B/op 228891160 B/op 1.00
BenchmarkDocument/text_split_gc_1000 - allocs/op 203999 allocs/op 203934 allocs/op 1.00
BenchmarkDocument/text_delete_all_10000 - ns/op 11057653 ns/op 10779697 ns/op 1.03
BenchmarkDocument/text_delete_all_10000 - B/op 5810596 B/op 5809238 B/op 1.00
BenchmarkDocument/text_delete_all_10000 - allocs/op 40674 allocs/op 40669 allocs/op 1.00
BenchmarkDocument/text_delete_all_100000 - ns/op 188531110 ns/op 188925896 ns/op 1.00
BenchmarkDocument/text_delete_all_100000 - B/op 81906141 B/op 81910706 B/op 1.00
BenchmarkDocument/text_delete_all_100000 - allocs/op 411640 allocs/op 411662 allocs/op 1.00
BenchmarkDocument/text_100 - ns/op 231275 ns/op 229354 ns/op 1.01
BenchmarkDocument/text_100 - B/op 120139 B/op 118514 B/op 1.01
BenchmarkDocument/text_100 - allocs/op 5082 allocs/op 5082 allocs/op 1
BenchmarkDocument/text_1000 - ns/op 2513218 ns/op 2502759 ns/op 1.00
BenchmarkDocument/text_1000 - B/op 1169126 B/op 1153102 B/op 1.01
BenchmarkDocument/text_1000 - allocs/op 50086 allocs/op 50086 allocs/op 1
BenchmarkDocument/array_1000 - ns/op 1304358 ns/op 1262770 ns/op 1.03
BenchmarkDocument/array_1000 - B/op 1091345 B/op 1091147 B/op 1.00
BenchmarkDocument/array_1000 - allocs/op 11830 allocs/op 11829 allocs/op 1.00
BenchmarkDocument/array_10000 - ns/op 13539712 ns/op 13221008 ns/op 1.02
BenchmarkDocument/array_10000 - B/op 9799951 B/op 9799195 B/op 1.00
BenchmarkDocument/array_10000 - allocs/op 120294 allocs/op 120291 allocs/op 1.00
BenchmarkDocument/array_gc_100 - ns/op 154947 ns/op 172372 ns/op 0.90
BenchmarkDocument/array_gc_100 - B/op 132663 B/op 139899 B/op 0.95
BenchmarkDocument/array_gc_100 - allocs/op 1259 allocs/op 1472 allocs/op 0.86
BenchmarkDocument/array_gc_1000 - ns/op 1464722 ns/op 1651513 ns/op 0.89
BenchmarkDocument/array_gc_1000 - B/op 1159216 B/op 1241466 B/op 0.93
BenchmarkDocument/array_gc_1000 - allocs/op 12875 allocs/op 14897 allocs/op 0.86
BenchmarkDocument/counter_1000 - ns/op 210626 ns/op 210894 ns/op 1.00
BenchmarkDocument/counter_1000 - B/op 192916 B/op 192884 B/op 1.00
BenchmarkDocument/counter_1000 - allocs/op 5767 allocs/op 5767 allocs/op 1
BenchmarkDocument/counter_10000 - ns/op 2198485 ns/op 2217464 ns/op 0.99
BenchmarkDocument/counter_10000 - B/op 2087848 B/op 2087814 B/op 1.00
BenchmarkDocument/counter_10000 - allocs/op 59774 allocs/op 59774 allocs/op 1
BenchmarkDocument/object_1000 - ns/op 1442235 ns/op 1442631 ns/op 1.00
BenchmarkDocument/object_1000 - B/op 1428087 B/op 1428083 B/op 1.00
BenchmarkDocument/object_1000 - allocs/op 9847 allocs/op 9847 allocs/op 1
BenchmarkDocument/object_10000 - ns/op 15183645 ns/op 15149865 ns/op 1.00
BenchmarkDocument/object_10000 - B/op 12166069 B/op 12166338 B/op 1.00
BenchmarkDocument/object_10000 - allocs/op 100560 allocs/op 100562 allocs/op 1.00
BenchmarkDocument/tree_100 - ns/op 1073924 ns/op 1068412 ns/op 1.01
BenchmarkDocument/tree_100 - B/op 943710 B/op 943709 B/op 1.00
BenchmarkDocument/tree_100 - allocs/op 6101 allocs/op 6101 allocs/op 1
BenchmarkDocument/tree_1000 - ns/op 79075518 ns/op 79029252 ns/op 1.00
BenchmarkDocument/tree_1000 - B/op 86460530 B/op 86460602 B/op 1.00
BenchmarkDocument/tree_1000 - allocs/op 60115 allocs/op 60116 allocs/op 1.00
BenchmarkDocument/tree_10000 - ns/op 9758515588 ns/op 9661149264 ns/op 1.01
BenchmarkDocument/tree_10000 - B/op 8580979016 B/op 8580973784 B/op 1.00
BenchmarkDocument/tree_10000 - allocs/op 600221 allocs/op 600230 allocs/op 1.00
BenchmarkDocument/tree_delete_all_1000 - ns/op 78464676 ns/op 79816852 ns/op 0.98
BenchmarkDocument/tree_delete_all_1000 - B/op 86991249 B/op 86990889 B/op 1.00
BenchmarkDocument/tree_delete_all_1000 - allocs/op 67755 allocs/op 67750 allocs/op 1.00
BenchmarkDocument/tree_edit_gc_100 - ns/op 3871200 ns/op 3866691 ns/op 1.00
BenchmarkDocument/tree_edit_gc_100 - B/op 4121072 B/op 4121023 B/op 1.00
BenchmarkDocument/tree_edit_gc_100 - allocs/op 14358 allocs/op 14358 allocs/op 1
BenchmarkDocument/tree_edit_gc_1000 - ns/op 327182171 ns/op 326051394 ns/op 1.00
BenchmarkDocument/tree_edit_gc_1000 - B/op 383467236 B/op 383466086 B/op 1.00
BenchmarkDocument/tree_edit_gc_1000 - allocs/op 145418 allocs/op 145407 allocs/op 1.00
BenchmarkDocument/tree_split_gc_100 - ns/op 2607363 ns/op 2611696 ns/op 1.00
BenchmarkDocument/tree_split_gc_100 - B/op 2386889 B/op 2386898 B/op 1.00
BenchmarkDocument/tree_split_gc_100 - allocs/op 10343 allocs/op 10343 allocs/op 1
BenchmarkDocument/tree_split_gc_1000 - ns/op 196740737 ns/op 196739556 ns/op 1.00
BenchmarkDocument/tree_split_gc_1000 - B/op 221990957 B/op 221991590 B/op 1.00
BenchmarkDocument/tree_split_gc_1000 - allocs/op 112257 allocs/op 112260 allocs/op 1.00
BenchmarkRPC/client_to_server - ns/op 357990239 ns/op 356144469 ns/op 1.01
BenchmarkRPC/client_to_server - B/op 16397432 B/op 17801216 B/op 0.92
BenchmarkRPC/client_to_server - allocs/op 166829 allocs/op 166911 allocs/op 1.00
BenchmarkRPC/client_to_client_via_server - ns/op 609975532 ns/op 613079232 ns/op 0.99
BenchmarkRPC/client_to_client_via_server - B/op 32121164 B/op 31722656 B/op 1.01
BenchmarkRPC/client_to_client_via_server - allocs/op 313046 allocs/op 313048 allocs/op 1.00
BenchmarkRPC/attach_large_document - ns/op 1190009625 ns/op 1479934941 ns/op 0.80
BenchmarkRPC/attach_large_document - B/op 1890020088 B/op 1890029520 B/op 1.00
BenchmarkRPC/attach_large_document - allocs/op 7563 allocs/op 7567 allocs/op 1.00
BenchmarkRPC/adminCli_to_server - ns/op 536781843 ns/op 537051132 ns/op 1.00
BenchmarkRPC/adminCli_to_server - B/op 35980868 B/op 36806452 B/op 0.98
BenchmarkRPC/adminCli_to_server - allocs/op 289645 allocs/op 289659 allocs/op 1.00
BenchmarkLocker - ns/op 63.95 ns/op 65.34 ns/op 0.98
BenchmarkLocker - B/op 16 B/op 16 B/op 1
BenchmarkLocker - allocs/op 1 allocs/op 1 allocs/op 1
BenchmarkLockerParallel - ns/op 39.98 ns/op 38.48 ns/op 1.04
BenchmarkLockerParallel - B/op 0 B/op 0 B/op NaN
BenchmarkLockerParallel - allocs/op 0 allocs/op 0 allocs/op NaN
BenchmarkLockerMoreKeys - ns/op 144.7 ns/op 145.1 ns/op 1.00
BenchmarkLockerMoreKeys - B/op 15 B/op 15 B/op 1
BenchmarkLockerMoreKeys - allocs/op 0 allocs/op 0 allocs/op NaN
BenchmarkChange/Push_10_Changes - ns/op 3777241 ns/op 3768343 ns/op 1.00
BenchmarkChange/Push_10_Changes - B/op 126100 B/op 126223 B/op 1.00
BenchmarkChange/Push_10_Changes - allocs/op 1253 allocs/op 1254 allocs/op 1.00
BenchmarkChange/Push_100_Changes - ns/op 14002735 ns/op 14005221 ns/op 1.00
BenchmarkChange/Push_100_Changes - B/op 640864 B/op 648654 B/op 0.99
BenchmarkChange/Push_100_Changes - allocs/op 6538 allocs/op 6539 allocs/op 1.00
BenchmarkChange/Push_1000_Changes - ns/op 112237043 ns/op 114047673 ns/op 0.98
BenchmarkChange/Push_1000_Changes - B/op 6198815 B/op 6036337 B/op 1.03
BenchmarkChange/Push_1000_Changes - allocs/op 62159 allocs/op 62157 allocs/op 1.00
BenchmarkChange/Pull_10_Changes - ns/op 2827571 ns/op 2839363 ns/op 1.00
BenchmarkChange/Pull_10_Changes - B/op 100726 B/op 100881 B/op 1.00
BenchmarkChange/Pull_10_Changes - allocs/op 952 allocs/op 952 allocs/op 1
BenchmarkChange/Pull_100_Changes - ns/op 4296685 ns/op 4308547 ns/op 1.00
BenchmarkChange/Pull_100_Changes - B/op 258248 B/op 258255 B/op 1.00
BenchmarkChange/Pull_100_Changes - allocs/op 3154 allocs/op 3154 allocs/op 1
BenchmarkChange/Pull_1000_Changes - ns/op 8517863 ns/op 8372656 ns/op 1.02
BenchmarkChange/Pull_1000_Changes - B/op 1395231 B/op 1396187 B/op 1.00
BenchmarkChange/Pull_1000_Changes - allocs/op 26873 allocs/op 26871 allocs/op 1.00
BenchmarkSnapshot/Push_3KB_snapshot - ns/op 16798728 ns/op 16777319 ns/op 1.00
BenchmarkSnapshot/Push_3KB_snapshot - B/op 796917 B/op 809995 B/op 0.98
BenchmarkSnapshot/Push_3KB_snapshot - allocs/op 6540 allocs/op 6542 allocs/op 1.00
BenchmarkSnapshot/Push_30KB_snapshot - ns/op 117051562 ns/op 117069671 ns/op 1.00
BenchmarkSnapshot/Push_30KB_snapshot - B/op 6300091 B/op 6250016 B/op 1.01
BenchmarkSnapshot/Push_30KB_snapshot - allocs/op 62249 allocs/op 62161 allocs/op 1.00
BenchmarkSnapshot/Pull_3KB_snapshot - ns/op 6521850 ns/op 6563310 ns/op 0.99
BenchmarkSnapshot/Pull_3KB_snapshot - B/op 905814 B/op 905174 B/op 1.00
BenchmarkSnapshot/Pull_3KB_snapshot - allocs/op 14886 allocs/op 14882 allocs/op 1.00
BenchmarkSnapshot/Pull_30KB_snapshot - ns/op 15320667 ns/op 15000336 ns/op 1.02
BenchmarkSnapshot/Pull_30KB_snapshot - B/op 6979824 B/op 6977754 B/op 1.00
BenchmarkSnapshot/Pull_30KB_snapshot - allocs/op 144147 allocs/op 144148 allocs/op 1.00
BenchmarkSync/memory_sync_10_test - ns/op 6841 ns/op 6824 ns/op 1.00
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 - ns/op 51778 ns/op 51635 ns/op 1.00
BenchmarkSync/memory_sync_100_test - B/op 8655 B/op 8659 B/op 1.00
BenchmarkSync/memory_sync_100_test - allocs/op 274 allocs/op 274 allocs/op 1
BenchmarkSync/memory_sync_1000_test - ns/op 586615 ns/op 582724 ns/op 1.01
BenchmarkSync/memory_sync_1000_test - B/op 74630 B/op 74925 B/op 1.00
BenchmarkSync/memory_sync_1000_test - allocs/op 2122 allocs/op 2141 allocs/op 0.99
BenchmarkSync/memory_sync_10000_test - ns/op 7204570 ns/op 7320373 ns/op 0.98
BenchmarkSync/memory_sync_10000_test - B/op 762001 B/op 761425 B/op 1.00
BenchmarkSync/memory_sync_10000_test - allocs/op 20587 allocs/op 20593 allocs/op 1.00
BenchmarkTextEditing - ns/op 18814863867 ns/op 18585017456 ns/op 1.01
BenchmarkTextEditing - B/op 9042198864 B/op 9037385240 B/op 1.00
BenchmarkTextEditing - allocs/op 19923595 allocs/op 19920435 allocs/op 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.