perf(RHINENG-24466): add batch-scoped caches for MQ ingestion#3844
Draft
rodrigonull wants to merge 1 commit intomasterfrom
Draft
perf(RHINENG-24466): add batch-scoped caches for MQ ingestion#3844rodrigonull wants to merge 1 commit intomasterfrom
rodrigonull wants to merge 1 commit intomasterfrom
Conversation
Contributor
SC Environment Impact AssessmentOverall Impact: ⚪ NONE No SC Environment-specific impacts detected in this PR. What was checkedThis PR was automatically scanned for:
|
ef58793 to
01794c1
Compare
Introduce ThreadLocalBatchCache base class and two batch-scoped caches to reduce redundant DB queries during MQ message processing: - StalenessCache: eliminates ~3 identical Staleness SELECTs per host - UngroupedGroupCache: eliminates 1 Group SELECT per message Both caches are activated via context managers in _process_batch and automatically cleared at batch boundaries. Values are plain dicts (AttrDict), not ORM objects, to avoid memory accumulation.
01794c1 to
d81c311
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR is being created to address RHINENG-24466.
Introduce ThreadLocalBatchCache base class and two batch-scoped caches to reduce redundant DB queries during MQ message processing:
Both caches are activated via context managers in _process_batch and automatically cleared at batch boundaries. Values are plain dicts (AttrDict), not ORM objects, to avoid memory accumulation.
PR Checklist
Secure Coding Practices Documentation Reference
You can find documentation on this checklist here.
Secure Coding Checklist
Summary by Sourcery
Introduce thread-local, batch-scoped caches for MQ ingestion to avoid redundant staleness and ungrouped-group database lookups within a processing batch.
New Features:
Enhancements:
Tests: