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

Delegator benchmarks #2436

Merged
merged 4 commits into from
Apr 24, 2024
Merged

Delegator benchmarks #2436

merged 4 commits into from
Apr 24, 2024

Conversation

iamalwaysuncomfortable
Copy link
Contributor

@iamalwaysuncomfortable iamalwaysuncomfortable commented Apr 17, 2024

Motivation

It is desirable to have an idea of performance of functions that touch committee update logic as well the performance of accessor methods to credits.aleo mappings that are related to staking when the number of delegators is at the maximum allowed value.

This PR adds benchmarks of those functions.

Initial Results

Benching using Criterion of both get_value_speculative and get_value_confirmed mappings using RocksDB on Mac OSX 12.6.3 - M1 10-cores - 64 GB memory

Yields the following benchmarks. Most benchmarks for entries ranging from 10 -> 100_000 show a runtime within the vicinity of 100µs. These benchmarks are congruent with other benchmarks on the GET opcode which showed that GET access times do not significantly vary by number of entries into the RocksDB database.

bonded mapping - get_value_speculative - 10 entries
                        time:   [96.503 µs 98.889 µs 101.86 µs]

bonded mapping - get_value_confirmed - 10 entries
                        time:   [100.72 µs 107.79 µs 115.61 µs]

bonded mapping - get_value_speculative - 5000 entries
                        time:   [99.627 µs 102.78 µs 106.21 µs]

bonded mapping - get_value_confirmed - 5000 entries
                        time:   [100.06 µs 102.98 µs 106.25 µs]

bonded mapping - get_value_speculative - 10000 entries
                        time:   [99.627 µs 102.30 µs 105.59 µs]

bonded mapping - get_value_confirmed - 10000 entries
                        time:   [95.546 µs 96.749 µs 98.016 µs]

bonded mapping - get_value_speculative - 20000 entries
                        time:   [96.398 µs 97.753 µs 99.278 µs]

bonded mapping - get_value_confirmed - 20000 entries
                        time:   [104.20 µs 108.21 µs 112.85 µs]

bonded mapping - get_value_speculative - 40000 entries
                        time:   [104.28 µs 109.62 µs 115.32 µs]

bonded mapping - get_value_confirmed - 40000 entries
                        time:   [105.31 µs 110.04 µs 115.15 µs]

bonded mapping - get_value_speculative - 80000 entries
                        time:   [101.54 µs 105.31 µs 109.49 µs]

bonded mapping - get_value_confirmed - 80000 entries
                        time:   [100.00 µs 102.41 µs 105.09 µs]

bonded mapping - get_value_speculative - 100000 entries
                        time:   [102.33 µs 105.51 µs 109.01 µs]

bonded mapping - get_value_confirmed - 100000 entries
                        time:   [98.283 µs 100.21 µs 102.35 µs]

@iamalwaysuncomfortable iamalwaysuncomfortable marked this pull request as ready for review April 19, 2024 11:24
@howardwu howardwu merged commit aef07da into mainnet-staging Apr 24, 2024
80 checks passed
@howardwu howardwu deleted the bench-bonded-mappings branch April 24, 2024 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants