Skip to content

Commit

Permalink
Simplify converter interface
Browse files Browse the repository at this point in the history
  • Loading branch information
hackerwins committed Dec 15, 2023
1 parent b3bec3d commit 2f30459
Show file tree
Hide file tree
Showing 19 changed files with 51 additions and 112 deletions.
6 changes: 2 additions & 4 deletions admin/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,8 @@ func (c *Client) Dial(rpcAddr string) error {
}

// Close closes the connection to the admin service.
func (c *Client) Close() error {
func (c *Client) Close() {
c.conn.CloseIdleConnections()

return nil
}

// LogIn logs in a user.
Expand Down Expand Up @@ -167,7 +165,7 @@ func (c *Client) SignUp(
return nil, err
}

return converter.FromUser(response.Msg.User)
return converter.FromUser(response.Msg.User), nil
}

// CreateProject creates a new project.
Expand Down
8 changes: 3 additions & 5 deletions api/converter/from_pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@ import (
)

// FromUser converts the given Protobuf formats to model format.
func FromUser(pbUser *api.User) (*types.User, error) {
createdAt := pbUser.CreatedAt.AsTime()

func FromUser(pbUser *api.User) *types.User {
return &types.User{
ID: types.ID(pbUser.Id),
Username: pbUser.Username,
CreatedAt: createdAt,
}, nil
CreatedAt: pbUser.CreatedAt.AsTime(),
}
}

// FromProjects converts the given Protobuf formats to model format.
Expand Down
53 changes: 18 additions & 35 deletions api/converter/to_pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,26 @@ import (
)

// ToUser converts the given model format to Protobuf format.
func ToUser(user *types.User) (*api.User, error) {
pbCreatedAt := timestamppb.New(user.CreatedAt)

func ToUser(user *types.User) *api.User {
return &api.User{
Id: user.ID.String(),
Username: user.Username,
CreatedAt: pbCreatedAt,
}, nil
CreatedAt: timestamppb.New(user.CreatedAt),
}
}

// ToProjects converts the given model to Protobuf.
func ToProjects(projects []*types.Project) ([]*api.Project, error) {
func ToProjects(projects []*types.Project) []*api.Project {
var pbProjects []*api.Project
for _, project := range projects {
pbProject, err := ToProject(project)
if err != nil {
return nil, err
}
pbProjects = append(pbProjects, pbProject)
pbProjects = append(pbProjects, ToProject(project))
}

return pbProjects, nil
return pbProjects
}

// ToProject converts the given model to Protobuf.
func ToProject(project *types.Project) (*api.Project, error) {
pbCreatedAt := timestamppb.New(project.CreatedAt)
pbUpdatedAt := timestamppb.New(project.UpdatedAt)

func ToProject(project *types.Project) *api.Project {
return &api.Project{
Id: project.ID.String(),
Name: project.Name,
Expand All @@ -70,38 +61,30 @@ func ToProject(project *types.Project) (*api.Project, error) {
ClientDeactivateThreshold: project.ClientDeactivateThreshold,
PublicKey: project.PublicKey,
SecretKey: project.SecretKey,
CreatedAt: pbCreatedAt,
UpdatedAt: pbUpdatedAt,
}, nil
CreatedAt: timestamppb.New(project.CreatedAt),
UpdatedAt: timestamppb.New(project.UpdatedAt),
}
}

// ToDocumentSummaries converts the given model to Protobuf.
func ToDocumentSummaries(summaries []*types.DocumentSummary) ([]*api.DocumentSummary, error) {
func ToDocumentSummaries(summaries []*types.DocumentSummary) []*api.DocumentSummary {
var pbSummaries []*api.DocumentSummary
for _, summary := range summaries {
pbSummary, err := ToDocumentSummary(summary)
if err != nil {
return nil, err
}
pbSummaries = append(pbSummaries, pbSummary)
pbSummaries = append(pbSummaries, ToDocumentSummary(summary))
}
return pbSummaries, nil
return pbSummaries
}

// ToDocumentSummary converts the given model to Protobuf format.
func ToDocumentSummary(summary *types.DocumentSummary) (*api.DocumentSummary, error) {
pbCreatedAt := timestamppb.New(summary.CreatedAt)
pbAccessedAt := timestamppb.New(summary.AccessedAt)
pbUpdatedAt := timestamppb.New(summary.UpdatedAt)

func ToDocumentSummary(summary *types.DocumentSummary) *api.DocumentSummary {
return &api.DocumentSummary{
Id: summary.ID.String(),
Key: summary.Key.String(),
CreatedAt: pbCreatedAt,
AccessedAt: pbAccessedAt,
UpdatedAt: pbUpdatedAt,
CreatedAt: timestamppb.New(summary.CreatedAt),
AccessedAt: timestamppb.New(summary.AccessedAt),
UpdatedAt: timestamppb.New(summary.UpdatedAt),
Snapshot: summary.Snapshot,
}, nil
}
}

// ToPresences converts the given model to Protobuf format.
Expand Down
2 changes: 1 addition & 1 deletion cmd/yorkie/document/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func newListCommand() *cobra.Command {
return err
}
defer func() {
_ = cli.Close()
cli.Close()
}()

ctx := context.Background()
Expand Down
2 changes: 1 addition & 1 deletion cmd/yorkie/document/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func newRemoveCommand() *cobra.Command {
return err
}
defer func() {
_ = cli.Close()
cli.Close()
}()

ctx := context.Background()
Expand Down
2 changes: 1 addition & 1 deletion cmd/yorkie/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func newHistoryCmd() *cobra.Command {
return err
}
defer func() {
_ = cli.Close()
cli.Close()
}()

ctx := context.Background()
Expand Down
2 changes: 1 addition & 1 deletion cmd/yorkie/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func newLoginCmd() *cobra.Command {
return err
}
defer func() {
_ = cli.Close()
cli.Close()
}()

ctx := context.Background()
Expand Down
2 changes: 1 addition & 1 deletion cmd/yorkie/project/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func newCreateCommand() *cobra.Command {
return err
}
defer func() {
_ = cli.Close()
cli.Close()
}()

ctx := context.Background()
Expand Down
2 changes: 1 addition & 1 deletion cmd/yorkie/project/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func newListCommand() *cobra.Command {
return err
}
defer func() {
_ = cli.Close()
cli.Close()
}()

ctx := context.Background()
Expand Down
2 changes: 1 addition & 1 deletion cmd/yorkie/project/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func newUpdateCommand() *cobra.Command {
return err
}
defer func() {
_ = cli.Close()
cli.Close()
}()

ctx := context.Background()
Expand Down
56 changes: 8 additions & 48 deletions server/rpc/admin_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,8 @@ func (s *adminServer) SignUp(
return nil, err
}

pbUser, err := converter.ToUser(user)
if err != nil {
return nil, err
}

return connect.NewResponse(&api.SignUpResponse{
User: pbUser,
User: converter.ToUser(user),
}), nil
}

Expand Down Expand Up @@ -116,13 +111,8 @@ func (s *adminServer) CreateProject(
return nil, err
}

pbProject, err := converter.ToProject(project)
if err != nil {
return nil, err
}

return connect.NewResponse(&api.CreateProjectResponse{
Project: pbProject,
Project: converter.ToProject(project),
}), nil
}

Expand All @@ -137,13 +127,8 @@ func (s *adminServer) ListProjects(
return nil, err
}

pbProjects, err := converter.ToProjects(projectList)
if err != nil {
return nil, err
}

return connect.NewResponse(&api.ListProjectsResponse{
Projects: pbProjects,
Projects: converter.ToProjects(projectList),
}), nil
}

Expand All @@ -158,13 +143,8 @@ func (s *adminServer) GetProject(
return nil, err
}

pbProject, err := converter.ToProject(project)
if err != nil {
return nil, err
}

return connect.NewResponse(&api.GetProjectResponse{
Project: pbProject,
Project: converter.ToProject(project),
}), nil
}

