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

[IMP] BottomBarStatistics: faster computation of stats #3924

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Apr 8, 2024

  1. [IMP] BottomBarStatistics: Memoize cell filtering

    To compute the statistics, we filter out the cells by type for each
    function. However, there are only 2 different filters to apply for the
    6 different functions.
    
    This revision introduces a memoization of that filter to compute it 3
    times less.
    
    Benchmark
    ---------
    
    In Firefox with the largeDataSet of 260k cells, averaged on 10 runs:
    
            cells.filter    _computeStatisticFnResult
    ---------------------------------------------------
    before:  63.8 ms                  186.8 ms
    after:   22.4 ms                  138 ms
    
    Task: 3827324
    rrahir committed Apr 8, 2024
    Configuration menu
    Copy the full SHA
    77734b6 View commit details
    Browse the repository at this point in the history
  2. [IMP] BottomBarStatistics: Lazify statistic evaluation

    Each time we fetch the statistics, we compute all 6 of them even though
    we only need one of them to display (We need all of them when the
    statistics selection menu is open).
    
    This revision lazifies the computation of those statistics.
    
    Benchmark
    ---------
    
    In Firefox with the largeDataSet of 260k cells, averaged on 10 runs:
    
             _computeStatisticFnResult
    -----------------------------------
    before:           138  ms
    after:            95.8 ms
    
    Task: 3827324
    rrahir committed Apr 8, 2024
    Configuration menu
    Copy the full SHA
    82afe4f View commit details
    Browse the repository at this point in the history
  3. [IMP] BottomBarStatistics: limit redundant getter calls

    While we iterate over the cells to check their visibility, we keep
    checking the visibility of cells over which we already know that their
    col (or row) is hidden.
    
    This revision adds a memoization of limit the calls to the different
    getters involved by memoizing them as well as skips the visit of cells
    within columns that are hidden.
    
    Benchmark
    ---------
    
    In Firefox with the largeDataSet of 260k cells, averaged over 10 runs:
    
    Skipping entire hidden columns
    
             _computeStatisticFnResult
    -----------------------------------
    before:           95.8 ms
    after:            79   ms
    
    Skipping hidden columns + memoization
    
             _computeStatisticFnResult
    -----------------------------------
    before:           95.8 ms
    after:            72.4 ms
    
    Task: 3827324
    rrahir committed Apr 8, 2024
    Configuration menu
    Copy the full SHA
    a7dc365 View commit details
    Browse the repository at this point in the history