mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-05-17 00:26:36 +03:00
Call decConcurrency() inside Reader.Read() before calling the Read() at the underlying reader. This reduces chances of improper use of the writeconcurrencylimiter.Reader by callers. While at it, move the creation of writeconcurrencylimiter.GetReader() to the top of stream parser functions at lib/protoparser/* packages, and call incConcurrency() inside GetReader() call. This reduces the frequency of decConcurrency() / incConcurrency() calls for typical buffered reads when parsing the incoming data. This, in turn, reduces the contention on the concurrencyLimitCh.