Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

SeriesLong: remove unneeded mutex #2007

Closed
wants to merge 1 commit into from

Conversation

shanson7
Copy link
Collaborator

@shanson7 shanson7 commented Sep 24, 2021

AFAICT all uses of series are already protected or single threaded. There isn't a need to keep a lock at this low level. This will save 24 bytes per instance of SeriesLong (of which there are many for large clusters). Removing the mutex also removes the unneeded cost of synchronization (about 18% improvement).

name               old time/op    new time/op    delta
PushSeriesLong-12    60.9ns ± 2%    49.9ns ± 1%  -18.13%  (p=0.000 n=18+17)

Note: Chunk is already marked as not concurrency safe. Also, there are already accesses to Series.T which would be unsafe (if AggMetric didn't already have a lock).

@Dieterbe
Copy link
Contributor

Dieterbe commented Oct 6, 2021

Let's continue this in #2008

@Dieterbe Dieterbe closed this Oct 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants