Buckets:

download
raw
1.27 kB
"""Eval for api-app-startup autoresearch loop.
Measures median cold-start import latency of enhanced_agent_bus.api.app
over 3 subprocess runs.
Outputs: api_app_startup_ms: <float>
Fixed eval — do not modify once the loop begins.
"""
from __future__ import annotations
import os
import statistics
import subprocess
import sys
_WT = os.path.dirname(os.path.abspath(__file__))
_PKG = os.path.join(os.path.dirname(_WT), "api-app-pkg")
_BOOTSTRAP = (
"import sys, importlib; "
"sys.meta_path = [f for f in sys.meta_path if type(f).__name__ != 'DistutilsMetaFinder']; "
f"sys.path = ['{_PKG}'] + [p for p in sys.path if '/Documents/' not in p]; "
"importlib.invalidate_caches(); "
)
_CODE = (
_BOOTSTRAP
+ "import time; t = time.perf_counter(); "
"import enhanced_agent_bus.api.app; "
"print((time.perf_counter()-t)*1000)"
)
env = os.environ.copy()
env["PYTHONPATH"] = _PKG
samples: list[float] = []
for _ in range(3):
cp = subprocess.run(
[sys.executable, "-c", _CODE],
cwd=_WT,
env=env,
text=True,
capture_output=True,
check=True,
)
samples.append(float(cp.stdout.strip().splitlines()[-1]))
result = statistics.median(samples)
print(f"api_app_startup_ms: {result:.3f}")

Xet Storage Details

Size:
1.27 kB
·
Xet hash:
559243062019b73c9453c3abf93fb42f740ec7760ca17e866ff84fa84b88fdaa

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.