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

Rendering performance improvements #208

Merged
merged 15 commits into from
Oct 15, 2020

Conversation

abought
Copy link
Member

@abought abought commented Sep 4, 2020

Purpose

LocusZoom becomes very slow when loading dense regions (with a lot of variants). Some users would like to increase max_region_size and/or render modern datasets that may be imputed to better panels.

This ticket contains some initial low-hanging performance improvements:

  • Use fewer system resources/ listeners/ function calls to render each scatter plot point (cache computed values, event bubbling, etc)
  • Provide an option to coalesce adjacent points in the scatter plot. This can save reduce the number of points to render by 40-50% for a narrow region or noisy plot, and >90% for a GWAS with a few strong hits in a wide viewing region.

Summary of changes

  • The new scatter plot directives coalesce._ control whether to group together nearby points, and if so, what parameters to use. By default it groups together adjacent points within ~1 circle-diameter distance of each other in x and y.
    • Coalescing is turned on by default for association plots (only). You may wish to adjust this behavior and options if you use a different y-axis range for your plots (eg, user-selectable "toggle y-axis display" behaviors)
  • Remove shift-click "multiselect" from plots: few people seem to use this feature

Bugfixes:

  • Correctly remove old scatter plot labels on toggle/re-render
  • Fix double-escaping issue with label display values

TODO

  • Cache the most frequently re-computed values
  • Explore refactoring event listeners to use bubbling- do we really need 1000 events for 1000 scatter plot points?
  • Deduplicate style declarations when rendering
  • Explore coalescing nearby points

Few people use this functionality, and it adds weight and extra code to the DOM.

In the future we may want to repurpose shiftclick behavior for some other purpose,
 like labeling points on a scatter plot. For now disable the current usage.
…se regions

(there are so many loops that trying to assign rigorously separate category colors just created visual noise)
@abought abought force-pushed the feature/rendering-pipeline branch from fc53e54 to 292a8cc Compare September 15, 2020 18:15
@abought abought added this to the v0.13.0 milestone Sep 15, 2020
@abought abought force-pushed the feature/rendering-pipeline branch from cc2f228 to 6a90b58 Compare October 14, 2020 19:10
@abought abought changed the title [WIP][refactor] Streamline rendering pipeline Rendering performance improvements Oct 14, 2020
@abought abought marked this pull request as ready for review October 14, 2020 20:31
@abought abought merged commit 59551e0 into statgen:develop Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant