-
Notifications
You must be signed in to change notification settings - Fork 211
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
chore(latency-tests): reissue more notes #4587
chore(latency-tests): reissue more notes #4587
Conversation
Reissuing is so fast, that it's hard to bench any potential improvements. Issue more notes, to make it work harder. In my tests, when using `ci` build profile: Before: LATENCY REISSUE: min: 0.6s, avg: 0.7s, median: 0.6s, p90: 0.7s, max: 0.7s, sum: 19.5s Now: LATENCY REISSUE: min: 1.3s, avg: 1.4s, median: 1.4s, p90: 1.5s, max: 1.5s, sum: 42.4s
@@ -132,8 +133,13 @@ pub async fn latency_tests(dev_fed: DevFed, r#type: LatencyTest) -> Result<()> { | |||
// for enough time to catch up a session end | |||
let iterations = 30; | |||
let mut reissues = Vec::with_capacity(iterations); | |||
let amount_per_iteration_msats = | |||
// use a highest 2^-1 amount that fits, to try to use as many notes as possible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: 2^x-1
@@ -132,8 +133,13 @@ pub async fn latency_tests(dev_fed: DevFed, r#type: LatencyTest) -> Result<()> { | |||
// for enough time to catch up a session end | |||
let iterations = 30; | |||
let mut reissues = Vec::with_capacity(iterations); | |||
let amount_per_iteration_msats = | |||
// use a highest 2^-1 amount that fits, to try to use as many notes as possible | |||
((initial_balance_sats * 1000 / iterations as u64).next_power_of_two() >> 1) - 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL about next_power_of_two
🤯
Note that this might blow up if we ever switch away from base-2 denominations as the default. The only commitment we made and assume everywhere is that denominations are b^x.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it should fail gracefully, just not issuing as many notes anymore.
Reissuing is so fast now, that it's hard to bench any potential improvements. Issue more notes, to make it work harder.
In my tests, when using
ci
build profile:Before:
LATENCY REISSUE: min: 0.6s, avg: 0.7s, median: 0.6s, p90: 0.7s, max: 0.7s, sum: 19.5s
Now:
LATENCY REISSUE: min: 1.3s, avg: 1.4s, median: 1.4s, p90: 1.5s, max: 1.5s, sum: 42.4s