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

Improve performance of fields list rendering and application as a whole #42

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

kyle-sammons
Copy link
Collaborator

Summary

This PR greatly improves the performance of our fields list rendering and the application as a whole. The optimizations applied were:

  • Adding minification and tree shaking (these may have already been present for production builds, I was a bit unclear reading the docs)
  • Adding gzip compression to Grafana network requests (this will need to be enabled as well in production environments, but I enabled it here in the Docker container and saw dramatic gains)
  • Virtualized the field list
  • Swapped the field value calculation, and the whole component, to be lazy which should also heavily cut down on the amount of work done

There's still more work to do here to get things as optimized as we can, but we're currently at a place where the three biggest causes for performance issues are:

  • The current log table implementation. We don't have much control here as it's owned by Grafana, but we're planning on doing a rewrite here soon.
  • The network request to KalDB. Sometimes this is fast, sometimes this is slow, but the UI is stuck in a holding pattern until it returns.
  • Grafana itself. By far the largest source of the browser having to request and load JS that never gets used is from Grafana as it seems their current code splitting and/or tree shaking process could use some work. This results in ~1 second extra load time for us according to Lighthouse.

Results

Below are screenshots from Lighthouse before/after this PR was applied. In both cases I tried to refresh once or twice before running the test to ensure that the network request was as fast as it reasonably could be.

Before:
Before optimizations

After:
After optimizations

Resolves #37

Requirements (place an x in each [ ])

The following point can be removed after setting up CI (such as Travis) with coverage reports (such as Codecov)

  • I've written tests to cover the new code and functionality included in this PR.

The following point can be removed after setting up a CLA reporting tool such as cla-assistant.io

@kyle-sammons kyle-sammons requested a review from bryanlb December 1, 2023 18:57
@kyle-sammons kyle-sammons merged commit 1b1b847 into master Dec 1, 2023
2 checks passed
@kyle-sammons kyle-sammons deleted the ksammons-improve-fields-list-performance branch December 1, 2023 19:05
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.

Improve performance of fields list
2 participants