-
Notifications
You must be signed in to change notification settings - Fork 11.7k
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
Field: Fix perf regression in getUniqueFieldName() #81323
Conversation
@@ -167,7 +165,7 @@ export function getUniqueFieldName(field: Field, frame?: DataFrame) { | |||
for (let i = 0; i < frame.fields.length; i++) { | |||
const otherField = frame.fields[i]; | |||
|
|||
if (isEqual(field, otherField)) { |
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.
root cause of slowdown
const fields = data.fields.map((f, idx) => { | ||
return { ...f, hovered: idx === columnIndex }; | ||
}); |
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.
this field copy is why ===
was failing inside getUniqueFieldName()
, and resulting in the 1
suffix, which is the original issue #75511 was attempting to fix.
this should fix #80039 also? |
If the isEqual approach is in 10.3, then yes, this should be backported |
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.
I think with a bit of clean up this is G2G 💨
Co-authored-by: nmarrs <nathanielmarrs@gmail.com> (cherry picked from commit 0530021)
Co-authored-by: nmarrs <nathanielmarrs@gmail.com> (cherry picked from commit 0530021)
* Field: Fix perf regression in getUniqueFieldName() (#81323) Co-authored-by: nmarrs <nathanielmarrs@gmail.com> (cherry picked from commit 0530021) * Chore: Fix some Explore deprecations (#80076) * lint --------- Co-authored-by: Leon Sorokin <leeoniya@gmail.com> Co-authored-by: Giordano Ricci <me@giordanoricci.com>
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
Addresses https://github.com/grafana/support-escalations/issues/9134
this fixes a large perf regression in
getFieldDisplayName()
introduced in #75511@ryantxu should we backport this?
NOTE: easiest to review each commit separately. the first one is the fix, the second one is an additional optimization for huge-field-count frames.