OrmaosDocs

Concepts

Overhead

What recording costs, as measured by the benchmark of ormaos-python on two workloads on one machine.

View as Markdown

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.

WorkloadWithout OrmaosWith ormaos run -- pythonRatio
CPU: 150,000 calls of small pure-Python functions81.6 mssource2798.2 mssourcex34.28source
I/O: a SQLite file and 200 small files34.5 mssource265.7 mssourcex7.69source

The medians. The CPU workload is the worst case: the cost grows with the number of calls.

By capability set#

Capability setCPU workloadI/O workload
context only (ormaos run around a Python that starts without the recorder)130.2 ms (x1.59)source86.3 ms (x2.50)source
calls and exceptions (--no-io)2544.4 ms (x31.17)source138.0 ms (x4.00)source
calls, exceptions and path2741.4 ms (x33.58)source141.7 ms (x4.10)source
calls, exceptions and io (the default)2798.2 ms (x34.28)source265.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 than context, 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 context watches nothing inside the program.
  • ormaos run --no-io records 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, path and diff load the whole recording to answer.
  • ormaos run runs three read-only git commands before the command, and waits up to one second at the end for Python processes that are still alive.