thanos icon indicating copy to clipboard operation
thanos copied to clipboard

querier: improve chunkseries iterator

Open MichaHoffmann opened this issue 3 weeks ago • 0 comments

Accessing the current chunk via the slice is expensive and we should generally prefer to call methods on the memoized "cur" here. Moved the AtT at the bottom - an exhausted iterator should generally still be at its last value there so this should be sound - this removes a lot of AtT function call overhead. Did same with the Err() call as thats generally only interesting if we are not the last chunk and was surprisingly hot in profiles.

  • [ ] I added CHANGELOG entry for this change.
  • [x] Change is not relevant to the end user.

Changes

Verification

MichaHoffmann avatar Nov 30 '25 11:11 MichaHoffmann