dferstay commented on a change in pull request #684:
URL: https://github.com/apache/pulsar-client-go/pull/684#discussion_r776849103
##########
File path: pulsar/default_router.go
##########
@@ -30,6 +31,7 @@ type defaultRouter struct {
lastChangeTimestamp int64
msgCounter uint32
cumulativeBatchSize uint32
+ sync.RWMutex
Review comment:
Update: the implementation in #694 was modified slightly and now
`DefaultRouterParallel-2` is no longer slower in the lock-free implementation.
New bench comparison is below:
```
name old time/op new time/op delta
DefaultRouterParallel 27.4ns ± 3% 14.9ns ± 6% -45.51% (p=0.000 n=10+9)
DefaultRouterParallel-2 35.2ns ± 1% 33.7ns ± 8% ~ (p=0.161 n=9+9)
DefaultRouterParallel-4 49.4ns ± 6% 28.8ns ± 4% -41.66% (p=0.000 n=10+9)
DefaultRouterParallel-8 58.8ns ± 6% 36.3ns ± 1% -38.32% (p=0.000 n=10+8)
DefaultRouterParallel-16 69.7ns ± 3% 39.5ns ±21% -43.38% (p=0.000
n=10+10)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]