Expand Down Expand Up @@ -193,13 +173,8 @@ func (s *adminServer) UpdateProject(
return nil, err
}

pbProject, err := converter.ToProject(project)
if err != nil {
return nil, err
}

return connect.NewResponse(&api.UpdateProjectResponse{
Project: pbProject,
Project: converter.ToProject(project),
}), nil
}

Expand All @@ -224,13 +199,8 @@ func (s *adminServer) GetDocument(
return nil, err
}

pbDocument, err := converter.ToDocumentSummary(document)
if err != nil {
return nil, err
}

return connect.NewResponse(&api.GetDocumentResponse{
Document: pbDocument,
Document: converter.ToDocumentSummary(document),
}), nil
}

Expand Down Expand Up @@ -293,13 +263,8 @@ func (s *adminServer) ListDocuments(
return nil, err
}

pbDocuments, err := converter.ToDocumentSummaries(docs)
if err != nil {
return nil, err
}

return connect.NewResponse(&api.ListDocumentsResponse{
Documents: pbDocuments,
Documents: converter.ToDocumentSummaries(docs),
}), nil
}

Expand All @@ -325,14 +290,9 @@ func (s *adminServer) SearchDocuments(
return nil, err
}

pbDocuments, err := converter.ToDocumentSummaries(result.Elements)
if err != nil {
return nil, err
}

return connect.NewResponse(&api.SearchDocumentsResponse{
TotalCount: int32(result.TotalCount),
Documents: pbDocuments,
Documents: converter.ToDocumentSummaries(result.Elements),
}), nil
}

