Skip to content
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: perform the getPrimary lookup only once during the bulk path #152

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jasonk000
Copy link
Member

@jasonk000 jasonk000 commented Nov 18, 2024

We can avoid doing the (potentially) expensive getPrimary call on the bulk get path with a little refactor. This retains the same functionality but pushes the validation logic and error emit into a callback, which allows metrics to work as-is.

To do this we introduce a predicate callback that getBulk lower layer can use to validate. In this predicate - which the upper layer provides - we have the appropriate logging and metrics context to make the decision.

In this particular application, the duplicated getPrimary calls are taking the vast majority of the time (I'll have a separate PR for this).

image

…ing path

We can avoid doing the (potentially) expensive getPrimary call on the bulk get path with
a little refactor. This retains the same functionality but pushes the validation logic
and error emit into a callback, which allows metrics to work as-is.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant