Concepts
Overhead
What recording costs, as measured by the benchmark of ormaos-python on two workloads on one machine.
Recording adds work to every call of your code. A program that makes very many small calls runs many times slower while it is recorded, and its recording is large. A program that spends its time in I/O or inside libraries is affected much less.
The measurement#
The numbers below are from bench/RESULTS.md of ormaos-python at the pinned commit, written by bench/run.py: N: 20 runs of each row, after 1 discarded, on CPython 3.13.17source. Each time is the whole command, from start to exit, in milliseconds of wall-clock time; with Ormaos it includes starting the CLI and reading the recording back for the summary.
| Workload | Without Ormaos | With ormaos run -- python | Ratio |
|---|---|---|---|
| CPU: 150,000 calls of small pure-Python functions | 81.6 mssource | 2798.2 mssource | x34.28source |
| I/O: a SQLite file and 200 small files | 34.5 mssource | 265.7 mssource | x7.69source |
The medians. The CPU workload is the worst case: the cost grows with the number of calls.
By capability set#
| Capability set | CPU workload | I/O workload |
|---|---|---|
context only (ormaos run around a Python that starts without the recorder) | 130.2 ms (x1.59)source | 86.3 ms (x2.50)source |
calls and exceptions (--no-io) | 2544.4 ms (x31.17)source | 138.0 ms (x4.00)source |
| calls, exceptions and path | 2741.4 ms (x33.58)source | 141.7 ms (x4.10)source |
| calls, exceptions and io (the default) | 2798.2 ms (x34.28)source | 265.7 ms (x7.69)source |
The machine, the spread of the runs (p25 to p75, min to max) and what each recording held are in bench/RESULTS.md. These are two workloads on one machine; another program has another number of calls per second, and another cost.
Recording less#
ormaos run --only context,exceptions,io -- <command>leaves out the call tree. With any choice other thancontext, calls are still followed while the program runs and left out when the recording is written: the recording is smaller, the program is not much faster.ormaos run --only contextwatches nothing inside the program.ormaos run --no-iorecords without I/O.with ormaos.record():records only one block.
Other costs#
- Describing data reads the whole of a DataFrame or array at every call that receives or returns it, bounded by size and by time per process (see Limits).
tree,exceptions,io,pathanddiffload the whole recording to answer.ormaos runruns three read-only git commands before the command, and waits up to one second at the end for Python processes that are still alive.