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

Color-by changes result in duplicate (expensive) function calls #1035

Closed
cpsandbox opened this issue Apr 1, 2020 · 2 comments · Fixed by #1075
Closed

Color-by changes result in duplicate (expensive) function calls #1035

cpsandbox opened this issue Apr 1, 2020 · 2 comments · Fixed by #1075

Comments

@cpsandbox
Copy link
Contributor

Current Behavior
When choosing a different color by method (clade, administrative area, etc.) change.js in components/tree is called twice.

Expected behavior
This should only get called once.

How to reproduce
As a developer add logging statement in change.js indicating the properties to be updated.
Use the UI to change the colorBy method.
The logging will indicate two passes through change.js

Possible solution

Your environment: if browsing Nextstrain online

  • Operating system: Linux
  • Browser: Chrome/Firefox

Your environment: if running Nextstrain locally

  • Operating system: Linux
  • Browser: Chrome/Firefox
  • Version (e.g. auspice 2.7.0):

Additional context
Running in developer mode.

@cpsandbox cpsandbox added the bug Something isn't working label Apr 1, 2020
@jameshadfield jameshadfield changed the title [BUG] Color-by changes result in duplicate (expensive) function calls Apr 2, 2020
@jameshadfield jameshadfield added bug Something isn't working high priority performance improvement please take this issue and removed bug Something isn't working bug Something isn't working labels Apr 2, 2020
@jameshadfield
Copy link
Member

Good find Clint -- change() is an expensive function and getting rid of unnecessary calls here will be a good win for tree performance. I'm sure there are other functions (and react render calls) which are unnecessarily called & there are obvious performance wins here.

@andressrudqvist
Copy link
Contributor

Hi,
I would like to work on this issue.
I've followed the instructions to reproduce the bug, and now I'm looking for the double invocation of change() method.
Regards,
Andres

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants