-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf(client): optimize with atomic.Int64 for lastSubscribeAt in pkg/varlog.(subscriber) #720
Conversation
00ab217
to
4f7103f
Compare
a66b30e
to
e1ef1ad
Compare
4f7103f
to
cc39617
Compare
e1ef1ad
to
416e9f9
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #720 +/- ##
==========================================
+ Coverage 49.67% 49.75% +0.08%
==========================================
Files 235 235
Lines 20717 20718 +1
==========================================
+ Hits 10291 10309 +18
+ Misses 9783 9773 -10
+ Partials 643 636 -7 ☔ View full report in Codecov by Sentry. |
cc39617
to
f59cbe0
Compare
416e9f9
to
e74d9c6
Compare
f59cbe0
to
4baaff2
Compare
e74d9c6
to
43444d0
Compare
4baaff2
to
cd283ae
Compare
43444d0
to
c43198f
Compare
cd283ae
to
0c1d77a
Compare
c43198f
to
a4f18ee
Compare
0c1d77a
to
578b928
Compare
a4f18ee
to
48a2b26
Compare
578b928
to
1b8f5a0
Compare
48a2b26
to
a58015b
Compare
1b8f5a0
to
890508d
Compare
…arlog.(subscriber) Switches the type of `pkg/varlog.(subscriber).lastSubscribeAt` from `atomic.Value` to `atomic.Int64` to eliminate heap escapes. The frequent updates with new `time.Time` values to `lastSubscribeAt` previously led to significant heap allocation due to heap escape. By adopting `atomic.Int64`, we can prevent heap escape, thereby reducing heap allocations and enhancing performance.
a58015b
to
617bd9d
Compare
What this PR does
Switches the type of
pkg/varlog.(subscriber).lastSubscribeAt
fromatomic.Value
toatomic.Int64
to eliminate heap escapes. The frequent updateswith new
time.Time
values tolastSubscribeAt
previously led to significantheap allocation due to heap escape. By adopting
atomic.Int64
, we can preventheap escape, thereby reducing heap allocations and enhancing performance.