perf: answer chown and bound thermal paths through the proot fast path (#2203)

This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-11-07 01:08:06 -05:00
1 parent 18c7d56409
commit aba55031c3
7 files changed
+267 -3

No files matched your search

+12
View File
@@ -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")