Skip to content

Commit

Permalink
Update overall codes
Browse files Browse the repository at this point in the history
  • Loading branch information
krapie committed Dec 12, 2023
1 parent 1a38601 commit 56fb0eb
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 57 deletions.
13 changes: 9 additions & 4 deletions admin/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (i *AuthInterceptor) SetToken(token string) {
i.token = token
}

// WrapUnary creates a unary server interceptor for building additional context.
// WrapUnary creates a unary server interceptor for authorization.
func (i *AuthInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc {
return func(
ctx context.Context,
Expand All @@ -55,17 +55,22 @@ func (i *AuthInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc {
}
}

// WrapStreamingClient creates a stream client interceptor for building additional context.
// WrapStreamingClient creates a stream client interceptor for authorization.
func (i *AuthInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc {
return func(
ctx context.Context,
spec connect.Spec,
) connect.StreamingClientConn {
return next(ctx, spec)
conn := next(ctx, spec)

conn.RequestHeader().Add(types.AuthorizationKey, i.token)
conn.RequestHeader().Add(types.UserAgentKey, types.GoSDKType+"/"+version.Version)

return conn
}
}

// WrapStreamingHandler creates a stream server interceptor for building additional context.
// WrapStreamingHandler creates a stream server interceptor for authorization.
func (i *AuthInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {
return func(
ctx context.Context,
Expand Down
7 changes: 4 additions & 3 deletions client/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func NewAuthInterceptor(apiKey, token string) *AuthInterceptor {
}
}

// WrapUnary creates a unary server interceptor for building additional context.
// WrapUnary creates a unary server interceptor for authorization.
func (i *AuthInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc {
return func(
ctx context.Context,
Expand All @@ -53,20 +53,21 @@ func (i *AuthInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc {
}
}

// WrapStreamingClient creates a stream client interceptor for building additional context.
// WrapStreamingClient creates a stream client interceptor for authorization.
func (i *AuthInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc {
return func(
ctx context.Context,
spec connect.Spec,
) connect.StreamingClientConn {
conn := next(ctx, spec)

conn.RequestHeader().Set(types.APIKeyKey, i.apiKey)

return conn
}
}

// WrapStreamingHandler creates a stream server interceptor for building additional context.
// WrapStreamingHandler creates a stream server interceptor for authorization.
func (i *AuthInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {
return func(
ctx context.Context,
Expand Down
12 changes: 2 additions & 10 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,26 +426,18 @@ func (c *Client) Watch(

for stream.Receive() {
pbResp := stream.Msg()
if err != nil {
return nil, err
}
if _, err := handleResponse(pbResp, doc); err != nil {
return nil, err
}
break
}
if err = stream.Err(); err != nil {
return nil, connect.NewError(connect.CodeUnavailable, err)
return nil, err
}

go func() {
for stream.Receive() {
pbResp := stream.Msg()
if err != nil {
rch <- WatchResponse{Err: err}
close(rch)
return
}
resp, err := handleResponse(pbResp, doc)
if err != nil {
rch <- WatchResponse{Err: err}
Expand Down Expand Up @@ -732,7 +724,7 @@ func newTLSConfigFromFile(certFile, serverNameOverride string) (*tls.Config, err
return nil, fmt.Errorf("credentials: failed to append certificates")
}

return &tls.Config{ServerName: serverNameOverride, RootCAs: cp, MinVersion: tls.VersionTLS13}, nil
return &tls.Config{ServerName: serverNameOverride, RootCAs: cp, MinVersion: tls.VersionTLS12}, nil
}

/**
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
github.com/go-playground/universal-translator v0.18.0
github.com/go-playground/validator/v10 v10.11.1
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/hashicorp/go-memdb v1.3.3
github.com/jedib0t/go-pretty/v6 v6.4.9
github.com/prometheus/client_golang v1.13.0
Expand Down
8 changes: 4 additions & 4 deletions server/rpc/connecthelper/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

// Package connecthelper provides helper functions for gRPC.
// Package connecthelper provides helper functions for connectRPC.
package connecthelper

import (
Expand Down Expand Up @@ -44,7 +44,7 @@ func NewLoggingInterceptor() *LoggingInterceptor {
return &LoggingInterceptor{}
}

// WrapUnary creates a unary server interceptor for building additional context.
// WrapUnary creates a unary server interceptor for request logging.
func (i *LoggingInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc {
return func(
ctx context.Context,
Expand All @@ -55,7 +55,7 @@ func (i *LoggingInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc
}
}

// WrapStreamingClient creates a stream client interceptor for building additional context.
// WrapStreamingClient creates a stream client interceptor for request logging.
func (i *LoggingInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc {
return func(
ctx context.Context,
Expand All @@ -65,7 +65,7 @@ func (i *LoggingInterceptor) WrapStreamingClient(next connect.StreamingClientFun
}
}

// WrapStreamingHandler creates a stream server interceptor for building additional context.
// WrapStreamingHandler creates a stream server interceptor for request logging.
func (i *LoggingInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {
return func(
ctx context.Context,
Expand Down
6 changes: 3 additions & 3 deletions server/rpc/connecthelper/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
"github.com/yorkie-team/yorkie/server/rpc/auth"
)

// errorToCode maps an error to gRPC status code.
// errorToCode maps an error to connectRPC status code.
var errorToCode = map[error]connect.Code{
// InvalidArgument means the request is malformed.
converter.ErrPackRequired: connect.CodeInvalidArgument,
Expand Down Expand Up @@ -105,8 +105,8 @@ func detailsFromError(err error) (*errdetails.BadRequest, bool) {
return br, true
}

// ToStatusError returns a status.Error from the given logic error. If an error
// occurs while executing logic in API handler, gRPC status.error should be
// ToStatusError returns a connect.Error from the given logic error. If an error
// occurs while executing logic in API handler, connectRPC connect.error should be
// returned so that the client can know more about the status of the request.
func ToStatusError(err error) error {
cause := err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ func (i *AdminAuthInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFu

res, err := next(ctx, req)

// TODO(hackerwins, emplam27): Consider splitting between admin and sdk metrics.
sdkType, sdkVersion := connecthelper.SDKTypeAndVersion(req.Header())
i.backend.Metrics.AddUserAgentWithEmptyProject(
i.backend.Config.Hostname,
sdkType,
sdkVersion,
req.Spec().Procedure,
)

i.backend.Metrics.AddServerHandledCounter(
"unary",
strings.Split(req.Spec().Procedure, "/")[1],
Expand All @@ -78,18 +87,17 @@ func (i *AdminAuthInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFu
}
}

// WrapStreamingClient creates a stream client interceptor for building additional context.
// WrapStreamingClient creates a stream client interceptor for authentication.
func (i *AdminAuthInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc {
return func(
ctx context.Context,
spec connect.Spec,
) connect.StreamingClientConn {
conn := next(ctx, spec)
return conn
return next(ctx, spec)
}
}

// WrapStreamingHandler creates a stream server interceptor for building additional context.
// WrapStreamingHandler creates a stream server interceptor for authentication.
func (i *AdminAuthInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {
return func(
ctx context.Context,
Expand All @@ -109,6 +117,15 @@ func (i *AdminAuthInterceptor) WrapStreamingHandler(next connect.StreamingHandle

err := next(ctx, conn)

// TODO(hackerwins, emplam27): Consider splitting between admin and sdk metrics.
sdkType, sdkVersion := connecthelper.SDKTypeAndVersion(conn.RequestHeader())
i.backend.Metrics.AddUserAgentWithEmptyProject(
i.backend.Config.Hostname,
sdkType,
sdkVersion,
conn.Spec().Procedure,
)

i.backend.Metrics.AddServerHandledCounter(
"server_stream",
strings.Split(conn.Spec().Procedure, "/")[1],
Expand All @@ -135,7 +152,7 @@ func (i *AdminAuthInterceptor) authenticate(
header http.Header,
) (*types.User, error) {
authorization := header.Get(types.AuthorizationKey)
if len(authorization) == 0 {
if authorization == "" {
return nil, grpcstatus.Errorf(codes.Unauthenticated, "authorization is not provided")
}

Expand Down
14 changes: 7 additions & 7 deletions server/rpc/interceptors/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ func (i *ContextInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc
return nil, err
}

res, err := next(ctx, req)

sdkType, sdkVersion := connecthelper.SDKTypeAndVersion(req.Header())
i.backend.Metrics.AddUserAgent(
i.backend.Config.Hostname,
Expand All @@ -77,8 +79,6 @@ func (i *ContextInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc
req.Spec().Procedure,
)

res, err := next(ctx, req)

i.backend.Metrics.AddServerHandledCounter(
"unary",
strings.Split(req.Spec().Procedure, "/")[1],
Expand Down Expand Up @@ -115,6 +115,8 @@ func (i *ContextInterceptor) WrapStreamingHandler(next connect.StreamingHandlerF
return err
}

err = next(ctx, conn)

sdkType, sdkVersion := connecthelper.SDKTypeAndVersion(conn.RequestHeader())
i.backend.Metrics.AddUserAgent(
i.backend.Config.Hostname,
Expand All @@ -124,8 +126,6 @@ func (i *ContextInterceptor) WrapStreamingHandler(next connect.StreamingHandlerF
conn.Spec().Procedure,
)

err = next(ctx, conn)

i.backend.Metrics.AddServerHandledCounter(
"server_stream",
strings.Split(conn.Spec().Procedure, "/")[1],
Expand All @@ -148,15 +148,15 @@ func (i *ContextInterceptor) buildContext(ctx context.Context, header http.Heade
md := metadata.Metadata{}

apiKey := header.Get(types.APIKeyKey)
if len(apiKey) == 0 && !i.backend.Config.UseDefaultProject {
if apiKey == "" && !i.backend.Config.UseDefaultProject {
return nil, connect.NewError(connect.CodeUnauthenticated, errors.New("api key is not provided"))
}
if len(apiKey) > 0 {
if apiKey != "" {
md.APIKey = apiKey
}

authorization := header.Get(types.AuthorizationKey)
if len(authorization) > 0 {
if authorization != "" {
md.Authorization = authorization
}
ctx = metadata.With(ctx, md)
Expand Down
6 changes: 3 additions & 3 deletions server/rpc/interceptors/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const (
SlowThreshold = 100 * gotime.Millisecond
)

// WrapUnary creates a unary server interceptor for building additional context.
// WrapUnary creates a unary server interceptor for default.
func (i *DefaultInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc {
return func(
ctx context.Context,
Expand All @@ -62,7 +62,7 @@ func (i *DefaultInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc
}
}

// WrapStreamingClient creates a stream client interceptor for building additional context.
// WrapStreamingClient creates a stream client interceptor for default.
func (i *DefaultInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc {
return func(
ctx context.Context,
Expand All @@ -72,7 +72,7 @@ func (i *DefaultInterceptor) WrapStreamingClient(next connect.StreamingClientFun
}
}

// WrapStreamingHandler creates a stream server interceptor for building additional context.
// WrapStreamingHandler creates a stream server interceptor for default.
func (i *DefaultInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {
return func(
ctx context.Context,
Expand Down
2 changes: 1 addition & 1 deletion server/rpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (s *Server) Shutdown(graceful bool) {

func (s *Server) listenAndServe() error {
go func() {
logging.DefaultLogger().Infof(fmt.Sprintf("serving rpc on %d", s.conf.Port))
logging.DefaultLogger().Infof(fmt.Sprintf("serving RPC on %d", s.conf.Port))
s.httpServer.Handler = h2c.NewHandler(
newCORS().Handler(s.serverMux),
&http2.Server{},
Expand Down
19 changes: 5 additions & 14 deletions server/rpc/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ func TestMain(m *testing.M) {
ProjectInfoCacheSize: helper.ProjectInfoCacheSize,
ProjectInfoCacheTTL: helper.ProjectInfoCacheTTL.String(),
AdminTokenDuration: helper.AdminTokenDuration,
UseDefaultProject: true,
}, &mongo.Config{
ConnectionURI: helper.MongoConnectionURI,
YorkieDatabase: helper.TestDBName(),
Expand All @@ -101,10 +100,10 @@ func TestMain(m *testing.M) {
}

testRPCServer, err = rpc.NewServer(&rpc.Config{
Port: helper.RPCPort,
//MaxRequestBytes: helper.RPCMaxRequestBytes,
//MaxConnectionAge: helper.RPCMaxConnectionAge.String(),
//MaxConnectionAgeGrace: helper.RPCMaxConnectionAgeGrace.String(),
Port: helper.RPCPort,
MaxRequestBytes: helper.RPCMaxRequestBytes,
MaxConnectionAge: helper.RPCMaxConnectionAge.String(),
MaxConnectionAgeGrace: helper.RPCMaxConnectionAgeGrace.String(),
}, be)
if err != nil {
log.Fatal(err)
Expand All @@ -114,11 +113,7 @@ func TestMain(m *testing.M) {
log.Fatalf("failed rpc listen: %s\n", err)
}

//var dialOptions []grpc.DialOption
authInterceptor := client.NewAuthInterceptor(project.PublicKey, "")
//dialOptions = append(dialOptions, grpc.WithUnaryInterceptor(authInterceptor.Unary()))
//dialOptions = append(dialOptions, grpc.WithStreamInterceptor(authInterceptor.Stream()))
//dialOptions = append(dialOptions, grpc.WithTransportCredentials(insecure.NewCredentials()))

conn := http.DefaultClient
testClient = v1connect.NewYorkieServiceClient(
Expand All @@ -127,12 +122,7 @@ func TestMain(m *testing.M) {
connect.WithInterceptors(authInterceptor),
)

//credentials := grpc.WithTransportCredentials(insecure.NewCredentials())
//dialOptions = []grpc.DialOption{credentials}

testAdminAuthInterceptor = admin.NewAuthInterceptor("")
//dialOptions = append(dialOptions, grpc.WithUnaryInterceptor(testAdminAuthInterceptor.Unary()))
//dialOptions = append(dialOptions, grpc.WithStreamInterceptor(testAdminAuthInterceptor.Stream()))

adminConn := http.DefaultClient
testAdminClient = v1connect.NewAdminServiceClient(
Expand Down Expand Up @@ -675,6 +665,7 @@ func TestSDKRPCServerBackend(t *testing.T) {
break
}

// TODO(krapie): find a way to set timeout for stream
//// wait for MaxConnectionAge + MaxConnectionAgeGrace
//time.Sleep(helper.RPCMaxConnectionAge + helper.RPCMaxConnectionAgeGrace)
//
Expand Down
4 changes: 2 additions & 2 deletions test/integration/tree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ func TestTree(t *testing.T) {
root.GetTree("t").EditBulk(3, 3, []*json.TreeNode{{
Type: "text",
Value: "c",
}, {
}, &json.TreeNode{
Type: "text",
Value: "d",
}}, 0)
Expand All @@ -451,7 +451,7 @@ func TestTree(t *testing.T) {
root.GetTree("t").EditBulk(4, 4, []*json.TreeNode{{
Type: "p",
Children: []json.TreeNode{{Type: "text", Value: "cd"}},
}, {
}, &json.TreeNode{
Type: "i",
Children: []json.TreeNode{{Type: "text", Value: "fg"}},
}}, 0)
Expand Down

1 comment on commit 56fb0eb

@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: 56fb0eb Previous: 3ebef65 Ratio
BenchmarkDocument/constructor_test - ns/op 1334 ns/op 1373 ns/op 0.97
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 788.4 ns/op 796.5 ns/op 0.99
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 7163 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 16268 ns/op 16598 ns/op 0.98
BenchmarkDocument/nested_update_test - B/op 11962 B/op 11962 B/op 1
BenchmarkDocument/nested_update_test - allocs/op 254 allocs/op 254 allocs/op 1
BenchmarkDocument/delete_test - ns/op 25274 ns/op 22626 ns/op 1.12
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 8381 ns/op 8699 ns/op 0.96
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 29316 ns/op 29401 ns/op 1.00
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 30536 ns/op 31226 ns/op 0.98
BenchmarkDocument/text_test - B/op 14795 B/op 14795 B/op 1
BenchmarkDocument/text_test - allocs/op 468 allocs/op 468 allocs/op 1
BenchmarkDocument/text_composition_test - ns/op 28878 ns/op 29299 ns/op 0.99
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 80768 ns/op 82820 ns/op 0.98
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 16752 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 2926927 ns/op 2970186 ns/op 0.99
BenchmarkDocument/text_edit_gc_100 - B/op 1655345 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 233838425 ns/op 231735416 ns/op 1.01
BenchmarkDocument/text_edit_gc_1000 - B/op 144371761 B/op 144366033 B/op 1.00
BenchmarkDocument/text_edit_gc_1000 - allocs/op 201037 allocs/op 201007 allocs/op 1.00
BenchmarkDocument/text_split_gc_100 - ns/op 3412770 ns/op 3385194 ns/op 1.01
BenchmarkDocument/text_split_gc_100 - B/op 2313754 B/op 2313331 B/op 1.00
BenchmarkDocument/text_split_gc_100 - allocs/op 16195 allocs/op 16194 allocs/op 1.00
BenchmarkDocument/text_split_gc_1000 - ns/op 292675220 ns/op 296761342 ns/op 0.99
BenchmarkDocument/text_split_gc_1000 - B/op 228930584 B/op 228881832 B/op 1.00
BenchmarkDocument/text_split_gc_1000 - allocs/op 204136 allocs/op 203904 allocs/op 1.00
BenchmarkDocument/text_delete_all_10000 - ns/op 11565463 ns/op 11146892 ns/op 1.04
BenchmarkDocument/text_delete_all_10000 - B/op 5810471 B/op 5810543 B/op 1.00
BenchmarkDocument/text_delete_all_10000 - allocs/op 40675 allocs/op 40675 allocs/op 1
BenchmarkDocument/text_delete_all_100000 - ns/op 205362918 ns/op 187188955 ns/op 1.10
BenchmarkDocument/text_delete_all_100000 - B/op 81900693 B/op 81887592 B/op 1.00
BenchmarkDocument/text_delete_all_100000 - allocs/op 411626 allocs/op 411550 allocs/op 1.00
BenchmarkDocument/text_100 - ns/op 221818 ns/op 232235 ns/op 0.96
BenchmarkDocument/text_100 - B/op 118481 B/op 118483 B/op 1.00
BenchmarkDocument/text_100 - allocs/op 5080 allocs/op 5080 allocs/op 1
BenchmarkDocument/text_1000 - ns/op 2421210 ns/op 2502773 ns/op 0.97
BenchmarkDocument/text_1000 - B/op 1153070 B/op 1153073 B/op 1.00
BenchmarkDocument/text_1000 - allocs/op 50084 allocs/op 50084 allocs/op 1
BenchmarkDocument/array_1000 - ns/op 1198348 ns/op 1267389 ns/op 0.95
BenchmarkDocument/array_1000 - B/op 1091253 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 13330253 ns/op 13549731 ns/op 0.98
BenchmarkDocument/array_10000 - B/op 9800577 B/op 9800047 B/op 1.00
BenchmarkDocument/array_10000 - allocs/op 120293 allocs/op 120291 allocs/op 1.00
BenchmarkDocument/array_gc_100 - ns/op 144824 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 1377811 ns/op 1451255 ns/op 0.95
BenchmarkDocument/array_gc_1000 - B/op 1158960 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 197798 ns/op 215664 ns/op 0.92
BenchmarkDocument/counter_1000 - B/op 192852 B/op 192852 B/op 1
BenchmarkDocument/counter_1000 - allocs/op 5765 allocs/op 5765 allocs/op 1
BenchmarkDocument/counter_10000 - ns/op 2162826 ns/op 2222359 ns/op 0.97
BenchmarkDocument/counter_10000 - B/op 2087766 B/op 2087783 B/op 1.00
BenchmarkDocument/counter_10000 - allocs/op 59772 allocs/op 59772 allocs/op 1
BenchmarkDocument/object_1000 - ns/op 1332871 ns/op 1433455 ns/op 0.93
BenchmarkDocument/object_1000 - B/op 1428016 B/op 1427946 B/op 1.00
BenchmarkDocument/object_1000 - allocs/op 9845 allocs/op 9845 allocs/op 1
BenchmarkDocument/object_10000 - ns/op 14988622 ns/op 14878581 ns/op 1.01
BenchmarkDocument/object_10000 - B/op 12165885 B/op 12167003 B/op 1.00
BenchmarkDocument/object_10000 - allocs/op 100556 allocs/op 100561 allocs/op 1.00
BenchmarkDocument/tree_100 - ns/op 1025131 ns/op 722947 ns/op 1.42
BenchmarkDocument/tree_100 - B/op 943675 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 73855693 ns/op 48715965 ns/op 1.52
BenchmarkDocument/tree_1000 - B/op 86460933 B/op 35222566 B/op 2.45
BenchmarkDocument/tree_1000 - allocs/op 60113 allocs/op 44119 allocs/op 1.36
BenchmarkDocument/tree_10000 - ns/op 9905817856 ns/op 6243742972 ns/op 1.59
BenchmarkDocument/tree_10000 - B/op 8580981224 B/op 3439193776 B/op 2.50
BenchmarkDocument/tree_10000 - allocs/op 600222 allocs/op 440204 allocs/op 1.36
BenchmarkDocument/tree_delete_all_1000 - ns/op 75632234 ns/op 50492483 ns/op 1.50
BenchmarkDocument/tree_delete_all_1000 - B/op 86990727 B/op 35687345 B/op 2.44
BenchmarkDocument/tree_delete_all_1000 - allocs/op 67751 allocs/op 51744 allocs/op 1.31
BenchmarkDocument/tree_edit_gc_100 - ns/op 3778490 ns/op 2674319 ns/op 1.41
BenchmarkDocument/tree_edit_gc_100 - B/op 4120947 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 304913323 ns/op 200656697 ns/op 1.52
BenchmarkDocument/tree_edit_gc_1000 - B/op 383469098 B/op 180293307 B/op 2.13
BenchmarkDocument/tree_edit_gc_1000 - allocs/op 145416 allocs/op 113350 allocs/op 1.28
BenchmarkDocument/tree_split_gc_100 - ns/op 2491814 ns/op 1969140 ns/op 1.27
BenchmarkDocument/tree_split_gc_100 - B/op 2386791 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 185967848 ns/op 133034523 ns/op 1.40
BenchmarkDocument/tree_split_gc_1000 - B/op 221991726 B/op 120284053 B/op 1.85
BenchmarkDocument/tree_split_gc_1000 - allocs/op 112255 allocs/op 96193 allocs/op 1.17
BenchmarkRPC/client_to_server - ns/op 362726473 ns/op 356375965 ns/op 1.02
BenchmarkRPC/client_to_server - B/op 16410042 B/op 16323573 B/op 1.01
BenchmarkRPC/client_to_server - allocs/op 166921 allocs/op 165420 allocs/op 1.01
BenchmarkRPC/client_to_client_via_server - ns/op 616509532 ns/op 607723810 ns/op 1.01
BenchmarkRPC/client_to_client_via_server - B/op 32879916 B/op 34041892 B/op 0.97
BenchmarkRPC/client_to_client_via_server - allocs/op 312771 allocs/op 309871 allocs/op 1.01
BenchmarkRPC/attach_large_document - ns/op 1197812211 ns/op 1463602622 ns/op 0.82
BenchmarkRPC/attach_large_document - B/op 1889220304 B/op 1878647264 B/op 1.01
BenchmarkRPC/attach_large_document - allocs/op 7532 allocs/op 7043 allocs/op 1.07
BenchmarkRPC/adminCli_to_server - ns/op 541553668 ns/op 541741676 ns/op 1.00
BenchmarkRPC/adminCli_to_server - B/op 37232636 B/op 36380716 B/op 1.02
BenchmarkRPC/adminCli_to_server - allocs/op 290187 allocs/op 284616 allocs/op 1.02
BenchmarkLocker - ns/op 65.35 ns/op 65.29 ns/op 1.00
BenchmarkLocker - B/op 16 B/op 16 B/op 1
BenchmarkLocker - allocs/op 1 allocs/op 1 allocs/op 1
BenchmarkLockerParallel - ns/op 39.21 ns/op 38.64 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 157.2 ns/op 138.5 ns/op 1.14
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 3763170 ns/op 3779429 ns/op 1.00
BenchmarkChange/Push_10_Changes - B/op 126292 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 14178848 ns/op 14129092 ns/op 1.00
BenchmarkChange/Push_100_Changes - B/op 644053 B/op 646942 B/op 1.00
BenchmarkChange/Push_100_Changes - allocs/op 6537 allocs/op 6540 allocs/op 1.00
BenchmarkChange/Push_1000_Changes - ns/op 112890273 ns/op 113213707 ns/op 1.00
BenchmarkChange/Push_1000_Changes - B/op 6051497 B/op 6011043 B/op 1.01
BenchmarkChange/Push_1000_Changes - allocs/op 62159 allocs/op 62155 allocs/op 1.00
BenchmarkChange/Pull_10_Changes - ns/op 2869080 ns/op 2837624 ns/op 1.01
BenchmarkChange/Pull_10_Changes - B/op 100336 B/op 100327 B/op 1.00
BenchmarkChange/Pull_10_Changes - allocs/op 952 allocs/op 951 allocs/op 1.00
BenchmarkChange/Pull_100_Changes - ns/op 4361079 ns/op 4303014 ns/op 1.01
BenchmarkChange/Pull_100_Changes - B/op 257254 B/op 257269 B/op 1.00
BenchmarkChange/Pull_100_Changes - allocs/op 3155 allocs/op 3154 allocs/op 1.00
BenchmarkChange/Pull_1000_Changes - ns/op 8624388 ns/op 8473189 ns/op 1.02
BenchmarkChange/Pull_1000_Changes - B/op 1397185 B/op 1393414 B/op 1.00
BenchmarkChange/Pull_1000_Changes - allocs/op 26867 allocs/op 26869 allocs/op 1.00
BenchmarkSnapshot/Push_3KB_snapshot - ns/op 16642709 ns/op 16717315 ns/op 1.00
BenchmarkSnapshot/Push_3KB_snapshot - B/op 808069 B/op 807884 B/op 1.00
BenchmarkSnapshot/Push_3KB_snapshot - allocs/op 6541 allocs/op 6541 allocs/op 1
BenchmarkSnapshot/Push_30KB_snapshot - ns/op 116510285 ns/op 117501595 ns/op 0.99
BenchmarkSnapshot/Push_30KB_snapshot - B/op 6351632 B/op 6250940 B/op 1.02
BenchmarkSnapshot/Push_30KB_snapshot - allocs/op 62348 allocs/op 62161 allocs/op 1.00
BenchmarkSnapshot/Pull_3KB_snapshot - ns/op 6657555 ns/op 6521588 ns/op 1.02
BenchmarkSnapshot/Pull_3KB_snapshot - B/op 904181 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 14935068 ns/op 15228711 ns/op 0.98
BenchmarkSnapshot/Pull_30KB_snapshot - B/op 6984585 B/op 6983077 B/op 1.00
BenchmarkSnapshot/Pull_30KB_snapshot - allocs/op 144140 allocs/op 144141 allocs/op 1.00
BenchmarkSync/memory_sync_10_test - ns/op 6740 ns/op 6917 ns/op 0.97
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 51668 ns/op 51493 ns/op 1.00
BenchmarkSync/memory_sync_100_test - B/op 8643 B/op 8650 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 580839 ns/op 598451 ns/op 0.97
BenchmarkSync/memory_sync_1000_test - B/op 74702 B/op 74330 B/op 1.01
BenchmarkSync/memory_sync_1000_test - allocs/op 2130 allocs/op 2108 allocs/op 1.01
BenchmarkSync/memory_sync_10000_test - ns/op 7568844 ns/op 7141413 ns/op 1.06
BenchmarkSync/memory_sync_10000_test - B/op 761383 B/op 761330 B/op 1.00
BenchmarkSync/memory_sync_10000_test - allocs/op 20568 allocs/op 20560 allocs/op 1.00
BenchmarkTextEditing - ns/op 19771862932 ns/op 19117165431 ns/op 1.03
BenchmarkTextEditing - B/op 9037513528 B/op 9037584392 B/op 1.00
BenchmarkTextEditing - allocs/op 19921083 allocs/op 19921383 allocs/op 1.00

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

Please sign in to comment.