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

Benchmark and optimise reward calculation #1851

Merged
merged 6 commits into from
Sep 15, 2020
Merged

Benchmark and optimise reward calculation #1851

merged 6 commits into from
Sep 15, 2020

Commits on Sep 15, 2020

  1. Formatting

    Mostly breaking some very long lines.
    nc6 committed Sep 15, 2020
    Configuration menu
    Copy the full SHA
    84d9887 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3668919 View commit details
    Browse the repository at this point in the history
  3. Add 'registerGenesisStaking' to test library.

    This currently exists in the library code of
    ouroboros-consensus-shelley. But it would be good to replace that
    function with this one, and ensure it's used only in testing.
    nc6 committed Sep 15, 2020
    Configuration menu
    Copy the full SHA
    b7b7229 View commit details
    Browse the repository at this point in the history
  4. Add 'createRUpd' microbenchmark.

    nc6 committed Sep 15, 2020
    Configuration menu
    Copy the full SHA
    6377fe9 View commit details
    Browse the repository at this point in the history
  5. Add benchmark for 'likelihood'.

    This is the main component of the reward calculation.
    nc6 committed Sep 15, 2020
    Configuration menu
    Copy the full SHA
    e1c2b15 View commit details
    Browse the repository at this point in the history
  6. Performance optimisation of 'likelihood'.

    Per the micro-benchmark for likelihood, this reduces the time from
    around 50-60ms to around 1. Since this accounts for about 60-70% of the
    time spend in `createRUpd`, we should hope to see at least a doubling of
    performance there.
    
    The optimisation is achieved by calculating `Set.fromList` only once,
    rather than for each reward calculation.
    nc6 committed Sep 15, 2020
    Configuration menu
    Copy the full SHA
    e06a1b1 View commit details
    Browse the repository at this point in the history