| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Ultra-low overhead PEP 669 instruction-level tracer and telemetry engine for Python.
Architecture • Usage Guide • Telemetry & Perfetto • Benchmarks
Ocular is a high-performance tracing and profiling runtime built in Rust, designed exclusively for Python 3.12+ via the PEP 669 (sys.monitoring) API.
It bridges the gap between deep, instruction-level visibility and production-grade performance. By utilizing lock-free zero-allocation pipelines and hardware-level cycle counting, Ocular observes Python's execution state without destroying its speed.
Ocular operates in two primary modes:
Note
Ocular strictly requires Python 3.12 or higher to leverage the sys.monitoring API.
Ensure you have Rust and a Python 3.12+ virtual environment active.
pip install maturin
maturin develop --releaseimport ocular
import time
def hot_loop_workload(limit):
total = 0
for i in range(limit):
total += i * 2
return total
# Start Ocular with adaptive de-instrumentation (threshold=500)
# This profiles the first 500 iterations, then drops overhead to zero.
ocular.start_tracing(mode="precise", perfetto=True, deinstrument_threshold=500)
start = time.time()
result = hot_loop_workload(1_000_000)
print(f"Elapsed: {time.time() - start:.4f}s")
# Stops tracing and flushes the telemetry worker queue
ocular.stop_tracing()Important
Production Status: Ocular is currently in Alpha.
Performance (v0.1.0):
Author: Seuriin (SSL-ACTX)
| Back | FazBrowse Home | New Git URL |