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

Fix slowTickIfNecessary with infrequently used EWMA #3929

Merged
merged 1 commit into from
Oct 3, 2024

Commits on Oct 3, 2024

  1. Fix slowTickIfNecessary with infrequently used EWMA

    EWMA.tickIfNecessary does an amount of work that is linear to the amount of time that has passed since the last time the EWMA was ticked. For infrequently used EWMA this can lead to pauses observed in the 700-800 millisecond range after a few hundred days.
    
    It's not really necessary to perform every tick as all that is doing is slowly approaching the smallest representable positive number in a double. Instead pick a number close to zero and if the number of ticks required is greater then that don't do the ticks just set the value to close to zero immediately. Actually approaching the smallest representable number is still measurably slow and not particularly useful.
    
    To avoid changing the observed output of the EWMA (which previous was only 0.0 if never used) set it close to Double.MIN_NORMAL rather then to 0.0
    aweisberg authored and joschi committed Oct 3, 2024
    Configuration menu
    Copy the full SHA
    84e7464 View commit details
    Browse the repository at this point in the history