nebula icon indicating copy to clipboard operation
nebula copied to clipboard

Make hostinfo remote atomic, for consistent data access synchronization.

Open brad-defined opened this issue 3 years ago • 2 comments

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.

brad-defined avatar Sep 15 '22 16:09 brad-defined

oh, right. Gotta upgrade to go 1.19 first. :/

brad-defined avatar Sep 15 '22 16:09 brad-defined

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)

nbrownus avatar Nov 16 '22 02:11 nbrownus

lots of code reworked here, will drop the PR.

brad-defined avatar Apr 01 '24 17:04 brad-defined