mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-26 00:06:02 +00:00
perf: answer chown and bound thermal paths through the proot fast path (#2203)
This commit is contained in:
1 parent
18c7d56409
commit
aba55031c3
7 files changed
+267
-3
No files matched your search
@@ -0,0 +1,12 @@
|
||||
import sys
|
||||
import time
|
||||
|
||||
count = int(sys.argv[1])
|
||||
paths = ["/sys/class/thermal/thermal_zone%d/temp" % n for n in (22, 26, 28)]
|
||||
start = time.perf_counter()
|
||||
for _ in range(count):
|
||||
for p in paths:
|
||||
with open(p) as f:
|
||||
f.read()
|
||||
elapsed = time.perf_counter() - start
|
||||
print(f"{count * len(paths)} opens {elapsed:.3f}s {elapsed / (count * len(paths)) * 1e6:.0f}us each")
|
||||
Reference in new issue
Block a user