You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "watermelo (GitHub)" <gi...@apache.org> on 2020/02/26 10:02:57 UTC
[GitHub] [dubbo-go-hessian2] watermelo commented on issue #96:
Improvement: use sync.Map instead of sync.RWMutex in POJORegistry
benchmark as follows:
go version go1.12.6
master branch
```
dubbo-go-hessian2 (master) $ go test -bench=. -benchmem -run=none
goos: darwin
goarch: amd64
pkg: github.com/apache/dubbo-go-hessian2
BenchmarkTestRegisterPOJO-4 50000 33158 ns/op 10101 B/op 153 allocs/op
BenchmarkTestEncodeTuple-4 200000 11827 ns/op 2861 B/op 93 allocs/op
BenchmarkTestEncodeDecodeTuple-4 50000 31168 ns/op 8881 B/op 311 allocs/op
BenchmarkEncodeBasePointer-4 1000000 1019 ns/op 608 B/op 7 allocs/op
BenchmarkEncodeDecodeBasePointer-4 500000 4846 ns/op 5320 B/op 28 allocs/op
PASS
ok github.com/apache/dubbo-go-hessian2 11.994s
```
insteaded branch
```
dubbo-go-hessian2 (96_sync_map_instead_opt) $ go test -bench=. -benchmem -run=none
goos: darwin
goarch: amd64
pkg: github.com/apache/dubbo-go-hessian2
BenchmarkTestRegisterPOJO-4 50000 47289 ns/op 13143 B/op 267 allocs/op
BenchmarkTestEncodeTuple-4 200000 11227 ns/op 3021 B/op 99 allocs/op
BenchmarkTestEncodeDecodeTuple-4 50000 38296 ns/op 9041 B/op 317 allocs/op
BenchmarkEncodeBasePointer-4 1000000 1516 ns/op 608 B/op 7 allocs/op
BenchmarkEncodeDecodeBasePointer-4 200000 9052 ns/op 5320 B/op 28 allocs/op
PASS
ok github.com/apache/dubbo-go-hessian2 13.319s
```
[ Full content available at: https://github.com/apache/dubbo-go-hessian2/issues/96 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org