nebula
nebula copied to clipboard
Make hostinfo remote atomic, for consistent data access synchronization.
When working on 746 I noticed that there was inconsistent lock access to HostInfo.remote pointer.
Inspired by 728 this PR makes HostInfo.remote an atomicPointer.
oh, right. Gotta upgrade to go 1.19 first. :/
Ran the test using go test -tags=e2e_testing -count=1 -bench=. -benchmem -run='^$' ./e2e, count=1 because the e2e test decreases in performance after each run, so this isn't super scientific.
name old time/op new time/op delta
HotPath-10 28.6µs ± 0% 30.7µs ± 0% ~ (p=1.000 n=1+1)
name old alloc/op new alloc/op delta
HotPath-10 1.42kB ± 0% 1.42kB ± 0% ~ (p=1.000 n=1+1)
name old allocs/op new allocs/op delta
HotPath-10 40.0 ± 0% 40.0 ± 0% ~ (all equal)
lots of code reworked here, will drop the PR.