SPB Git

Repository Public

BENCHMARKS.md 6.1 KB 87 lines markdown

1# SP Term — Benchmarks23Measured on 2026-11-17 on one machine: **MacBook Pro, Apple M5 Max (18 cores), 48 GB RAM, macOS 27.0**,4built-in display 1312×848 pt @2x, on AC power, with other applications (and other automation) running.5Single runs unless a spread is given: treat the numbers as orders of magnitude, not as guarantees.67Renderer under test: the engine's default **CoreGraphics** renderer. The Metal renderer exists behind an8"experimental" switch and was **not measured**; SP Term makes no claim of GPU acceleration.910## Application (signed universal Release build, arm64 slice)1112Command: `Scripts/bench.sh "dist/SP Term.app"`1314| Measure | Result | Method |15|---|---|---|16| Launch → first window on screen | **250–259 ms** (5 launches: 256, 251, 255, 259, 250; median 255) | from `open` until the window server lists the window, polled every 10 ms, after one warm-up launch |17| Memory, 1 pane, idle | **57 MB** physical footprint (100 MB resident) | `footprint`, `ps` 4 s after launch |18| Memory, 8 panes (8 shells), idle | **64 MB** footprint (107 MB resident) | preset `grid8`, 6 s after launch |19| CPU, 8 idle panes | 1.2 % | `ps` (includes the 1 Hz process sampler) |20| Bundle size / DMG size | 23 MB / 8.3 MB | universal binary |2122## Terminal pipeline (in-process, Release build with testability)2324Command: `xcodebuild … -configuration Release ENABLE_TESTABILITY=YES ARCHS=arm64 test -only-testing:SPTermTests/PerformanceTests`2526These run the real PTY, shell and emulation engine inside the app process with the window **not on screen**:27they measure transport + parsing + buffer maintenance and **exclude drawing**.2829| Measure | Release | Debug | Method |30|---|---|---|---|31| Large stdout: `cat` of 51 MB / 400 000 lines | **0.51 s — ≈ 100 MB/s** (≈ 780 000 lines/s) | 13.5 s — 3.8 MB/s | time until `cat` returned and the last line was parsed |32| Echo latency: key → PTY → echo → parsed into the screen buffer | **median 0.26 ms**, p95 0.36 ms, max 0.70 ms (200 keys) | median 0.69 ms, p95 0.94 ms | program `cat` in the pane; busy-wait on the buffer |33| 300 view resizes while a loop prints continuously | **0.32 s**, kernel TTY size equals the view afterwards | 5.2 s | `setFrameSize` × 300, then `stty size` |34| Scrollback bound | 200 044 lines kept of 400 000 fed (setting: 200 000) | same | line count of the buffer |35| Memory with a full 200 000-line scrollback (~125 columns) | **≈ 365 MB more** (142 → 508 MB resident; includes the 51 MB test file held by the test) | same | `task_info` before/after |36| Backward search for one string in 200 000 lines | **2.5 s** | 6.9 s | `findPrevious` + match summary |3738## Reading these numbers3940- **Typing latency to glass was not measured.** The 0.26 ms figure stops at the screen buffer; the time to the41  next displayed frame (bounded by the display refresh) is not included, and no camera or frame-timing42  measurement was made.43- Throughput of ~100 MB/s is without drawing; with a visible window the engine coalesces frames, which was not44  quantified here.45- The first throughput attempt reported 0.4 MB/s. That was a flaw of the test (it re-read the whole 200 000-line46  buffer every 30 ms, blocking the parser); it is mentioned because reading the full buffer of a very long47  scrollback is genuinely expensive: SP Term only does it on explicit export, on "attach last 60 lines" and once48  when an SSH session ends.49- A long scrollback is memory-hungry (roughly 1.8 KB per line at this width). The default is 20 000 lines;50  the setting goes up to 1 000 000 and the cost grows linearly.51- Searching a 200 000-line scrollback takes seconds and runs on the main thread: the window is unresponsive52  meanwhile. With the default 20 000 lines this is proportionally shorter (not measured separately).53- Debug builds are 10–25 times slower on the parsing paths; always measure Release.54- Not measured: energy use, Intel performance, many simultaneous heavy streams, sustained multi-hour sessions.5556## SP Term Next (2.0.0) against 1.0.0 — 2026-11-195758Command: `Scripts/bench-instance.sh <app>` (one isolated instance measured by process id; the binary is started directly, so59launch times are not comparable with the `open`-based figures above). Same machine, other applications running, single session.601.0.0 is the notarized `dist` build; 2.0.0 is a local universal Release build.6162| Measure | 1.0.0 | 2.0.0 |63|---|---|---|64| Launch → first window on screen, 7 launches, two series each | 152–190 ms (medians 166 and 157) | 159–182 ms (medians 179 and 171) |65| Memory, 1 idle pane | 57 MB footprint (96 MB resident) | 58 MB (101 MB) |66| Memory, 8 idle panes | 63 MB (105 MB) | 67 MB (111 MB) |67| CPU, idle, one 2 s `top` sample | 0.2 % (1 pane), 0.6 % (8 panes) | 0.9 % (1 pane), 0.1 % (8 panes) |6869Reading: the new chrome costs about 10 ms at launch and 1 to 4 MB. The idle CPU samples are single readings within noise of70each other; they do not show a difference in either direction. Animation smoothness was not measured.7172Terminal pipeline on 2.0.0 (in-process, Release with testability, single run, 2026-11-19). The command of the section above now73needs `CODE_SIGN_INJECT_BASE_ENTITLEMENTS=YES`: without it the hardened Release host refuses the test bundle and the runner74hangs ("hung before establishing connection"); that setting was turned off for distribution after the 1.0.0 figures were taken.7576| Measure | 1.0.0 (2026-11-17) | 2.0.0 (2026-11-19) |77|---|---|---|78| `cat` of 51 MB / 400 000 lines | 0.51 s, ≈ 100 MB/s | 0.54 s, 94 MB/s |79| Echo latency to the screen buffer | median 0.26 ms, p95 0.36 | median 0.16 ms, p95 0.27 |80| 300 view resizes under output | 0.32 s | **0.72 s**, kernel TTY size still equals the view |81| Backward search in 200 000 lines | 2.5 s | 1.4 s |8283The two columns are not the same experiment: in 1.0.0 the window controller (and with it the off-screen test window) was84released right after opening, so these tests ran on terminal views that were no longer in a window; in 2.0.0 the window lives.85The slower resize figure may come from that, from the new card layout, or both; it was not separated. Throughput and echo86latency, which do not depend on layout, are unchanged within run-to-run noise.87
Files main
Menu

Theme