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 2788be4
Show file tree
Hide file tree
Showing 14 changed files with 170 additions and 92 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
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 2788be4

@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: 2788be4 Previous: db5c891 Ratio
BenchmarkDocument/constructor_test - ns/op 1408 ns/op 1462 ns/op 0.96
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 848.3 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 7393 ns/op 7457 ns/op 0.99
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 17576 ns/op 18773 ns/op 0.94
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 23694 ns/op 22731 ns/op 1.04
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 8670 ns/op 8683 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 28891 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 30606 ns/op 31277 ns/op 0.98
BenchmarkDocument/text_test - B/op 14915 B/op 14916 B/op 1.00
BenchmarkDocument/text_test - allocs/op 470 allocs/op 470 allocs/op 1
BenchmarkDocument/text_composition_test - ns/op 29013 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 80605 ns/op 82199 ns/op 0.98
BenchmarkDocument/rich_text_test - B/op 38676 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 17197 ns/op 17189 ns/op 1.00
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 2892537 ns/op 2902272 ns/op 1.00
BenchmarkDocument/text_edit_gc_100 - B/op 1658528 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 230563802 ns/op 233644200 ns/op 0.99
BenchmarkDocument/text_edit_gc_1000 - B/op 144380476 B/op 144376121 B/op 1.00
BenchmarkDocument/text_edit_gc_1000 - allocs/op 200939 allocs/op 200903 allocs/op 1.00
BenchmarkDocument/text_split_gc_100 - ns/op 3389244 ns/op 3424928 ns/op 0.99
BenchmarkDocument/text_split_gc_100 - B/op 2317021 B/op 2316906 B/op 1.00
BenchmarkDocument/text_split_gc_100 - allocs/op 16197 allocs/op 16197 allocs/op 1
BenchmarkDocument/text_split_gc_1000 - ns/op 289389913 ns/op 305953207 ns/op 0.95
BenchmarkDocument/text_split_gc_1000 - B/op 228918828 B/op 228920972 B/op 1.00
BenchmarkDocument/text_split_gc_1000 - allocs/op 203929 allocs/op 203935 allocs/op 1.00
BenchmarkDocument/text_delete_all_10000 - ns/op 11541677 ns/op 11350708 ns/op 1.02
BenchmarkDocument/text_delete_all_10000 - B/op 5811302 B/op 5811003 B/op 1.00
BenchmarkDocument/text_delete_all_10000 - allocs/op 40678 allocs/op 40676 allocs/op 1.00
BenchmarkDocument/text_delete_all_100000 - ns/op 191508194 ns/op 202714518 ns/op 0.94
BenchmarkDocument/text_delete_all_100000 - B/op 81899026 B/op 81899501 B/op 1.00
BenchmarkDocument/text_delete_all_100000 - allocs/op 411618 allocs/op 411608 allocs/op 1.00
BenchmarkDocument/text_100 - ns/op 232578 ns/op 233594 ns/op 1.00
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 2465181 ns/op 2477047 ns/op 1.00
BenchmarkDocument/text_1000 - B/op 1169145 B/op 1169110 B/op 1.00
BenchmarkDocument/text_1000 - allocs/op 50086 allocs/op 50086 allocs/op 1
BenchmarkDocument/array_1000 - ns/op 1246853 ns/op 1267080 ns/op 0.98
BenchmarkDocument/array_1000 - B/op 1091410 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 13464411 ns/op 13620720 ns/op 0.99
BenchmarkDocument/array_10000 - B/op 9800760 B/op 9799283 B/op 1.00
BenchmarkDocument/array_10000 - allocs/op 120298 allocs/op 120292 allocs/op 1.00
BenchmarkDocument/array_gc_100 - ns/op 155147 ns/op 156102 ns/op 0.99
BenchmarkDocument/array_gc_100 - B/op 132659 B/op 132672 B/op 1.00
BenchmarkDocument/array_gc_100 - allocs/op 1259 allocs/op 1259 allocs/op 1
BenchmarkDocument/array_gc_1000 - ns/op 1443770 ns/op 1474362 ns/op 0.98
BenchmarkDocument/array_gc_1000 - B/op 1159156 B/op 1159140 B/op 1.00
BenchmarkDocument/array_gc_1000 - allocs/op 12875 allocs/op 12875 allocs/op 1
BenchmarkDocument/counter_1000 - ns/op 214700 ns/op 227555 ns/op 0.94
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 2247229 ns/op 2356115 ns/op 0.95
BenchmarkDocument/counter_10000 - B/op 2087832 B/op 2087850 B/op 1.00
BenchmarkDocument/counter_10000 - allocs/op 59774 allocs/op 59774 allocs/op 1
BenchmarkDocument/object_1000 - ns/op 1435509 ns/op 1458163 ns/op 0.98
BenchmarkDocument/object_1000 - B/op 1428080 B/op 1427995 B/op 1.00
BenchmarkDocument/object_1000 - allocs/op 9847 allocs/op 9847 allocs/op 1
BenchmarkDocument/object_10000 - ns/op 15133287 ns/op 15315113 ns/op 0.99
BenchmarkDocument/object_10000 - B/op 12167541 B/op 12164930 B/op 1.00
BenchmarkDocument/object_10000 - allocs/op 100565 allocs/op 100557 allocs/op 1.00
BenchmarkDocument/tree_100 - ns/op 1071286 ns/op 1077654 ns/op 0.99
BenchmarkDocument/tree_100 - B/op 943782 B/op 943784 B/op 1.00
BenchmarkDocument/tree_100 - allocs/op 6102 allocs/op 6102 allocs/op 1
BenchmarkDocument/tree_1000 - ns/op 79193684 ns/op 79789440 ns/op 0.99
BenchmarkDocument/tree_1000 - B/op 86460104 B/op 86483290 B/op 1.00
BenchmarkDocument/tree_1000 - allocs/op 60117 allocs/op 60115 allocs/op 1.00
BenchmarkDocument/tree_10000 - ns/op 9814698725 ns/op 10035698778 ns/op 0.98
BenchmarkDocument/tree_10000 - B/op 8580988816 B/op 8580658784 B/op 1.00
BenchmarkDocument/tree_10000 - allocs/op 600225 allocs/op 600211 allocs/op 1.00
BenchmarkDocument/tree_delete_all_1000 - ns/op 79209132 ns/op 84272093 ns/op 0.94
BenchmarkDocument/tree_delete_all_1000 - B/op 86990616 B/op 86991508 B/op 1.00
BenchmarkDocument/tree_delete_all_1000 - allocs/op 67752 allocs/op 67756 allocs/op 1.00
BenchmarkDocument/tree_edit_gc_100 - ns/op 3847697 ns/op 4101233 ns/op 0.94
BenchmarkDocument/tree_edit_gc_100 - B/op 4121121 B/op 4121121 B/op 1
BenchmarkDocument/tree_edit_gc_100 - allocs/op 14359 allocs/op 14359 allocs/op 1
BenchmarkDocument/tree_edit_gc_1000 - ns/op 316538814 ns/op 329940615 ns/op 0.96
BenchmarkDocument/tree_edit_gc_1000 - B/op 383467326 B/op 383467576 B/op 1.00
BenchmarkDocument/tree_edit_gc_1000 - allocs/op 145420 allocs/op 145422 allocs/op 1.00
BenchmarkDocument/tree_split_gc_100 - ns/op 2594104 ns/op 2678989 ns/op 0.97
BenchmarkDocument/tree_split_gc_100 - B/op 2387006 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 193993896 ns/op 205038291 ns/op 0.95
BenchmarkDocument/tree_split_gc_1000 - B/op 221992129 B/op 221991552 B/op 1.00
BenchmarkDocument/tree_split_gc_1000 - allocs/op 112265 allocs/op 112267 allocs/op 1.00
BenchmarkRPC/client_to_server - ns/op 368049745 ns/op 370061649 ns/op 0.99
BenchmarkRPC/client_to_server - B/op 17103341 B/op 17801160 B/op 0.96
BenchmarkRPC/client_to_server - allocs/op 170823 allocs/op 165882 allocs/op 1.03
BenchmarkRPC/client_to_client_via_server - ns/op 631202840 ns/op 631705484 ns/op 1.00
BenchmarkRPC/client_to_client_via_server - B/op 32095116 B/op 35787972 B/op 0.90
BenchmarkRPC/client_to_client_via_server - allocs/op 319226 allocs/op 310901 allocs/op 1.03
BenchmarkRPC/attach_large_document - ns/op 1169979887 ns/op 1304912523 ns/op 0.90
BenchmarkRPC/attach_large_document - B/op 1881388904 B/op 1890006000 B/op 1.00
BenchmarkRPC/attach_large_document - allocs/op 7579 allocs/op 7507 allocs/op 1.01
BenchmarkRPC/adminCli_to_server - ns/op 542188801 ns/op 556685648 ns/op 0.97
BenchmarkRPC/adminCli_to_server - B/op 35985012 B/op 35961492 B/op 1.00
BenchmarkRPC/adminCli_to_server - allocs/op 289636 allocs/op 288640 allocs/op 1.00
BenchmarkLocker - ns/op 64.76 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 38.77 ns/op 38.47 ns/op 1.01
BenchmarkLockerParallel - B/op 0 B/op 0 B/op NaN
BenchmarkLockerParallel - allocs/op 0 allocs/op 0 allocs/op NaN
BenchmarkLockerMoreKeys - ns/op 152.2 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 4132240 ns/op 3824404 ns/op 1.08
BenchmarkChange/Push_10_Changes - B/op 147429 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 15571840 ns/op 14396562 ns/op 1.08
BenchmarkChange/Push_100_Changes - B/op 710897 B/op 646471 B/op 1.10
BenchmarkChange/Push_100_Changes - allocs/op 6758 allocs/op 6538 allocs/op 1.03
BenchmarkChange/Push_1000_Changes - ns/op 124543621 ns/op 115416962 ns/op 1.08
BenchmarkChange/Push_1000_Changes - B/op 6252016 B/op 6038304 B/op 1.04
BenchmarkChange/Push_1000_Changes - allocs/op 63375 allocs/op 62159 allocs/op 1.02
BenchmarkChange/Pull_10_Changes - ns/op 3224397 ns/op 2878743 ns/op 1.12
BenchmarkChange/Pull_10_Changes - B/op 124098 B/op 99782 B/op 1.24
BenchmarkChange/Pull_10_Changes - allocs/op 1004 allocs/op 952 allocs/op 1.05
BenchmarkChange/Pull_100_Changes - ns/op 5132595 ns/op 4395829 ns/op 1.17
BenchmarkChange/Pull_100_Changes - B/op 326864 B/op 255673 B/op 1.28
BenchmarkChange/Pull_100_Changes - allocs/op 3473 allocs/op 3155 allocs/op 1.10
BenchmarkChange/Pull_1000_Changes - ns/op 9924208 ns/op 8794063 ns/op 1.13
BenchmarkChange/Pull_1000_Changes - B/op 1638239 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 19799031 ns/op 17155258 ns/op 1.15
BenchmarkSnapshot/Push_3KB_snapshot - B/op 961820 B/op 802395 B/op 1.20
BenchmarkSnapshot/Push_3KB_snapshot - allocs/op 6761 allocs/op 6545 allocs/op 1.03
BenchmarkSnapshot/Push_30KB_snapshot - ns/op 128886457 ns/op 119057281 ns/op 1.08
BenchmarkSnapshot/Push_30KB_snapshot - B/op 6418801 B/op 6130075 B/op 1.05
BenchmarkSnapshot/Push_30KB_snapshot - allocs/op 63192 allocs/op 62161 allocs/op 1.02
BenchmarkSnapshot/Pull_3KB_snapshot - ns/op 7711409 ns/op 6682690 ns/op 1.15
BenchmarkSnapshot/Pull_3KB_snapshot - B/op 1026579 B/op 902357 B/op 1.14
BenchmarkSnapshot/Pull_3KB_snapshot - allocs/op 15504 allocs/op 14886 allocs/op 1.04
BenchmarkSnapshot/Pull_30KB_snapshot - ns/op 18057535 ns/op 15488359 ns/op 1.17
BenchmarkSnapshot/Pull_30KB_snapshot - B/op 7432055 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 6895 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 51871 ns/op 51987 ns/op 1.00
BenchmarkSync/memory_sync_100_test - B/op 8646 B/op 8651 B/op 1.00
BenchmarkSync/memory_sync_100_test - allocs/op 273 allocs/op 273 allocs/op 1
BenchmarkSync/memory_sync_1000_test - ns/op 592419 ns/op 598943 ns/op 0.99
BenchmarkSync/memory_sync_1000_test - B/op 74476 B/op 74321 B/op 1.00
BenchmarkSync/memory_sync_1000_test - allocs/op 2115 allocs/op 2109 allocs/op 1.00
BenchmarkSync/memory_sync_10000_test - ns/op 7500788 ns/op 8040185 ns/op 0.93
BenchmarkSync/memory_sync_10000_test - B/op 746507 B/op 752410 B/op 0.99
BenchmarkSync/memory_sync_10000_test - allocs/op 20341 allocs/op 20450 allocs/op 0.99
BenchmarkTextEditing - ns/op 19045382386 ns/op 19692939313 ns/op 0.97
BenchmarkTextEditing - B/op 9042253600 B/op 9042488224 B/op 1.00
BenchmarkTextEditing - allocs/op 19924525 allocs/op 19922605 allocs/op 1.00

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

Please sign in to comment.