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: Fix slow selectAll and deselectAll highcharts controller methods #4927

Merged

Conversation

coalest
Copy link
Collaborator

@coalest coalest commented Jan 17, 2025

Doesn't resolve any issue.

Description

While looking into places we use caching (for the solid_cache task), I noticed the 'Select All' and 'Deselect All' buttons in the historical trends pages were really slow.

Reason for slowness:
From this flame graph, you can see that a redraw method was being called over and over again.

image

Apparently the show and hide methods were redrawing the chart after every item (series) had it's visibility changed.

This PR changes it so that the visibility is set for all items and then the chart is redrawn only once.

Type of change

  • Performance (behavior unaffected)

How Has This Been Tested?

Manually. I couldn't find any system specs for these pages.

Screenshots

I also moved added a little padding to buttons.

Before
image

After
Screenshot from 2025-01-17 13-13-14

Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! @cielf probably should do a quick sanity check.

@dorner dorner requested a review from cielf January 17, 2025 20:08
@cielf
Copy link
Collaborator

cielf commented Jan 17, 2025

Will do. Probably tomorrow.

@cielf
Copy link
Collaborator

cielf commented Jan 18, 2025

Ok. Yup. That's an improvement, alright.

@cielf cielf merged commit dae06db into rubyforgood:main Jan 18, 2025
11 checks passed
Copy link
Contributor

@coalest: Your PR Perf: Fix slow selectAll and deselectAll highcharts controller methods is part of today's Human Essentials production release: 2025.01.19.
Thank you very much for your contribution!

@coalest coalest deleted the improve-(de)select-all-highcharts-button-perf branch January 26, 2025 14:01
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.

3 participants