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: Only load hierarchies where necessary #1016

Merged
merged 2 commits into from
Apr 5, 2023
Merged

Conversation

bprusinowski
Copy link
Collaborator

@bprusinowski bprusinowski commented Apr 5, 2023

Contributes to fixing #1002.

Previously, we loaded hierarchies every time we depended on dimensionMetadata fragment. However, I believe it's not necessary to load hierarchies everywhere, as for example, they don't seem to be used in places that use DataCubeObservations query. When we don't fetch them there, the loading times of the chart inside the editor & published mode can be improved for datasets that use hierarchies (in the example in #1002, the published chart loads in 1.5s instead of ~10s).

This PR excludes loading of hierarchies across multiple queries if they are not required further down in the app.

How to test

  1. Go to this published chart from this PR's deployment preview
  2. Go to the same chart but made using test.visualize.admin.ch and see the time difference in data loading.

@bprusinowski bprusinowski requested a review from ptbrowne as a code owner April 5, 2023 13:00
@vercel
Copy link

vercel bot commented Apr 5, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
visualization-tool ✅ Ready (Inspect) Visit Preview Apr 5, 2023 1:00pm

Copy link
Collaborator

@ptbrowne ptbrowne left a comment

Choose a reason for hiding this comment

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

LGTM !

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.

None yet

2 participants