-
Notifications
You must be signed in to change notification settings - Fork 79
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
Change the complexity scaling of reschedule recovered search #677
Conversation
The reschedule recovered wile searching, for each expiration set, was performing a loop Recovering number of times to look up in a set of Expiring sectors. This leads to scaling `O(recovering*log(expiring))`. Following PR changes it such that the work performed is `O(expiring*log(recovering))`. This should improve the gas usage as on expectation there is 3-5 sectors expiring in any given queue. Signed-off-by: Jakub Sztandera <[email protected]>
bd9184e
to
212fd55
Compare
@Kubuxu I used the #677 and#849 the test the benchmark message |
I hoped for a larger change, I will investigate what more can be done. |
@Kubuxu this is the total log info |
This patch optimizes gas usage of bafy2bzacebi3rqchvhdcswdihsmjw4tho7frrjavpqk6lp5bx4usgma4tmuey by 62%. |
Trace:
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #677 +/- ##
==========================================
- Coverage 84.89% 84.80% -0.10%
==========================================
Files 89 89
Lines 18131 18126 -5
==========================================
- Hits 15393 15371 -22
- Misses 2738 2755 +17
|
Notes from my exploration: using HashMap decreases the performance, the unchecked math tweak is an insignificant optimization in this case, |
…n-project#677) The reschedule recovered while searching, for each expiration set, was performing a loop Recovering number of times to look up in a set of Expiring sectors. This leads to scaling `O(recovering*log(expiring))`. Following PR changes it such that the work performed is `O(expiring*log(recovering))`. This should improve the gas usage as on expectation there are 3-5 sectors expiring in any given queue. Signed-off-by: Jakub Sztandera <[email protected]>
The reschedule recovered while searching, for each expiration set, was
performing a loop Recovering a number of times to look up in a set of
Expiring sectors. This leads to scaling
O(recovering*log(expiring))
.Following PR changes it such that the work performed is
O(expiring*log(recovering))
. This should improve the gas usage as onexpectation there are 3-5 sectors expiring in any given queue entry
until we find the right queue.
Resolves #545