simbiot-harness/venv/lib/python3.12/site-packages/jsonschema/benchmarks/import_benchmark.py
Simbiot Harness b60439152b Simbiot Harness v0.1: тактовая лестница на Strands + CQRS/ES-спина
- harness/es.py: append-only event store + проекции (образец — кооп-портал)
- harness/levels.py: уровни 1с/1м/1ч/1д, контекст ∝ масштабу
- harness/scheduler.py: уровневые потоки, идемпотентные тики, absorbed-стабы
- harness/isolated_runner.py + _llm_worker.py: LLM-тик в сабпроцессе
  (глобальный asyncio-рантайм Strands не переживает 2+ create_harness)
- cli.py: init/task/tasks/status/events + requeue (написан самим минутным агентом)
- 9router: отдельный ключ sk-simbiot, модель auto (glm-5.3 первым)
2026-09-29 15:28:50 +00:00

31 lines
779 B
Python

"""
A benchmark which measures the import time of jsonschema
"""
import subprocess
import sys
def import_time(loops):
total_us = 0
for _ in range(loops):
p = subprocess.run( # noqa: S603 (arguments are static)
[sys.executable, "-X", "importtime", "-c", "import jsonschema"],
stderr=subprocess.PIPE,
stdout=subprocess.DEVNULL,
check=True,
)
line = p.stderr.splitlines()[-1]
field = line.split(b"|")[-2].strip()
us = int(field) # microseconds
total_us += us
# pyperf expects seconds
return total_us / 1_000_000.0
if __name__ == "__main__":
from pyperf import Runner
runner = Runner()
runner.bench_time_func("Import time (cumulative)", import_time)