-
-
Notifications
You must be signed in to change notification settings - Fork 335
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
Improve perf in discovery jobs metrics to data lookup #1092
Improve perf in discovery jobs metrics to data lookup #1092
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor suggestions. A nit on naming I would consider renaming dataIndex
-> metricIDToData
Pasting results for the new bench parameters. Seeing the same improvement for all cases.
|
Co-authored-by: kgeckhart <kgeckhart@users.noreply.github.com>
Posting results after rebasing, since there were optimizations in the last commit, over the same code.
|
ff6c708
to
f554520
Compare
Co-authored-by: Cristian Greco <cristian@regolo.cc>
// skip elements that have been already mapped but still exist in metricIDToData | ||
if metricData.MetricID == nil { | ||
continue | ||
} | ||
// Copy to avoid a loop closure bug | ||
dataPoint := metricDataResult.Datapoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cristiangreco this is the pointer reference bug right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
This PR addessed some performance issues we've been seeing with running YACE discovery with large enough jobs. We noticed there was a lot of cpu % usage around
findGetMetricDataByID
. This lead us to believe this is a hot path, and as well, performs lots of side-allocations.This PR re-implements that logic with a map to lookup the corresponding metric data, rather than looping over. Also, a benchmark is added for further development.
The benchstat below shows an improvement of around ~90% in both cpu and memory.
benchstat
main
pr