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

478 improve performance of mutation over time #483

Merged
merged 5 commits into from
Nov 6, 2024

Conversation

JonasKellerer
Copy link
Collaborator

resolves #478

Summary

The main change is this PR, is the introduction of web workers for the calculation of the mutations over time. This allows for parallel computation, which is not available otherwise in js.

You can not pass classes with functions to (and from) the web worker. Therefore, I introduced an interface for the temporal and mutation class, which only contains the data of the respective class. The same issue occurred for the Map2d class, which now can export/import the underlying data.

Testing of a component using the web worker is done through a mock. The mock is enabled using special import directives. This was necessary, since the current mocking approach only allows to mock calls on the same thread.

In this PR also includes

  • a fix, where the initial mutation call (which calculates all mutations in the time window) did not include the same dates as the single mutation calls for each time window.
  • a performance improvement in the filtering step of the mutations. Now the filtering is done only on the overall mutations, and the map is then updated.
  • a minor fix, where the tag of mutation over time component is not correctly exported

The playwright snapshot tests needed to be updated. The values changed, due to the fix of the overall mutation call and because we call a pango lineage with asterix (JN.1*). Since our last snapshot of the data, there were some other lineages assigned as children of that lineage, which changes the proportion.

Screenshot

PR Checklist

  • All necessary documentation has been adapted.
  • The implemented feature is covered by an appropriate test.

Copy link

vercel bot commented Nov 4, 2024

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

Name Status Preview Comments Updated (UTC)
dashboard-components ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 8:07am

Copy link
Contributor

github-actions bot commented Nov 4, 2024

This is a preview of the changelog of the next release. If this branch is not up-to-date with the current main branch, the changelog may not be accurate. Rebase your branch on the main branch to get the most accurate changelog.

Note that this might contain changes that are on main, but not yet released.

Changelog:

0.6.19 (2024-11-06)

Bug Fixes

  • components: correctly export tag of mutations over time (4a2be94)
  • components: mutation over time initial query with missing dates (d68419b)

Performance Improvements

  • components: improve performance of mutations over time filters (ffc2629)
  • components: use web worker for mutations over time calculation (8f2fbb6)

Copy link
Collaborator

@fengelniederhammer fengelniederhammer 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! Just a couple of minor things.

components/README.md Outdated Show resolved Hide resolved
components/src/utils/map2d.ts Outdated Show resolved Hide resolved
components/src/utils/map2d.ts Outdated Show resolved Hide resolved
components/src/utils/mutations.ts Outdated Show resolved Hide resolved
components/src/utils/mutations.ts Outdated Show resolved Hide resolved
examples/React/src/App.tsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@fengelniederhammer fengelniederhammer left a comment

Choose a reason for hiding this comment

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

LGTM

@JonasKellerer JonasKellerer force-pushed the 478-improve-performance-of-mutation-over-time branch from b0b21c7 to 9b1f34d Compare November 6, 2024 08:06
@JonasKellerer JonasKellerer merged commit 6680854 into main Nov 6, 2024
7 checks passed
@JonasKellerer JonasKellerer deleted the 478-improve-performance-of-mutation-over-time branch November 6, 2024 08:12
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 mutation over time
2 participants