Skip to content

Commit

Permalink
Roll back Users collection sharding
Browse files Browse the repository at this point in the history
  • Loading branch information
sejongk committed Jan 22, 2024
1 parent 876787e commit 8d00c78
Show file tree
Hide file tree
Showing 16 changed files with 173 additions and 98 deletions.
6 changes: 4 additions & 2 deletions api/types/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

package types

import "time"
import (
"time"
)

// Project is a project that consists of multiple documents and clients.
type Project struct {
Expand All @@ -28,7 +30,7 @@ type Project struct {
Name string `json:"name"`

// Owner is the owner of this project.
Owner string `json:"owner"`
Owner ID `json:"owner"`

// AuthWebhookURL is the url of the authorization webhook.
AuthWebhookURL string `json:"auth_webhook_url"`
Expand Down
2 changes: 0 additions & 2 deletions build/docker/sharding/scripts/init-mongos1.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ function shardOfChunk(minKeyOfChunk) {
// Shard the database for the mongo client test
const mongoClientDB = "test-yorkie-meta-mongo-client"
sh.enableSharding(mongoClientDB)
sh.shardCollection(mongoClientDB + ".users", { username: 1 }, true)
sh.shardCollection(mongoClientDB + ".documents", { key: 1 })
sh.shardCollection(mongoClientDB + ".changes", { doc_key: 1 })
sh.shardCollection(mongoClientDB + ".snapshots", { doc_key: 1 })
Expand All @@ -31,7 +30,6 @@ db.adminCommand({ moveChunk: mongoClientDB + ".documents", find: { key: docSplit
// Shard the database for the server test
const serverDB = "test-yorkie-meta-server"
sh.enableSharding(serverDB)
sh.shardCollection(serverDB + ".users", { username: 1 }, true)
sh.shardCollection(serverDB + ".documents", { key: 1 })
sh.shardCollection(serverDB + ".changes", { doc_key: 1 })
sh.shardCollection(serverDB + ".snapshots", { doc_key: 1 })
Expand Down
15 changes: 9 additions & 6 deletions server/backend/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type Database interface {
// FindProjectInfoByName returns a project by the given name.
FindProjectInfoByName(
ctx context.Context,
owner string,
owner types.ID,
name string,
) (*ProjectInfo, error)

Expand All @@ -99,17 +99,17 @@ type Database interface {
CreateProjectInfo(
ctx context.Context,
name string,
owner string,
owner types.ID,
clientDeactivateThreshold string,
) (*ProjectInfo, error)

// ListProjectInfos returns all project infos owned by owner.
ListProjectInfos(ctx context.Context, owner string) ([]*ProjectInfo, error)
ListProjectInfos(ctx context.Context, owner types.ID) ([]*ProjectInfo, error)

// UpdateProjectInfo updates the project.
UpdateProjectInfo(
ctx context.Context,
owner string,
owner types.ID,
id types.ID,
fields *types.UpdatableProjectFields,
) (*ProjectInfo, error)
Expand All @@ -121,8 +121,11 @@ type Database interface {
hashedPassword string,
) (*UserInfo, error)

// FindUserInfo returns a user by the given username.
FindUserInfo(ctx context.Context, username string) (*UserInfo, error)
// FindUserInfoByName returns a user by the given ID.
FindUserInfoByID(ctx context.Context, id types.ID) (*UserInfo, error)

// FindUserInfoByName returns a user by the given username.
FindUserInfoByName(ctx context.Context, username string) (*UserInfo, error)

// ListUserInfos returns all users.
ListUserInfos(ctx context.Context) ([]*UserInfo, error)
Expand Down
42 changes: 29 additions & 13 deletions server/backend/database/memory/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ func (d *DB) FindProjectInfoBySecretKey(
// FindProjectInfoByName returns a project by the given name.
func (d *DB) FindProjectInfoByName(
_ context.Context,
owner string,
owner types.ID,
name string,
) (*database.ProjectInfo, error) {
txn := d.db.Txn(false)
defer txn.Abort()

raw, err := txn.First(tblProjects, "owner_name", owner, name)
raw, err := txn.First(tblProjects, "owner_name", owner.String(), name)
if err != nil {
return nil, fmt.Errorf("find project by owner and name: %w", err)
}
Expand Down Expand Up @@ -143,7 +143,7 @@ func (d *DB) EnsureDefaultUserAndProject(
return nil, nil, err
}

project, err := d.ensureDefaultProjectInfo(ctx, username, clientDeactivateThreshold)
project, err := d.ensureDefaultProjectInfo(ctx, user.ID, clientDeactivateThreshold)
if err != nil {
return nil, nil, err
}
Expand Down Expand Up @@ -187,7 +187,7 @@ func (d *DB) ensureDefaultUserInfo(
// ensureDefaultProjectInfo creates the default project if it does not exist.
func (d *DB) ensureDefaultProjectInfo(
_ context.Context,
defaultUsername string,
defaultUserID types.ID,
defaultClientDeactivateThreshold string,
) (*database.ProjectInfo, error) {
txn := d.db.Txn(true)
Expand All @@ -200,7 +200,7 @@ func (d *DB) ensureDefaultProjectInfo(

var info *database.ProjectInfo
if raw == nil {
info = database.NewProjectInfo(database.DefaultProjectName, defaultUsername, defaultClientDeactivateThreshold)
info = database.NewProjectInfo(database.DefaultProjectName, defaultUserID, defaultClientDeactivateThreshold)
info.ID = database.DefaultProjectID
if err := txn.Insert(tblProjects, info); err != nil {
return nil, fmt.Errorf("insert project: %w", err)
Expand All @@ -217,15 +217,15 @@ func (d *DB) ensureDefaultProjectInfo(
func (d *DB) CreateProjectInfo(
_ context.Context,
name string,
owner string,
owner types.ID,
clientDeactivateThreshold string,
) (*database.ProjectInfo, error) {
txn := d.db.Txn(true)
defer txn.Abort()

// NOTE(hackerwins): Check if the project already exists.
// https://github.com/hashicorp/go-memdb/issues/7#issuecomment-270427642
existing, err := txn.First(tblProjects, "owner_name", owner, name)
existing, err := txn.First(tblProjects, "owner_name", owner.String(), name)
if err != nil {
return nil, fmt.Errorf("find project by owner and name: %w", err)
}
Expand Down Expand Up @@ -304,15 +304,15 @@ func (d *DB) FindNextNCyclingProjectInfos(
// ListProjectInfos returns all project infos owned by owner.
func (d *DB) ListProjectInfos(
_ context.Context,
owner string,
owner types.ID,
) ([]*database.ProjectInfo, error) {
txn := d.db.Txn(false)
defer txn.Abort()

iter, err := txn.LowerBound(
tblProjects,
"owner_name",
owner,
owner.String(),
"",
)
if err != nil {
Expand All @@ -335,7 +335,7 @@ func (d *DB) ListProjectInfos(
// UpdateProjectInfo updates the given project.
func (d *DB) UpdateProjectInfo(
_ context.Context,
owner string,
owner types.ID,
id types.ID,
fields *types.UpdatableProjectFields,
) (*database.ProjectInfo, error) {
Expand All @@ -356,7 +356,7 @@ func (d *DB) UpdateProjectInfo(
}

if fields.Name != nil {
existing, err := txn.First(tblProjects, "owner_name", owner, *fields.Name)
existing, err := txn.First(tblProjects, "owner_name", owner.String(), *fields.Name)
if err != nil {
return nil, fmt.Errorf("find project by owner and name: %w", err)
}
Expand Down Expand Up @@ -402,8 +402,24 @@ func (d *DB) CreateUserInfo(
return info, nil
}

// FindUserInfo finds a user by the given username.
func (d *DB) FindUserInfo(_ context.Context, username string) (*database.UserInfo, error) {
// FindUserInfoByID finds a user by the given ID.
func (d *DB) FindUserInfoByID(_ context.Context, clientID types.ID) (*database.UserInfo, error) {
txn := d.db.Txn(false)
defer txn.Abort()

raw, err := txn.First(tblUsers, "id", clientID.String())
if err != nil {
return nil, fmt.Errorf("find user by id: %w", err)
}
if raw == nil {
return nil, fmt.Errorf("%s: %w", clientID, database.ErrUserNotFound)
}

return raw.(*database.UserInfo).DeepCopy(), nil
}

// FindUserInfoByName finds a user by the given username.
func (d *DB) FindUserInfoByName(_ context.Context, username string) (*database.UserInfo, error) {
txn := d.db.Txn(false)
defer txn.Abort()

Expand Down
8 changes: 6 additions & 2 deletions server/backend/database/memory/database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,12 @@ func TestDB(t *testing.T) {
testcases.RunListUserInfosTest(t, db)
})

t.Run("FindUserInfo test", func(t *testing.T) {
testcases.RunFindUserInfoTest(t, db)
t.Run("FindUserInfoByID test", func(t *testing.T) {
testcases.RunFindUserInfoByIDTest(t, db)
})

t.Run("FindUserInfoByName test", func(t *testing.T) {
testcases.RunFindUserInfoByNameTest(t, db)
})

t.Run("FindProjectInfoBySecretKey test", func(t *testing.T) {
Expand Down
35 changes: 26 additions & 9 deletions server/backend/database/mongo/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (c *Client) EnsureDefaultUserAndProject(
return nil, nil, err
}

projectInfo, err := c.ensureDefaultProjectInfo(ctx, userInfo.Username, clientDeactivateThreshold)
projectInfo, err := c.ensureDefaultProjectInfo(ctx, userInfo.ID, clientDeactivateThreshold)
if err != nil {
return nil, nil, err
}
Expand Down Expand Up @@ -162,10 +162,10 @@ func (c *Client) ensureDefaultUserInfo(
// ensureDefaultProjectInfo creates the default project info if it does not exist.
func (c *Client) ensureDefaultProjectInfo(
ctx context.Context,
defaultUsername string,
defaultUserID types.ID,
defaultClientDeactivateThreshold string,
) (*database.ProjectInfo, error) {
candidate := database.NewProjectInfo(database.DefaultProjectName, defaultUsername, defaultClientDeactivateThreshold)
candidate := database.NewProjectInfo(database.DefaultProjectName, defaultUserID, defaultClientDeactivateThreshold)
candidate.ID = database.DefaultProjectID

_, err := c.collection(ColProjects).UpdateOne(ctx, bson.M{
Expand Down Expand Up @@ -203,7 +203,7 @@ func (c *Client) ensureDefaultProjectInfo(
func (c *Client) CreateProjectInfo(
ctx context.Context,
name string,
owner string,
owner types.ID,
clientDeactivateThreshold string,
) (*database.ProjectInfo, error) {
info := database.NewProjectInfo(name, owner, clientDeactivateThreshold)
Expand Down Expand Up @@ -275,7 +275,7 @@ func (c *Client) FindNextNCyclingProjectInfos(
// ListProjectInfos returns all project infos owned by owner.
func (c *Client) ListProjectInfos(
ctx context.Context,
owner string,
owner types.ID,
) ([]*database.ProjectInfo, error) {
cursor, err := c.collection(ColProjects).Find(ctx, bson.M{
"owner": owner,
Expand Down Expand Up @@ -329,7 +329,7 @@ func (c *Client) FindProjectInfoBySecretKey(ctx context.Context, secretKey strin
// FindProjectInfoByName returns a project by name.
func (c *Client) FindProjectInfoByName(
ctx context.Context,
owner string,
owner types.ID,
name string,
) (*database.ProjectInfo, error) {
result := c.collection(ColProjects).FindOne(ctx, bson.M{
Expand Down Expand Up @@ -368,7 +368,7 @@ func (c *Client) FindProjectInfoByID(ctx context.Context, id types.ID) (*databas
// UpdateProjectInfo updates the project info.
func (c *Client) UpdateProjectInfo(
ctx context.Context,
owner string,
owner types.ID,
id types.ID,
fields *types.UpdatableProjectFields,
) (*database.ProjectInfo, error) {
Expand Down Expand Up @@ -428,8 +428,25 @@ func (c *Client) CreateUserInfo(
return info, nil
}

// FindUserInfo returns a user by username.
func (c *Client) FindUserInfo(ctx context.Context, username string) (*database.UserInfo, error) {
// FindUserInfoByID returns a user by ID.
func (c *Client) FindUserInfoByID(ctx context.Context, clientID types.ID) (*database.UserInfo, error) {
result := c.collection(ColUsers).FindOne(ctx, bson.M{
"_id": clientID,
})

userInfo := database.UserInfo{}
if err := result.Decode(&userInfo); err != nil {
if err == mongo.ErrNoDocuments {
return nil, fmt.Errorf("%s: %w", clientID, database.ErrUserNotFound)
}
return nil, fmt.Errorf("decode user info: %w", err)
}

return &userInfo, nil
}

// FindUserInfoByName returns a user by username.
func (c *Client) FindUserInfoByName(ctx context.Context, username string) (*database.UserInfo, error) {
result := c.collection(ColUsers).FindOne(ctx, bson.M{
"username": username,
})
Expand Down
8 changes: 6 additions & 2 deletions server/backend/database/mongo/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,12 @@ func TestClient(t *testing.T) {
testcases.RunListUserInfosTest(t, cli)
})

t.Run("FindUserInfo test", func(t *testing.T) {
testcases.RunFindUserInfoTest(t, cli)
t.Run("FindUserInfoByID test", func(t *testing.T) {
testcases.RunFindUserInfoByIDTest(t, cli)
})

t.Run("FindUserInfoByName test", func(t *testing.T) {
testcases.RunFindUserInfoByNameTest(t, cli)
})

t.Run("FindProjectInfoBySecretKey test", func(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions server/backend/database/project_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type ProjectInfo struct {
Name string `bson:"name"`

// Owner is the owner of this project.
Owner string `bson:"owner"`
Owner types.ID `bson:"owner"`

// PublicKey is the API key of this project.
PublicKey string `bson:"public_key"`
Expand All @@ -69,7 +69,7 @@ type ProjectInfo struct {
}

// NewProjectInfo creates a new ProjectInfo of the given name.
func NewProjectInfo(name string, owner string, clientDeactivateThreshold string) *ProjectInfo {
func NewProjectInfo(name string, owner types.ID, clientDeactivateThreshold string) *ProjectInfo {
return &ProjectInfo{
Name: name,
Owner: owner,
Expand Down
6 changes: 3 additions & 3 deletions server/backend/database/project_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import (

func TestProjectInfo(t *testing.T) {
t.Run("update fields test", func(t *testing.T) {
dummyOwnerName := "dummy"
dummyOwnerID := types.ID("000000000000000000000000")
clientDeactivateThreshold := "1h"
project := database.NewProjectInfo(t.Name(), dummyOwnerName, clientDeactivateThreshold)
project := database.NewProjectInfo(t.Name(), dummyOwnerID, clientDeactivateThreshold)

testName := "testName"
testURL := "testUrl"
Expand All @@ -44,7 +44,7 @@ func TestProjectInfo(t *testing.T) {

project.UpdateFields(&types.UpdatableProjectFields{AuthWebhookMethods: &testMethods})
assert.Equal(t, testMethods, project.AuthWebhookMethods)
assert.Equal(t, dummyOwnerName, project.Owner)
assert.Equal(t, dummyOwnerID, project.Owner)

project.UpdateFields(&types.UpdatableProjectFields{
ClientDeactivateThreshold: &testClientDeactivateThreshold,
Expand Down
Loading

1 comment on commit 8d00c78

@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: 8d00c78 Previous: db5c891 Ratio
BenchmarkDocument/constructor_test - ns/op 1452 ns/op 1462 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 846.7 ns/op 870.6 ns/op 0.97
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 7482 ns/op 7457 ns/op 1.00
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 16697 ns/op 18773 ns/op 0.89
BenchmarkDocument/nested_update_test - B/op 12058 B/op 12059 B/op 1.00
BenchmarkDocument/nested_update_test - allocs/op 260 allocs/op 260 allocs/op 1
BenchmarkDocument/delete_test - ns/op 22585 ns/op 22731 ns/op 0.99
BenchmarkDocument/delete_test - B/op 15283 B/op 15283 B/op 1
BenchmarkDocument/delete_test - allocs/op 339 allocs/op 339 allocs/op 1
BenchmarkDocument/object_test - ns/op 8615 ns/op 8683 ns/op 0.99
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 28862 ns/op 29725 ns/op 0.97
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 34664 ns/op 31277 ns/op 1.11
BenchmarkDocument/text_test - B/op 14916 B/op 14916 B/op 1
BenchmarkDocument/text_test - allocs/op 470 allocs/op 470 allocs/op 1
BenchmarkDocument/text_composition_test - ns/op 29052 ns/op 29368 ns/op 0.99
BenchmarkDocument/text_composition_test - B/op 18430 B/op 18428 B/op 1.00
BenchmarkDocument/text_composition_test - allocs/op 479 allocs/op 479 allocs/op 1
BenchmarkDocument/rich_text_test - ns/op 80134 ns/op 82199 ns/op 0.97
BenchmarkDocument/rich_text_test - B/op 38675 B/op 38677 B/op 1.00
BenchmarkDocument/rich_text_test - allocs/op 1149 allocs/op 1149 allocs/op 1
BenchmarkDocument/counter_test - ns/op 16946 ns/op 17189 ns/op 0.99
BenchmarkDocument/counter_test - B/op 10466 B/op 10466 B/op 1
BenchmarkDocument/counter_test - allocs/op 238 allocs/op 238 allocs/op 1
BenchmarkDocument/text_edit_gc_100 - ns/op 2892296 ns/op 2902272 ns/op 1.00
BenchmarkDocument/text_edit_gc_100 - B/op 1658560 B/op 1658565 B/op 1.00
BenchmarkDocument/text_edit_gc_100 - allocs/op 17095 allocs/op 17095 allocs/op 1
BenchmarkDocument/text_edit_gc_1000 - ns/op 229193127 ns/op 233644200 ns/op 0.98
BenchmarkDocument/text_edit_gc_1000 - B/op 144394057 B/op 144376121 B/op 1.00
BenchmarkDocument/text_edit_gc_1000 - allocs/op 200996 allocs/op 200903 allocs/op 1.00
BenchmarkDocument/text_split_gc_100 - ns/op 3375088 ns/op 3424928 ns/op 0.99
BenchmarkDocument/text_split_gc_100 - B/op 2316672 B/op 2316906 B/op 1.00
BenchmarkDocument/text_split_gc_100 - allocs/op 16196 allocs/op 16197 allocs/op 1.00
BenchmarkDocument/text_split_gc_1000 - ns/op 288493729 ns/op 305953207 ns/op 0.94
BenchmarkDocument/text_split_gc_1000 - B/op 228930420 B/op 228920972 B/op 1.00
BenchmarkDocument/text_split_gc_1000 - allocs/op 203987 allocs/op 203935 allocs/op 1.00
BenchmarkDocument/text_delete_all_10000 - ns/op 10926771 ns/op 11350708 ns/op 0.96
BenchmarkDocument/text_delete_all_10000 - B/op 5810186 B/op 5811003 B/op 1.00
BenchmarkDocument/text_delete_all_10000 - allocs/op 40673 allocs/op 40676 allocs/op 1.00
BenchmarkDocument/text_delete_all_100000 - ns/op 180864566 ns/op 202714518 ns/op 0.89
BenchmarkDocument/text_delete_all_100000 - B/op 81890474 B/op 81899501 B/op 1.00
BenchmarkDocument/text_delete_all_100000 - allocs/op 411564 allocs/op 411608 allocs/op 1.00
BenchmarkDocument/text_100 - ns/op 225877 ns/op 233594 ns/op 0.97
BenchmarkDocument/text_100 - B/op 120139 B/op 120140 B/op 1.00
BenchmarkDocument/text_100 - allocs/op 5082 allocs/op 5082 allocs/op 1
BenchmarkDocument/text_1000 - ns/op 2442057 ns/op 2477047 ns/op 0.99
BenchmarkDocument/text_1000 - B/op 1169127 B/op 1169110 B/op 1.00
BenchmarkDocument/text_1000 - allocs/op 50086 allocs/op 50086 allocs/op 1
BenchmarkDocument/array_1000 - ns/op 1236058 ns/op 1267080 ns/op 0.98
BenchmarkDocument/array_1000 - B/op 1091439 B/op 1091237 B/op 1.00
BenchmarkDocument/array_1000 - allocs/op 11830 allocs/op 11829 allocs/op 1.00
BenchmarkDocument/array_10000 - ns/op 13130552 ns/op 13620720 ns/op 0.96
BenchmarkDocument/array_10000 - B/op 9799626 B/op 9799283 B/op 1.00
BenchmarkDocument/array_10000 - allocs/op 120293 allocs/op 120292 allocs/op 1.00
BenchmarkDocument/array_gc_100 - ns/op 152777 ns/op 156102 ns/op 0.98
BenchmarkDocument/array_gc_100 - B/op 132659 B/op 132672 B/op 1.00
BenchmarkDocument/array_gc_100 - allocs/op 1258 allocs/op 1259 allocs/op 1.00
BenchmarkDocument/array_gc_1000 - ns/op 1423902 ns/op 1474362 ns/op 0.97
BenchmarkDocument/array_gc_1000 - B/op 1158991 B/op 1159140 B/op 1.00
BenchmarkDocument/array_gc_1000 - allocs/op 12874 allocs/op 12875 allocs/op 1.00
BenchmarkDocument/counter_1000 - ns/op 209665 ns/op 227555 ns/op 0.92
BenchmarkDocument/counter_1000 - B/op 192916 B/op 192918 B/op 1.00
BenchmarkDocument/counter_1000 - allocs/op 5767 allocs/op 5767 allocs/op 1
BenchmarkDocument/counter_10000 - ns/op 2221452 ns/op 2356115 ns/op 0.94
BenchmarkDocument/counter_10000 - B/op 2087849 B/op 2087850 B/op 1.00
BenchmarkDocument/counter_10000 - allocs/op 59774 allocs/op 59774 allocs/op 1
BenchmarkDocument/object_1000 - ns/op 1411848 ns/op 1458163 ns/op 0.97
BenchmarkDocument/object_1000 - B/op 1428024 B/op 1427995 B/op 1.00
BenchmarkDocument/object_1000 - allocs/op 9847 allocs/op 9847 allocs/op 1
BenchmarkDocument/object_10000 - ns/op 14937114 ns/op 15315113 ns/op 0.98
BenchmarkDocument/object_10000 - B/op 12166459 B/op 12164930 B/op 1.00
BenchmarkDocument/object_10000 - allocs/op 100561 allocs/op 100557 allocs/op 1.00
BenchmarkDocument/tree_100 - ns/op 1036270 ns/op 1077654 ns/op 0.96
BenchmarkDocument/tree_100 - B/op 943780 B/op 943784 B/op 1.00
BenchmarkDocument/tree_100 - allocs/op 6102 allocs/op 6102 allocs/op 1
BenchmarkDocument/tree_1000 - ns/op 75266647 ns/op 79789440 ns/op 0.94
BenchmarkDocument/tree_1000 - B/op 86460378 B/op 86483290 B/op 1.00
BenchmarkDocument/tree_1000 - allocs/op 60115 allocs/op 60115 allocs/op 1
BenchmarkDocument/tree_10000 - ns/op 9412595420 ns/op 10035698778 ns/op 0.94
BenchmarkDocument/tree_10000 - B/op 8580991536 B/op 8580658784 B/op 1.00
BenchmarkDocument/tree_10000 - allocs/op 600241 allocs/op 600211 allocs/op 1.00
BenchmarkDocument/tree_delete_all_1000 - ns/op 75525901 ns/op 84272093 ns/op 0.90
BenchmarkDocument/tree_delete_all_1000 - B/op 86990326 B/op 86991508 B/op 1.00
BenchmarkDocument/tree_delete_all_1000 - allocs/op 67751 allocs/op 67756 allocs/op 1.00
BenchmarkDocument/tree_edit_gc_100 - ns/op 3727986 ns/op 4101233 ns/op 0.91
BenchmarkDocument/tree_edit_gc_100 - B/op 4121061 B/op 4121121 B/op 1.00
BenchmarkDocument/tree_edit_gc_100 - allocs/op 14359 allocs/op 14359 allocs/op 1
BenchmarkDocument/tree_edit_gc_1000 - ns/op 303527782 ns/op 329940615 ns/op 0.92
BenchmarkDocument/tree_edit_gc_1000 - B/op 383465988 B/op 383467576 B/op 1.00
BenchmarkDocument/tree_edit_gc_1000 - allocs/op 145418 allocs/op 145422 allocs/op 1.00
BenchmarkDocument/tree_split_gc_100 - ns/op 2525628 ns/op 2678989 ns/op 0.94
BenchmarkDocument/tree_split_gc_100 - B/op 2387014 B/op 2386932 B/op 1.00
BenchmarkDocument/tree_split_gc_100 - allocs/op 10344 allocs/op 10344 allocs/op 1
BenchmarkDocument/tree_split_gc_1000 - ns/op 186009420 ns/op 205038291 ns/op 0.91
BenchmarkDocument/tree_split_gc_1000 - B/op 221992244 B/op 221991552 B/op 1.00
BenchmarkDocument/tree_split_gc_1000 - allocs/op 112267 allocs/op 112267 allocs/op 1
BenchmarkRPC/client_to_server - ns/op 366720790 ns/op 370061649 ns/op 0.99
BenchmarkRPC/client_to_server - B/op 18241232 B/op 17801160 B/op 1.02
BenchmarkRPC/client_to_server - allocs/op 170901 allocs/op 165882 allocs/op 1.03
BenchmarkRPC/client_to_client_via_server - ns/op 627785410 ns/op 631705484 ns/op 0.99
BenchmarkRPC/client_to_client_via_server - B/op 33784040 B/op 35787972 B/op 0.94
BenchmarkRPC/client_to_client_via_server - allocs/op 319697 allocs/op 310901 allocs/op 1.03
BenchmarkRPC/attach_large_document - ns/op 1335222816 ns/op 1304912523 ns/op 1.02
BenchmarkRPC/attach_large_document - B/op 1881391392 B/op 1890006000 B/op 1.00
BenchmarkRPC/attach_large_document - allocs/op 7561 allocs/op 7507 allocs/op 1.01
BenchmarkRPC/adminCli_to_server - ns/op 545182333 ns/op 556685648 ns/op 0.98
BenchmarkRPC/adminCli_to_server - B/op 35981252 B/op 35961492 B/op 1.00
BenchmarkRPC/adminCli_to_server - allocs/op 289670 allocs/op 288640 allocs/op 1.00
BenchmarkLocker - ns/op 64.34 ns/op 66.57 ns/op 0.97
BenchmarkLocker - B/op 16 B/op 16 B/op 1
BenchmarkLocker - allocs/op 1 allocs/op 1 allocs/op 1
BenchmarkLockerParallel - ns/op 39.05 ns/op 38.47 ns/op 1.02
BenchmarkLockerParallel - B/op 0 B/op 0 B/op NaN
BenchmarkLockerParallel - allocs/op 0 allocs/op 0 allocs/op NaN
BenchmarkLockerMoreKeys - ns/op 152.3 ns/op 143.9 ns/op 1.06
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 4144574 ns/op 3824404 ns/op 1.08
BenchmarkChange/Push_10_Changes - B/op 147113 B/op 125670 B/op 1.17
BenchmarkChange/Push_10_Changes - allocs/op 1293 allocs/op 1253 allocs/op 1.03
BenchmarkChange/Push_100_Changes - ns/op 15320521 ns/op 14396562 ns/op 1.06
BenchmarkChange/Push_100_Changes - B/op 709504 B/op 646471 B/op 1.10
BenchmarkChange/Push_100_Changes - allocs/op 6754 allocs/op 6538 allocs/op 1.03
BenchmarkChange/Push_1000_Changes - ns/op 122763931 ns/op 115416962 ns/op 1.06
BenchmarkChange/Push_1000_Changes - B/op 6183386 B/op 6038304 B/op 1.02
BenchmarkChange/Push_1000_Changes - allocs/op 63373 allocs/op 62159 allocs/op 1.02
BenchmarkChange/Pull_10_Changes - ns/op 3235067 ns/op 2878743 ns/op 1.12
BenchmarkChange/Pull_10_Changes - B/op 123177 B/op 99782 B/op 1.23
BenchmarkChange/Pull_10_Changes - allocs/op 1003 allocs/op 952 allocs/op 1.05
BenchmarkChange/Pull_100_Changes - ns/op 5082039 ns/op 4395829 ns/op 1.16
BenchmarkChange/Pull_100_Changes - B/op 325689 B/op 255673 B/op 1.27
BenchmarkChange/Pull_100_Changes - allocs/op 3474 allocs/op 3155 allocs/op 1.10
BenchmarkChange/Pull_1000_Changes - ns/op 9588201 ns/op 8794063 ns/op 1.09
BenchmarkChange/Pull_1000_Changes - B/op 1637805 B/op 1394867 B/op 1.17
BenchmarkChange/Pull_1000_Changes - allocs/op 29842 allocs/op 26864 allocs/op 1.11
BenchmarkSnapshot/Push_3KB_snapshot - ns/op 18928959 ns/op 17155258 ns/op 1.10
BenchmarkSnapshot/Push_3KB_snapshot - B/op 946697 B/op 802395 B/op 1.18
BenchmarkSnapshot/Push_3KB_snapshot - allocs/op 6762 allocs/op 6545 allocs/op 1.03
BenchmarkSnapshot/Push_30KB_snapshot - ns/op 127721669 ns/op 119057281 ns/op 1.07
BenchmarkSnapshot/Push_30KB_snapshot - B/op 6492642 B/op 6130075 B/op 1.06
BenchmarkSnapshot/Push_30KB_snapshot - allocs/op 63184 allocs/op 62161 allocs/op 1.02
BenchmarkSnapshot/Pull_3KB_snapshot - ns/op 7602307 ns/op 6682690 ns/op 1.14
BenchmarkSnapshot/Pull_3KB_snapshot - B/op 1025007 B/op 902357 B/op 1.14
BenchmarkSnapshot/Pull_3KB_snapshot - allocs/op 15500 allocs/op 14886 allocs/op 1.04
BenchmarkSnapshot/Pull_30KB_snapshot - ns/op 16613642 ns/op 15488359 ns/op 1.07
BenchmarkSnapshot/Pull_30KB_snapshot - B/op 7426436 B/op 6979845 B/op 1.06
BenchmarkSnapshot/Pull_30KB_snapshot - allocs/op 150118 allocs/op 144144 allocs/op 1.04
BenchmarkSync/memory_sync_10_test - ns/op 6876 ns/op 6909 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 51249 ns/op 51987 ns/op 0.99
BenchmarkSync/memory_sync_100_test - B/op 8691 B/op 8651 B/op 1.00
BenchmarkSync/memory_sync_100_test - allocs/op 276 allocs/op 273 allocs/op 1.01
BenchmarkSync/memory_sync_1000_test - ns/op 427471 ns/op 598943 ns/op 0.71
BenchmarkSync/memory_sync_1000_test - B/op 83022 B/op 74321 B/op 1.12
BenchmarkSync/memory_sync_1000_test - allocs/op 2651 allocs/op 2109 allocs/op 1.26
BenchmarkSync/memory_sync_10000_test - ns/op 4440846 ns/op 8040185 ns/op 0.55
BenchmarkSync/memory_sync_10000_test - B/op 819859 B/op 752410 B/op 1.09
BenchmarkSync/memory_sync_10000_test - allocs/op 24251 allocs/op 20450 allocs/op 1.19
BenchmarkTextEditing - ns/op 19301315878 ns/op 19692939313 ns/op 0.98
BenchmarkTextEditing - B/op 9042223312 B/op 9042488224 B/op 1.00
BenchmarkTextEditing - allocs/op 19924299 allocs/op 19922605 allocs/op 1.00

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

Please sign in to comment.