Expand Down
2 changes: 1 addition & 1 deletion test/bench/grpc_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func BenchmarkRPC(b *testing.B) {

b.Run("adminCli to server", func(b *testing.B) {
adminCli := helper.CreateAdminCli(b, defaultServer.RPCAddr())
defer func() { assert.NoError(b, adminCli.Close()) }()
defer func() { adminCli.Close() }()

ctx := context.Background()
for i := 0; i < b.N; i++ {
Expand Down
4 changes: 2 additions & 2 deletions test/helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ var testStartedAt int64

// Below are the values of the Yorkie config used in the test.
var (
RPCPort = 21101
RPCPort = 11101

ProfilingPort = 21102
ProfilingPort = 11102

AdminUser = server.DefaultAdminUser
AdminPassword = server.DefaultAdminPassword
Expand Down
2 changes: 1 addition & 1 deletion test/integration/admin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestAdmin(t *testing.T) {
_, err = adminCli.LogIn(ctx, "admin", "admin")
assert.NoError(t, err)
defer func() {
assert.NoError(t, adminCli.Close())
adminCli.Close()
}()

clients := activeClients(t, 1)
Expand Down
10 changes: 5 additions & 5 deletions test/integration/auth_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func TestProjectAuthWebhook(t *testing.T) {
defer func() { assert.NoError(t, svr.Shutdown(true)) }()

adminCli := helper.CreateAdminCli(t, svr.RPCAddr())
defer func() { assert.NoError(t, adminCli.Close()) }()
defer func() { adminCli.Close() }()

project, err := adminCli.CreateProject(context.Background(), "auth-webhook-test")
assert.NoError(t, err)
Expand Down Expand Up @@ -199,7 +199,7 @@ func TestAuthWebhook(t *testing.T) {
defer func() { assert.NoError(t, svr.Shutdown(true)) }()

adminCli := helper.CreateAdminCli(t, svr.RPCAddr())
defer func() { assert.NoError(t, adminCli.Close()) }()
defer func() { adminCli.Close() }()
project, err := adminCli.CreateProject(context.Background(), "success-webhook-after-retries")
assert.NoError(t, err)
project.AuthWebhookURL = authServer.URL
Expand Down Expand Up @@ -241,7 +241,7 @@ func TestAuthWebhook(t *testing.T) {
defer func() { assert.NoError(t, svr.Shutdown(true)) }()

adminCli := helper.CreateAdminCli(t, svr.RPCAddr())
defer func() { assert.NoError(t, adminCli.Close()) }()
defer func() { adminCli.Close() }()
project, err := adminCli.CreateProject(context.Background(), "fail-webhook-after-retries")
assert.NoError(t, err)
project.AuthWebhookURL = authServer.URL
Expand Down Expand Up @@ -294,7 +294,7 @@ func TestAuthWebhook(t *testing.T) {
defer func() { assert.NoError(t, svr.Shutdown(true)) }()

adminCli := helper.CreateAdminCli(t, svr.RPCAddr())
defer func() { assert.NoError(t, adminCli.Close()) }()
defer func() { adminCli.Close() }()
project, err := adminCli.CreateProject(context.Background(), "auth-request-cache")
assert.NoError(t, err)
project.AuthWebhookURL = authServer.URL
Expand Down Expand Up @@ -370,7 +370,7 @@ func TestAuthWebhook(t *testing.T) {
defer func() { assert.NoError(t, svr.Shutdown(true)) }()

adminCli := helper.CreateAdminCli(t, svr.RPCAddr())
defer func() { assert.NoError(t, adminCli.Close()) }()
defer func() { adminCli.Close() }()
project, err := adminCli.CreateProject(context.Background(), "unauth-request-cache")
assert.NoError(t, err)
project.AuthWebhookURL = authServer.URL
Expand Down
2 changes: 1 addition & 1 deletion test/integration/document_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ func TestDocument(t *testing.T) {
func TestDocumentWithProjects(t *testing.T) {
ctx := context.Background()
adminCli := helper.CreateAdminCli(t, defaultServer.RPCAddr())
defer func() { assert.NoError(t, adminCli.Close()) }()
defer func() { adminCli.Close() }()

project1, err := adminCli.CreateProject(ctx, "project1")
assert.NoError(t, err)
Expand Down
Loading

1 comment on commit 2f30459

@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: 2f30459 Previous: 3ebef65 Ratio
BenchmarkDocument/constructor_test - ns/op 1339 ns/op 1373 ns/op 0.98
BenchmarkDocument/constructor_test - B/op 1208 B/op 1208 B/op 1
BenchmarkDocument/constructor_test - allocs/op 20 allocs/op 20 allocs/op 1
BenchmarkDocument/status_test - ns/op 780.5 ns/op 796.5 ns/op 0.98
BenchmarkDocument/status_test - B/op 1176 B/op 1176 B/op 1
BenchmarkDocument/status_test - allocs/op 18 allocs/op 18 allocs/op 1
BenchmarkDocument/equals_test - ns/op 7117 ns/op 8302 ns/op 0.86
BenchmarkDocument/equals_test - B/op 6913 B/op 6913 B/op 1
BenchmarkDocument/equals_test - allocs/op 120 allocs/op 120 allocs/op 1
BenchmarkDocument/nested_update_test - ns/op 16013 ns/op 16598 ns/op 0.96
BenchmarkDocument/nested_update_test - B/op 11963 B/op 11962 B/op 1.00
BenchmarkDocument/nested_update_test - allocs/op 254 allocs/op 254 allocs/op 1
BenchmarkDocument/delete_test - ns/op 21682 ns/op 22626 ns/op 0.96
BenchmarkDocument/delete_test - B/op 15188 B/op 15188 B/op 1
BenchmarkDocument/delete_test - allocs/op 333 allocs/op 333 allocs/op 1
BenchmarkDocument/object_test - ns/op 9369 ns/op 8699 ns/op 1.08
BenchmarkDocument/object_test - B/op 6721 B/op 6721 B/op 1
BenchmarkDocument/object_test - allocs/op 116 allocs/op 116 allocs/op 1
BenchmarkDocument/array_test - ns/op 28502 ns/op 29401 ns/op 0.97
BenchmarkDocument/array_test - B/op 11819 B/op 11819 B/op 1
BenchmarkDocument/array_test - allocs/op 270 allocs/op 270 allocs/op 1
BenchmarkDocument/text_test - ns/op 30202 ns/op 31226 ns/op 0.97
BenchmarkDocument/text_test - B/op 14796 B/op 14795 B/op 1.00
BenchmarkDocument/text_test - allocs/op 468 allocs/op 468 allocs/op 1
BenchmarkDocument/text_composition_test - ns/op 28724 ns/op 29299 ns/op 0.98
BenchmarkDocument/text_composition_test - B/op 18278 B/op 18278 B/op 1
BenchmarkDocument/text_composition_test - allocs/op 477 allocs/op 477 allocs/op 1
BenchmarkDocument/rich_text_test - ns/op 79599 ns/op 82820 ns/op 0.96
BenchmarkDocument/rich_text_test - B/op 38541 B/op 38540 B/op 1.00
BenchmarkDocument/rich_text_test - allocs/op 1147 allocs/op 1147 allocs/op 1
BenchmarkDocument/counter_test - ns/op 16633 ns/op 17386 ns/op 0.96
BenchmarkDocument/counter_test - B/op 10210 B/op 10210 B/op 1
BenchmarkDocument/counter_test - allocs/op 236 allocs/op 236 allocs/op 1
BenchmarkDocument/text_edit_gc_100 - ns/op 2887114 ns/op 2970186 ns/op 0.97
BenchmarkDocument/text_edit_gc_100 - B/op 1655368 B/op 1655326 B/op 1.00
BenchmarkDocument/text_edit_gc_100 - allocs/op 17093 allocs/op 17093 allocs/op 1
BenchmarkDocument/text_edit_gc_1000 - ns/op 229301808 ns/op 231735416 ns/op 0.99
BenchmarkDocument/text_edit_gc_1000 - B/op 144353060 B/op 144366033 B/op 1.00
BenchmarkDocument/text_edit_gc_1000 - allocs/op 200941 allocs/op 201007 allocs/op 1.00
BenchmarkDocument/text_split_gc_100 - ns/op 3353990 ns/op 3385194 ns/op 0.99
BenchmarkDocument/text_split_gc_100 - B/op 2313854 B/op 2313331 B/op 1.00
BenchmarkDocument/text_split_gc_100 - allocs/op 16196 allocs/op 16194 allocs/op 1.00
BenchmarkDocument/text_split_gc_1000 - ns/op 284435946 ns/op 296761342 ns/op 0.96
BenchmarkDocument/text_split_gc_1000 - B/op 228925656 B/op 228881832 B/op 1.00
BenchmarkDocument/text_split_gc_1000 - allocs/op 204123 allocs/op 203904 allocs/op 1.00
BenchmarkDocument/text_delete_all_10000 - ns/op 10956314 ns/op 11146892 ns/op 0.98
BenchmarkDocument/text_delete_all_10000 - B/op 5811461 B/op 5810543 B/op 1.00
BenchmarkDocument/text_delete_all_10000 - allocs/op 40679 allocs/op 40675 allocs/op 1.00
BenchmarkDocument/text_delete_all_100000 - ns/op 183140942 ns/op 187188955 ns/op 0.98
BenchmarkDocument/text_delete_all_100000 - B/op 81896778 B/op 81887592 B/op 1.00
BenchmarkDocument/text_delete_all_100000 - allocs/op 411607 allocs/op 411550 allocs/op 1.00
BenchmarkDocument/text_100 - ns/op 218358 ns/op 232235 ns/op 0.94
BenchmarkDocument/text_100 - B/op 118483 B/op 118483 B/op 1
BenchmarkDocument/text_100 - allocs/op 5080 allocs/op 5080 allocs/op 1
BenchmarkDocument/text_1000 - ns/op 2355576 ns/op 2502773 ns/op 0.94
BenchmarkDocument/text_1000 - B/op 1153066 B/op 1153073 B/op 1.00
BenchmarkDocument/text_1000 - allocs/op 50084 allocs/op 50084 allocs/op 1
BenchmarkDocument/array_1000 - ns/op 1181279 ns/op 1267389 ns/op 0.93
BenchmarkDocument/array_1000 - B/op 1091266 B/op 1091268 B/op 1.00
BenchmarkDocument/array_1000 - allocs/op 11825 allocs/op 11826 allocs/op 1.00
BenchmarkDocument/array_10000 - ns/op 12815419 ns/op 13549731 ns/op 0.95
BenchmarkDocument/array_10000 - B/op 9799841 B/op 9800047 B/op 1.00
BenchmarkDocument/array_10000 - allocs/op 120290 allocs/op 120291 allocs/op 1.00
BenchmarkDocument/array_gc_100 - ns/op 143747 ns/op 153664 ns/op 0.94
BenchmarkDocument/array_gc_100 - B/op 132482 B/op 132498 B/op 1.00
BenchmarkDocument/array_gc_100 - allocs/op 1248 allocs/op 1248 allocs/op 1
BenchmarkDocument/array_gc_1000 - ns/op 1366302 ns/op 1451255 ns/op 0.94
BenchmarkDocument/array_gc_1000 - B/op 1159016 B/op 1158965 B/op 1.00
BenchmarkDocument/array_gc_1000 - allocs/op 12865 allocs/op 12865 allocs/op 1
BenchmarkDocument/counter_1000 - ns/op 199030 ns/op 215664 ns/op 0.92
BenchmarkDocument/counter_1000 - B/op 192853 B/op 192852 B/op 1.00
BenchmarkDocument/counter_1000 - allocs/op 5765 allocs/op 5765 allocs/op 1
BenchmarkDocument/counter_10000 - ns/op 2168861 ns/op 2222359 ns/op 0.98
BenchmarkDocument/counter_10000 - B/op 2087782 B/op 2087783 B/op 1.00
BenchmarkDocument/counter_10000 - allocs/op 59772 allocs/op 59772 allocs/op 1
BenchmarkDocument/object_1000 - ns/op 1338801 ns/op 1433455 ns/op 0.93
BenchmarkDocument/object_1000 - B/op 1428375 B/op 1427946 B/op 1.00
BenchmarkDocument/object_1000 - allocs/op 9846 allocs/op 9845 allocs/op 1.00
BenchmarkDocument/object_10000 - ns/op 14578264 ns/op 14878581 ns/op 0.98
BenchmarkDocument/object_10000 - B/op 12170760 B/op 12167003 B/op 1.00
BenchmarkDocument/object_10000 - allocs/op 100574 allocs/op 100561 allocs/op 1.00
BenchmarkDocument/tree_100 - ns/op 1030248 ns/op 722947 ns/op 1.43
BenchmarkDocument/tree_100 - B/op 943682 B/op 442891 B/op 2.13
BenchmarkDocument/tree_100 - allocs/op 6099 allocs/op 4506 allocs/op 1.35
BenchmarkDocument/tree_1000 - ns/op 73782778 ns/op 48715965 ns/op 1.51
BenchmarkDocument/tree_1000 - B/op 86460260 B/op 35222566 B/op 2.45
BenchmarkDocument/tree_1000 - allocs/op 60112 allocs/op 44119 allocs/op 1.36
BenchmarkDocument/tree_10000 - ns/op 9322107517 ns/op 6243742972 ns/op 1.49
BenchmarkDocument/tree_10000 - B/op 8580663832 B/op 3439193776 B/op 2.49
BenchmarkDocument/tree_10000 - allocs/op 600241 allocs/op 440204 allocs/op 1.36
BenchmarkDocument/tree_delete_all_1000 - ns/op 73169682 ns/op 50492483 ns/op 1.45
BenchmarkDocument/tree_delete_all_1000 - B/op 86991288 B/op 35687345 B/op 2.44
BenchmarkDocument/tree_delete_all_1000 - allocs/op 67754 allocs/op 51744 allocs/op 1.31
BenchmarkDocument/tree_edit_gc_100 - ns/op 3657919 ns/op 2674319 ns/op 1.37
BenchmarkDocument/tree_edit_gc_100 - B/op 4121896 B/op 2099522 B/op 1.96
BenchmarkDocument/tree_edit_gc_100 - allocs/op 14356 allocs/op 11165 allocs/op 1.29
BenchmarkDocument/tree_edit_gc_1000 - ns/op 293220735 ns/op 200656697 ns/op 1.46
BenchmarkDocument/tree_edit_gc_1000 - B/op 383467128 B/op 180293307 B/op 2.13
BenchmarkDocument/tree_edit_gc_1000 - allocs/op 145417 allocs/op 113350 allocs/op 1.28
BenchmarkDocument/tree_split_gc_100 - ns/op 2431265 ns/op 1969140 ns/op 1.23
BenchmarkDocument/tree_split_gc_100 - B/op 2386823 B/op 1363475 B/op 1.75
BenchmarkDocument/tree_split_gc_100 - allocs/op 10341 allocs/op 8735 allocs/op 1.18
BenchmarkDocument/tree_split_gc_1000 - ns/op 177256699 ns/op 133034523 ns/op 1.33
BenchmarkDocument/tree_split_gc_1000 - B/op 221990232 B/op 120284053 B/op 1.85
BenchmarkDocument/tree_split_gc_1000 - allocs/op 112246 allocs/op 96193 allocs/op 1.17
BenchmarkRPC/client_to_server - ns/op 353771834 ns/op 356375965 ns/op 0.99
BenchmarkRPC/client_to_server - B/op 16938973 B/op 16323573 B/op 1.04
BenchmarkRPC/client_to_server - allocs/op 165907 allocs/op 165420 allocs/op 1.00
BenchmarkRPC/client_to_client_via_server - ns/op 601270054 ns/op 607723810 ns/op 0.99
BenchmarkRPC/client_to_client_via_server - B/op 33719996 B/op 34041892 B/op 0.99
BenchmarkRPC/client_to_client_via_server - allocs/op 311376 allocs/op 309871 allocs/op 1.00
BenchmarkRPC/attach_large_document - ns/op 1200754425 ns/op 1463602622 ns/op 0.82
BenchmarkRPC/attach_large_document - B/op 1889216152 B/op 1878647264 B/op 1.01
BenchmarkRPC/attach_large_document - allocs/op 7528 allocs/op 7043 allocs/op 1.07
BenchmarkRPC/adminCli_to_server - ns/op 535254777 ns/op 541741676 ns/op 0.99
BenchmarkRPC/adminCli_to_server - B/op 35994564 B/op 36380716 B/op 0.99
BenchmarkRPC/adminCli_to_server - allocs/op 289160 allocs/op 284616 allocs/op 1.02
BenchmarkLocker - ns/op 66.23 ns/op 65.29 ns/op 1.01
BenchmarkLocker - B/op 16 B/op 16 B/op 1
BenchmarkLocker - allocs/op 1 allocs/op 1 allocs/op 1
BenchmarkLockerParallel - ns/op 38.53 ns/op 38.64 ns/op 1.00
BenchmarkLockerParallel - B/op 0 B/op 0 B/op NaN
BenchmarkLockerParallel - allocs/op 0 allocs/op 0 allocs/op NaN
BenchmarkLockerMoreKeys - ns/op 153.1 ns/op 138.5 ns/op 1.11
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 3739014 ns/op 3779429 ns/op 0.99
BenchmarkChange/Push_10_Changes - B/op 126543 B/op 126275 B/op 1.00
BenchmarkChange/Push_10_Changes - allocs/op 1254 allocs/op 1254 allocs/op 1
BenchmarkChange/Push_100_Changes - ns/op 14014066 ns/op 14129092 ns/op 0.99
BenchmarkChange/Push_100_Changes - B/op 647402 B/op 646942 B/op 1.00
BenchmarkChange/Push_100_Changes - allocs/op 6540 allocs/op 6540 allocs/op 1
BenchmarkChange/Push_1000_Changes - ns/op 112514599 ns/op 113213707 ns/op 0.99
BenchmarkChange/Push_1000_Changes - B/op 6073258 B/op 6011043 B/op 1.01
BenchmarkChange/Push_1000_Changes - allocs/op 62160 allocs/op 62155 allocs/op 1.00
BenchmarkChange/Pull_10_Changes - ns/op 2802245 ns/op 2837624 ns/op 0.99
BenchmarkChange/Pull_10_Changes - B/op 100865 B/op 100327 B/op 1.01
BenchmarkChange/Pull_10_Changes - allocs/op 952 allocs/op 951 allocs/op 1.00
BenchmarkChange/Pull_100_Changes - ns/op 4279667 ns/op 4303014 ns/op 0.99
BenchmarkChange/Pull_100_Changes - B/op 258479 B/op 257269 B/op 1.00
BenchmarkChange/Pull_100_Changes - allocs/op 3154 allocs/op 3154 allocs/op 1
BenchmarkChange/Pull_1000_Changes - ns/op 8051829 ns/op 8473189 ns/op 0.95
BenchmarkChange/Pull_1000_Changes - B/op 1396132 B/op 1393414 B/op 1.00
BenchmarkChange/Pull_1000_Changes - allocs/op 26874 allocs/op 26869 allocs/op 1.00
BenchmarkSnapshot/Push_3KB_snapshot - ns/op 16553294 ns/op 16717315 ns/op 0.99
BenchmarkSnapshot/Push_3KB_snapshot - B/op 799629 B/op 807884 B/op 0.99
BenchmarkSnapshot/Push_3KB_snapshot - allocs/op 6541 allocs/op 6541 allocs/op 1
BenchmarkSnapshot/Push_30KB_snapshot - ns/op 116226079 ns/op 117501595 ns/op 0.99
BenchmarkSnapshot/Push_30KB_snapshot - B/op 6247193 B/op 6250940 B/op 1.00
BenchmarkSnapshot/Push_30KB_snapshot - allocs/op 62164 allocs/op 62161 allocs/op 1.00
BenchmarkSnapshot/Pull_3KB_snapshot - ns/op 6482660 ns/op 6521588 ns/op 0.99
BenchmarkSnapshot/Pull_3KB_snapshot - B/op 906516 B/op 904310 B/op 1.00
BenchmarkSnapshot/Pull_3KB_snapshot - allocs/op 14880 allocs/op 14878 allocs/op 1.00
BenchmarkSnapshot/Pull_30KB_snapshot - ns/op 14587157 ns/op 15228711 ns/op 0.96
BenchmarkSnapshot/Pull_30KB_snapshot - B/op 6981341 B/op 6983077 B/op 1.00
BenchmarkSnapshot/Pull_30KB_snapshot - allocs/op 144141 allocs/op 144141 allocs/op 1
BenchmarkSync/memory_sync_10_test - ns/op 6833 ns/op 6917 ns/op 0.99
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 51368 ns/op 51493 ns/op 1.00
BenchmarkSync/memory_sync_100_test - B/op 8655 B/op 8650 B/op 1.00
BenchmarkSync/memory_sync_100_test - allocs/op 274 allocs/op 273 allocs/op 1.00
BenchmarkSync/memory_sync_1000_test - ns/op 578405 ns/op 598451 ns/op 0.97
BenchmarkSync/memory_sync_1000_test - B/op 74872 B/op 74330 B/op 1.01
BenchmarkSync/memory_sync_1000_test - allocs/op 2140 allocs/op 2108 allocs/op 1.02
BenchmarkSync/memory_sync_10000_test - ns/op 7204790 ns/op 7141413 ns/op 1.01
BenchmarkSync/memory_sync_10000_test - B/op 760517 B/op 761330 B/op 1.00
BenchmarkSync/memory_sync_10000_test - allocs/op 20564 allocs/op 20560 allocs/op 1.00
BenchmarkTextEditing - ns/op 18416794125 ns/op 19117165431 ns/op 0.96
BenchmarkTextEditing - B/op 9037990640 B/op 9037584392 B/op 1.00
BenchmarkTextEditing - allocs/op 19923458 allocs/op 19921383 allocs/op 1.00

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

Please sign in to comment.