Memoize API methods - #849
Conversation
Prior to this change, executing qubes-prefs requests two API methods, and took this much time to "list_methods" (format: CALL -> SECS): 0 -> 0.000520 0 -> 0.000404 1 -> 0.000237 1 -> 0.000183 2 -> 0.000468 2 -> 0.000199 3 -> 0.000277 3 -> 0.000207 With this change: 0 -> 0.000194 0 -> 0.000133 1 -> 0.000007 1 -> 0.000006 2 -> 0.000004 2 -> 0.000003 3 -> 0.000007 3 -> 0.000004 Suggested-by: Demi Marie Obenour <demiobenour@gmail.com> For: QubesOS/qubes-issues#10775
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #849 +/- ##
==========================================
- Coverage 70.37% 70.32% -0.06%
==========================================
Files 61 61
Lines 14179 14164 -15
==========================================
- Hits 9979 9961 -18
- Misses 4200 4203 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
By decoupling the listing method from the candidate selection, we lower time to get candidate from uncached method from 0.000300 to 0.000050.
ec4ab50 to
189df41
Compare
|
If The |
Drop time to list uncached method from 0.000050 to 0.000010.
0 -> 0.000007
ProtocolError("no such method: 'a'")
1 -> 0.000017
ProtocolError("no such method: 'b'")
2 -> 0.000007
ProtocolError("no such method: 'c'")
3 -> 0.000014
ProtocolError("no such method: 'd'")
e15a71e to
82bcfaf
Compare
|
Qubesd startup makes 200 calls, the loading of methods took |
OpenQA test summaryComplete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2026080104-devel&flavor=pull-requests Test run included the following:
New failures, excluding unstableCompared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2026050504-devel&flavor=update
Failed tests12 failures
Fixed failuresCompared to: https://openqa.qubes-os.org/tests/176874#dependencies 26 fixed
Unstable testsDetails
Performance TestsPerformance degradation:28 performance degradations
Remaining performance tests:83 tests
|
Prior to this change, executing qubes-prefs requests two API methods, and took this much time to "list_methods" (format: CALL -> SECS):
0 -> 0.000520
0 -> 0.000404
1 -> 0.000237
1 -> 0.000183
2 -> 0.000468
2 -> 0.000199
3 -> 0.000277
3 -> 0.000207
With this change:
0 -> 0.000194
0 -> 0.000133
1 -> 0.000007
1 -> 0.000006
2 -> 0.000004
2 -> 0.000003
3 -> 0.000007
3 -> 0.000004
Suggested-by: Demi Marie Obenour demiobenour@gmail.com
For: QubesOS/qubes-issues#10775