Skip to content

Commit

Permalink
Update client & server configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
krapie committed Dec 11, 2023
1 parent c97c1bf commit f0a8011
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 60 deletions.
30 changes: 11 additions & 19 deletions admin/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package admin

import (
"context"
"crypto/tls"
"fmt"
"net/http"
"strings"
Expand Down Expand Up @@ -66,9 +67,8 @@ type Options struct {

// Client is a client for admin service.
type Client struct {
conn *http.Client
client v1connect.AdminServiceClient
//dialOptions []grpc.DialOption
conn *http.Client
client v1connect.AdminServiceClient
authInterceptor *AuthInterceptor
logger *zap.Logger
}
Expand All @@ -80,16 +80,11 @@ func New(opts ...Option) (*Client, error) {
opt(&options)
}

//tlsConfig := credentials.NewTLS(&tls.Config{MinVersion: tls.VersionTLS12})
//credentialOptions := grpc.WithTransportCredentials(tlsConfig)
//if options.IsInsecure {
// credentialOptions = grpc.WithTransportCredentials(insecure.NewCredentials())
//}
//dialOptions := []grpc.DialOption{credentialOptions}
//
//authInterceptor := NewAuthInterceptor(options.Token)
//dialOptions = append(dialOptions, grpc.WithUnaryInterceptor(authInterceptor.Unary()))
//dialOptions = append(dialOptions, grpc.WithStreamInterceptor(authInterceptor.Stream()))
conn := &http.Client{}
if !options.IsInsecure {
tlsConfig := &tls.Config{MinVersion: tls.VersionTLS12}
conn.Transport = &http.Transport{TLSClientConfig: tlsConfig}
}

logger := options.Logger
if logger == nil {
Expand All @@ -101,8 +96,8 @@ func New(opts ...Option) (*Client, error) {
}

return &Client{
logger: logger,
//dialOptions: dialOptions,
conn: conn,
logger: logger,
authInterceptor: NewAuthInterceptor(options.Token),
}, nil
}
Expand All @@ -127,17 +122,14 @@ func (c *Client) Dial(rpcAddr string) error {
rpcAddr = "http://" + rpcAddr
}

c.conn = http.DefaultClient
c.client = v1connect.NewAdminServiceClient(c.conn, rpcAddr, connect.WithInterceptors(c.authInterceptor))

return nil
}

// Close closes the connection to the admin service.
func (c *Client) Close() error {
//if err := c.conn.Close(); err != nil {
// return fmt.Errorf("close connection: %w", err)
//}
c.conn.CloseIdleConnections()

return nil
}
Expand Down
64 changes: 35 additions & 29 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ package client

import (
"context"
"crypto/tls"
"crypto/x509"
"errors"
"fmt"
"net/http"
"os"
"strings"

"connectrpc.com/connect"
Expand Down Expand Up @@ -80,8 +83,7 @@ type Client struct {
client v1connect.YorkieServiceClient
options Options
clientOptions []connect.ClientOption
// dialOptions []grpc.DialOption
logger *zap.Logger
logger *zap.Logger

id *time.ActorID
key string
Expand Down Expand Up @@ -120,29 +122,22 @@ func New(opts ...Option) (*Client, error) {
k = xid.New().String()
}

conn := &http.Client{}
if options.CertFile != "" {
tlsConfig, err := newTLSConfigFromFile(options.CertFile, options.ServerNameOverride)
if err != nil {
return nil, fmt.Errorf("create client tls from file: %w", err)
}

conn.Transport = &http.Transport{TLSClientConfig: tlsConfig}
}

var clientOptions []connect.ClientOption

clientOptions = append(clientOptions, connect.WithInterceptors(NewAuthInterceptor(options.APIKey, options.Token)))

//var dialOptions []grpc.DialOption
//
//transportCreds := grpc.WithTransportCredentials(insecure.NewCredentials())
//if options.CertFile != "" {
// creds, err := credentials.NewClientTLSFromFile(options.CertFile, options.ServerNameOverride)
// if err != nil {
// return nil, fmt.Errorf("create client tls from file: %w", err)
// }
// transportCreds = grpc.WithTransportCredentials(creds)
//}
//dialOptions = append(dialOptions, transportCreds)
//
//authInterceptor := NewAuthInterceptor(options.APIKey, options.Token)
//dialOptions = append(dialOptions, grpc.WithUnaryInterceptor(authInterceptor.Unary()))
//dialOptions = append(dialOptions, grpc.WithStreamInterceptor(authInterceptor.Stream()))
//
//if options.MaxCallRecvMsgSize != 0 {
// dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(options.MaxCallRecvMsgSize)))
//}
if options.MaxCallRecvMsgSize != 0 {
clientOptions = append(clientOptions, connect.WithReadMaxBytes(options.MaxCallRecvMsgSize))
}

logger := options.Logger
if logger == nil {
Expand All @@ -154,10 +149,10 @@ func New(opts ...Option) (*Client, error) {
}

return &Client{
conn: conn,
clientOptions: clientOptions,
//dialOptions: dialOptions,
options: options,
logger: logger,
options: options,
logger: logger,

key: k,
status: deactivated,
Expand Down Expand Up @@ -185,7 +180,6 @@ func (c *Client) Dial(rpcAddr string) error {
rpcAddr = "http://" + rpcAddr
}

c.conn = http.DefaultClient
c.client = v1connect.NewYorkieServiceClient(c.conn, rpcAddr, c.clientOptions...)

return nil
Expand All @@ -197,9 +191,7 @@ func (c *Client) Close() error {
return err
}

//if err := c.conn.Close(); err != nil {
// return fmt.Errorf("close connection: %w", err)
//}
c.conn.CloseIdleConnections()

return nil
}
Expand Down Expand Up @@ -726,6 +718,20 @@ func (c *Client) broadcast(ctx context.Context, doc *document.Document, topic st
return nil
}

// NewClientTLSFromFile
func newTLSConfigFromFile(certFile, serverNameOverride string) (*tls.Config, error) {
b, err := os.ReadFile(certFile)

Check failure on line 723 in client/client.go

View workflow job for this annotation

GitHub Actions / build

G304: Potential file inclusion via variable (gosec)
if err != nil {
return nil, err

Check failure on line 725 in client/client.go

View workflow job for this annotation

GitHub Actions / build

error returned from external package is unwrapped: sig: func os.ReadFile(name string) ([]byte, error) (wrapcheck)
}
cp := x509.NewCertPool()
if !cp.AppendCertsFromPEM(b) {
return nil, fmt.Errorf("credentials: failed to append certificates")
}

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

Check failure on line 732 in client/client.go

View workflow job for this annotation

GitHub Actions / build

G402: TLS MinVersion too low. (gosec)
}

/**
* withShardKey returns a context with the given shard key in metadata.
*/
Expand Down
44 changes: 32 additions & 12 deletions server/rpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,16 @@ func (s *Server) listenAndServe() error {
newCORS().Handler(s.serverMux),
&http2.Server{},
)
if err := s.httpServer.ListenAndServe(); err != http.ErrServerClosed {
logging.DefaultLogger().Errorf("HTTP server ListenAndServe: %v", err)
if s.conf.CertFile != "" && s.conf.KeyFile != "" {
if err := s.httpServer.ListenAndServeTLS(s.conf.CertFile, s.conf.KeyFile); err != http.ErrServerClosed {
logging.DefaultLogger().Errorf("HTTP server ListenAndServeTLS: %v", err)
}
return
} else {

Check failure on line 126 in server/rpc/server.go

View workflow job for this annotation

GitHub Actions / build

indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive)
if err := s.httpServer.ListenAndServe(); err != http.ErrServerClosed {
logging.DefaultLogger().Errorf("HTTP server ListenAndServe: %v", err)
}
return
}
}()
return nil
Expand All @@ -128,20 +136,35 @@ func (s *Server) listenAndServe() error {
func newCORS() *cors.Cors {
return cors.New(cors.Options{
AllowedMethods: []string{
http.MethodHead,
http.MethodOptions,
http.MethodGet,
http.MethodPost,
http.MethodPut,
http.MethodPatch,
http.MethodDelete,
},
AllowOriginFunc: func(origin string) bool {
// Allow all origins, which effectively disables CORS.
return true
},
AllowedHeaders: []string{"*"},
AllowedHeaders: []string{
"Grpc-Timeout",
"Content-Type",
"Keep-Alive",
"User-Agent",
"Cache-Control",
"Content-Type",
"Content-Transfer-Encoding",
"Custom-Header-1",
"X-Accept-Content-Transfer-Encoding",
"X-Accept-Response-Streaming",
"X-User-Agent",
"X-Yorkie-User-Agent",
"X-Grpc-Web",
"Authorization",
"X-API-Key",
"X-Shard-Key",
},
MaxAge: int(1728 * time.Second),
ExposedHeaders: []string{
// Content-Type is in the default safelist.
"Accept",
"Accept-Encoding",
"Accept-Post",
Expand All @@ -155,11 +178,8 @@ func newCORS() *cors.Cors {
"Grpc-Status-Details-Bin",
"X-Custom-Header",
"Connect-Protocol-Version",
"Custom-Header-1",
},
// Let browsers cache CORS information for longer, which reduces the number
// of preflight requests. Any changes to ExposedHeaders won't take effect
// until the cached data expires. FF caps this value at 24h, and modern
// Chrome caps it at 2h.
MaxAge: int(2 * time.Hour / time.Second),
AllowCredentials: true,
})
}

1 comment on commit f0a8011

@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: f0a8011 Previous: 3ebef65 Ratio
BenchmarkDocument/constructor_test - ns/op 1340 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 785.5 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 8290 ns/op 8302 ns/op 1.00
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 16154 ns/op 16598 ns/op 0.97
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 21944 ns/op 22626 ns/op 0.97
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 8375 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 28357 ns/op 29401 ns/op 0.96
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 30689 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 28642 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 80333 ns/op 82820 ns/op 0.97
BenchmarkDocument/rich_text_test - B/op 38540 B/op 38540 B/op 1
BenchmarkDocument/rich_text_test - allocs/op 1147 allocs/op 1147 allocs/op 1
BenchmarkDocument/counter_test - ns/op 16647 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 2851942 ns/op 2970186 ns/op 0.96
BenchmarkDocument/text_edit_gc_100 - B/op 1655367 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 226800571 ns/op 231735416 ns/op 0.98
BenchmarkDocument/text_edit_gc_1000 - B/op 144365134 B/op 144366033 B/op 1.00
BenchmarkDocument/text_edit_gc_1000 - allocs/op 201006 allocs/op 201007 allocs/op 1.00
BenchmarkDocument/text_split_gc_100 - ns/op 3358445 ns/op 3385194 ns/op 0.99
BenchmarkDocument/text_split_gc_100 - B/op 2313496 B/op 2313331 B/op 1.00
BenchmarkDocument/text_split_gc_100 - allocs/op 16194 allocs/op 16194 allocs/op 1
BenchmarkDocument/text_split_gc_1000 - ns/op 285132202 ns/op 296761342 ns/op 0.96
BenchmarkDocument/text_split_gc_1000 - B/op 228883388 B/op 228881832 B/op 1.00
BenchmarkDocument/text_split_gc_1000 - allocs/op 203925 allocs/op 203904 allocs/op 1.00
BenchmarkDocument/text_delete_all_10000 - ns/op 10691761 ns/op 11146892 ns/op 0.96
BenchmarkDocument/text_delete_all_10000 - B/op 5810141 B/op 5810543 B/op 1.00
BenchmarkDocument/text_delete_all_10000 - allocs/op 40673 allocs/op 40675 allocs/op 1.00
BenchmarkDocument/text_delete_all_100000 - ns/op 178213376 ns/op 187188955 ns/op 0.95
BenchmarkDocument/text_delete_all_100000 - B/op 81907008 B/op 81887592 B/op 1.00
BenchmarkDocument/text_delete_all_100000 - allocs/op 411663 allocs/op 411550 allocs/op 1.00
BenchmarkDocument/text_100 - ns/op 218336 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 2375999 ns/op 2502773 ns/op 0.95
BenchmarkDocument/text_1000 - B/op 1153068 B/op 1153073 B/op 1.00
BenchmarkDocument/text_1000 - allocs/op 50084 allocs/op 50084 allocs/op 1
BenchmarkDocument/array_1000 - ns/op 1171233 ns/op 1267389 ns/op 0.92
BenchmarkDocument/array_1000 - B/op 1091172 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 12882172 ns/op 13549731 ns/op 0.95
BenchmarkDocument/array_10000 - B/op 9798659 B/op 9800047 B/op 1.00
BenchmarkDocument/array_10000 - allocs/op 120285 allocs/op 120291 allocs/op 1.00
BenchmarkDocument/array_gc_100 - ns/op 141985 ns/op 153664 ns/op 0.92
BenchmarkDocument/array_gc_100 - B/op 132492 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 1359799 ns/op 1451255 ns/op 0.94
BenchmarkDocument/array_gc_1000 - B/op 1158915 B/op 1158965 B/op 1.00
BenchmarkDocument/array_gc_1000 - allocs/op 12864 allocs/op 12865 allocs/op 1.00
BenchmarkDocument/counter_1000 - ns/op 202637 ns/op 215664 ns/op 0.94
BenchmarkDocument/counter_1000 - B/op 192854 B/op 192852 B/op 1.00
BenchmarkDocument/counter_1000 - allocs/op 5765 allocs/op 5765 allocs/op 1
BenchmarkDocument/counter_10000 - ns/op 2140828 ns/op 2222359 ns/op 0.96
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 1312568 ns/op 1433455 ns/op 0.92
BenchmarkDocument/object_1000 - B/op 1427864 B/op 1427946 B/op 1.00
BenchmarkDocument/object_1000 - allocs/op 9845 allocs/op 9845 allocs/op 1
BenchmarkDocument/object_10000 - ns/op 14571327 ns/op 14878581 ns/op 0.98
BenchmarkDocument/object_10000 - B/op 12168302 B/op 12167003 B/op 1.00
BenchmarkDocument/object_10000 - allocs/op 100567 allocs/op 100561 allocs/op 1.00
BenchmarkDocument/tree_100 - ns/op 1033156 ns/op 722947 ns/op 1.43
BenchmarkDocument/tree_100 - B/op 943676 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 75027619 ns/op 48715965 ns/op 1.54
BenchmarkDocument/tree_1000 - B/op 86460440 B/op 35222566 B/op 2.45
BenchmarkDocument/tree_1000 - allocs/op 60114 allocs/op 44119 allocs/op 1.36
BenchmarkDocument/tree_10000 - ns/op 9217848706 ns/op 6243742972 ns/op 1.48
BenchmarkDocument/tree_10000 - B/op 8580983064 B/op 3439193776 B/op 2.50
BenchmarkDocument/tree_10000 - allocs/op 600233 allocs/op 440204 allocs/op 1.36
BenchmarkDocument/tree_delete_all_1000 - ns/op 73305167 ns/op 50492483 ns/op 1.45
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 3624733 ns/op 2674319 ns/op 1.36
BenchmarkDocument/tree_edit_gc_100 - B/op 4120904 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 301608607 ns/op 200656697 ns/op 1.50
BenchmarkDocument/tree_edit_gc_1000 - B/op 383465866 B/op 180293307 B/op 2.13
BenchmarkDocument/tree_edit_gc_1000 - allocs/op 145405 allocs/op 113350 allocs/op 1.28
BenchmarkDocument/tree_split_gc_100 - ns/op 2439751 ns/op 1969140 ns/op 1.24
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 178011525 ns/op 133034523 ns/op 1.34
BenchmarkDocument/tree_split_gc_1000 - B/op 221991052 B/op 120284053 B/op 1.85
BenchmarkDocument/tree_split_gc_1000 - allocs/op 112250 allocs/op 96193 allocs/op 1.17
BenchmarkRPC/client_to_server - ns/op 354425552 ns/op 356375965 ns/op 0.99
BenchmarkRPC/client_to_server - B/op 18062581 B/op 16323573 B/op 1.11
BenchmarkRPC/client_to_server - allocs/op 166993 allocs/op 165420 allocs/op 1.01
BenchmarkRPC/client_to_client_via_server - ns/op 598821970 ns/op 607723810 ns/op 0.99
BenchmarkRPC/client_to_client_via_server - B/op 33269360 B/op 34041892 B/op 0.98
BenchmarkRPC/client_to_client_via_server - allocs/op 312667 allocs/op 309871 allocs/op 1.01
BenchmarkRPC/attach_large_document - ns/op 1231254106 ns/op 1463602622 ns/op 0.84
BenchmarkRPC/attach_large_document - B/op 1890027288 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 531041281 ns/op 541741676 ns/op 0.98
BenchmarkRPC/adminCli_to_server - B/op 35806276 B/op 36380716 B/op 0.98
BenchmarkRPC/adminCli_to_server - allocs/op 288170 allocs/op 284616 allocs/op 1.01
BenchmarkLocker - ns/op 74.64 ns/op 65.29 ns/op 1.14
BenchmarkLocker - B/op 16 B/op 16 B/op 1
BenchmarkLocker - allocs/op 1 allocs/op 1 allocs/op 1
BenchmarkLockerParallel - ns/op 39.17 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.1 ns/op 138.5 ns/op 1.13
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 3760451 ns/op 3779429 ns/op 0.99
BenchmarkChange/Push_10_Changes - B/op 126346 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 13922790 ns/op 14129092 ns/op 0.99
BenchmarkChange/Push_100_Changes - B/op 648933 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 111148034 ns/op 113213707 ns/op 0.98
BenchmarkChange/Push_1000_Changes - B/op 6200623 B/op 6011043 B/op 1.03
BenchmarkChange/Push_1000_Changes - allocs/op 62159 allocs/op 62155 allocs/op 1.00
BenchmarkChange/Pull_10_Changes - ns/op 2840149 ns/op 2837624 ns/op 1.00
BenchmarkChange/Pull_10_Changes - B/op 100932 B/op 100327 B/op 1.01
BenchmarkChange/Pull_10_Changes - allocs/op 951 allocs/op 951 allocs/op 1
BenchmarkChange/Pull_100_Changes - ns/op 4315540 ns/op 4303014 ns/op 1.00
BenchmarkChange/Pull_100_Changes - B/op 258577 B/op 257269 B/op 1.01
BenchmarkChange/Pull_100_Changes - allocs/op 3154 allocs/op 3154 allocs/op 1
BenchmarkChange/Pull_1000_Changes - ns/op 8225647 ns/op 8473189 ns/op 0.97
BenchmarkChange/Pull_1000_Changes - B/op 1397699 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 16593994 ns/op 16717315 ns/op 0.99
BenchmarkSnapshot/Push_3KB_snapshot - B/op 811426 B/op 807884 B/op 1.00
BenchmarkSnapshot/Push_3KB_snapshot - allocs/op 6542 allocs/op 6541 allocs/op 1.00
BenchmarkSnapshot/Push_30KB_snapshot - ns/op 115906088 ns/op 117501595 ns/op 0.99
BenchmarkSnapshot/Push_30KB_snapshot - B/op 6269148 B/op 6250940 B/op 1.00
BenchmarkSnapshot/Push_30KB_snapshot - allocs/op 62163 allocs/op 62161 allocs/op 1.00
BenchmarkSnapshot/Pull_3KB_snapshot - ns/op 6633180 ns/op 6521588 ns/op 1.02
BenchmarkSnapshot/Pull_3KB_snapshot - B/op 906564 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 14818464 ns/op 15228711 ns/op 0.97
BenchmarkSnapshot/Pull_30KB_snapshot - B/op 6984437 B/op 6983077 B/op 1.00
BenchmarkSnapshot/Pull_30KB_snapshot - allocs/op 144138 allocs/op 144141 allocs/op 1.00
BenchmarkSync/memory_sync_10_test - ns/op 7094 ns/op 6917 ns/op 1.03
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 50975 ns/op 51493 ns/op 0.99
BenchmarkSync/memory_sync_100_test - B/op 8651 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 589892 ns/op 598451 ns/op 0.99
BenchmarkSync/memory_sync_1000_test - B/op 74491 B/op 74330 B/op 1.00
BenchmarkSync/memory_sync_1000_test - allocs/op 2117 allocs/op 2108 allocs/op 1.00
BenchmarkSync/memory_sync_10000_test - ns/op 7078757 ns/op 7141413 ns/op 0.99
BenchmarkSync/memory_sync_10000_test - B/op 766102 B/op 761330 B/op 1.01
BenchmarkSync/memory_sync_10000_test - allocs/op 20590 allocs/op 20560 allocs/op 1.00
BenchmarkTextEditing - ns/op 18465709331 ns/op 19117165431 ns/op 0.97
BenchmarkTextEditing - B/op 9037951040 B/op 9037584392 B/op 1.00
BenchmarkTextEditing - allocs/op 19923318 allocs/op 19921383 allocs/op 1.00

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

Please sign in to comment.