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

Entropy bug fixes #1906

Merged
merged 2 commits into from
Nov 18, 2024
Merged

Entropy bug fixes #1906

merged 2 commits into from
Nov 18, 2024

Conversation

jameshadfield
Copy link
Member

commit 1

Changing between "Entropy - Events" results in two dispatches
(ENTROPY_COUNTS_TOGGLE and ENTROPY_DATA) however the entropy code
would ignore the first update if it didn't contain new entropy data.
This bug has probably existed for the life of the entropy panel however
was masked by those two actions happening back-to-back and being
(always?) bundled together by redux.

Recent work in #1879 (v2.60.0) meant these actions were no longer
back-to-back and thus the bug was revealed.

Closes #1905

commit 2

This reverts commit 0c91724.

That commit was the first performance optimisation within #1879. The
idea was to skip the expensive recalculation when initially dragging the
date slider. In other contexts this change was a negative, specifically
when there was only one action (e.g. changing entropy to events) as we
essentially introduced a 500ms delay.

Note that when the panel is off-screen subsequent work in #1879 means
that the recalculation is skipped anyway, so reverting this commit only
affects performance when the panel is on screen and we're dragging the
date slider. To remedy this we should add a code path which specifically
skips the leading edge calculation when dragging the date slider.

Essentially closes #1899 - that issue was partly the recalculation
on-demand which remains, but greatly exacerbated by the unnecessary
500ms delay.

Changing between "Entropy - Events" results in two dispatches
(`ENTROPY_COUNTS_TOGGLE` and `ENTROPY_DATA`) however the entropy code
would ignore the first update if it didn't contain new entropy data.
This bug has probably existed for the life of the entropy panel however
was masked by those two actions happening back-to-back and being
(always?) bundled together by redux.

Recent work in #1879 (v2.60.0) meant these actions were no longer
back-to-back and thus the bug was revealed.

Closes #1905
This reverts commit 0c91724.

That commit was the first performance optimisation within #1879. The
idea was to skip the expensive recalculation when initially dragging the
date slider. In other contexts this change was a negative, specifically
when there was only one action (e.g. changing entropy to events) as we
essentially introduced a 500ms delay.

Note that when the panel is off-screen subsequent work in #1879 means
that the recalculation is skipped anyway, so reverting this commit only
affects performance when the panel is on screen and we're dragging the
date slider. To remedy this we should add a code path which specifically
skips the leading edge calculation when dragging the date slider.

Essentially closes #1899 - that issue was partly the recalculation
on-demand which remains, but greatly exacerbated by the unnecessary
500ms delay.
@nextstrain-bot nextstrain-bot temporarily deployed to auspice-james-entropy-f-ztd4ke November 17, 2024 22:30 Inactive
@jameshadfield jameshadfield merged commit 7ec0222 into master Nov 18, 2024
25 checks passed
@jameshadfield jameshadfield deleted the james/entropy-fixes branch November 18, 2024 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants