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: Initial DataCubeComponents / dimension values query optimizations #1360

Merged
merged 19 commits into from
Feb 27, 2024

Conversation

bprusinowski
Copy link
Collaborator

@bprusinowski bprusinowski commented Feb 22, 2024

Closes #1372.

This PR is a first step towards optimizing the performance situation related to DataCubeComponents query.

  • Disabled loading of dimension values where applicable
  • Adjusted several places in the code to not send unnecessary filters to the server to make sure we use sh:in as much as possible
  • Fixed an issue with not using optional chaining to access last dimension value
  • Refactored the approach to fetching available filter values from one combined DataCubesComponents call with filters for every dimension to individual calls directly from filter components. This enables us to more precisely pass filters and rely more on sh:in, as for the first filter we won't send filters object anymore
  • Fixed an issue with fetching dimension values which resulted in fetching values that couldn't be selected (combinations resulting in no observations, fixed after selection by possible filters query)

Next steps

  • Consolidate DataCubeComponents-related queries into CONSTRUCT query/ies
  • Consider using mobx to improve manageability of data fetching across the app
  • Consider decoupling dimension values fetching from components to make it more clear where we actually need to fetch values (currently it's not ideal, as we might or might not have values fetched)

How to test

PR

  1. Go to this link.
  2. ✅ See that the filters are loaded in the background (some might fail to load due to Vercel's 15s timeout).
  3. ✅ See that the last filter (4. Zusatzmengencode - EN) contains five values.

TEST

  1. Go to this link.
  2. ❌ See that the initial view loads much slower compared to the PR link.
  3. ❌ See that the last filter (4. Zusatzmengencode - EN) contains seven values.
  4. Try to change value of above filter to Metres.
  5. ❌ See that the chart reloads back to No supplementary unit.

Copy link

vercel bot commented Feb 22, 2024

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

Name Status Preview Comments Updated (UTC)
visualization-tool ✅ Ready (Inspect) Visit Preview 1 resolved Feb 27, 2024 0:35am

@bprusinowski bprusinowski changed the title perf: DataCubeComponents query optimizations perf: Initial DataCubeComponents / dimension values query optimizations Feb 23, 2024
@bprusinowski bprusinowski marked this pull request as ready for review February 23, 2024 13:00
@bprusinowski bprusinowski merged commit 8d3f2be into main Feb 27, 2024
6 checks passed
@bprusinowski bprusinowski deleted the perf/optimize-data-cube-components-query branch February 27, 2024 13:30
@Rdataflow
Copy link
Contributor

@bprusinowski now that you pass loadValues this is the condition when to ask for hierarchies

const hierarchy = true // TODO: make this configurable
? await queryHierarchy(

only if loadValues is true

impact: gain speed by skipping unecessary hierachy queries alltogether

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.

Load single value per filter when entering the edit mode first and load unique values afterwards
3 participants