Performance and memory
On this page
Principles
- Budgets are requirements: every metric has a numeric target, and a regression fails CI just like a failing test.
- Measure first: no optimization without a benchmark that justifies it and then protects it.
- Idle means zero: no frames, timers or wakeups when nothing changes.
- What you can't see costs nothing:
- hidden panes are not drawn;
- unused plugins are not loaded;
- occluded windows draw nothing, and keep one drawable alone, the one that shows their last frame.
- Memory is accounted per category: heap, GPU and mappings are tracked separately, because a single total hides problems.
Budgets
Figures are for Apple Silicon (M-series), release builds. Every release is measured against them before it ships; changing one is an explicit decision, never a silent one. The F0 baseline of existing terminals revised the startup, footprint and idle budgets. Every release's measures stand side by side in the releases' table, with the features that each brought and what they cost.
| Metric | Target | How it is measured |
|---|---|---|
| Startup, warm, and the first frame | The first window ≤ 70 ms after the first window of ttybench's floor app, an AppKit app that shows one empty window, launched alike in the same round, at the median of a session's rounds, since 25 November 2026, as the startup's gap beside a floor app set it: the gap of the first frame to a minimal app's first window before it, ≤ 35 ms, moved by tens of milliseconds with the Mac's state from a round to the next; the first frame's gap to the floor app's first frame told by each release, of no budget yet; cold, ≤ 1 s at the 90th percentile, after sudo purge, as the startup's measures set it | ttybench's startup --floor, window_gap_ms, and --first-frame, first_frame_gap_ms, of Instruments' trace; wp_presentation on Linux |
| Key → presented frame, at 120 Hz | p50 ≤ 2 frames, p99 ≤ 4.5, set on 31 October 2026 from the latency's measures, where macOS's composition now and then takes 24 ms from a frame's commit to the display; one extra frame allowed next to a pane flooding output; at 60 Hz, as the releases' sessions run, 33.3 and 75 ms | ttybench's latency, latency_ms: a key to the first frame of its echo that the window server took |
| Idle | 0 package idle wakeups/s and ≤ 0.5 interrupt wakeups/s, once the cursor stops blinking (15 s after the last key or output, by default); while it blinks, ≤ 2/s at the default interval, faded or not, and with blinking text, as the window server blinks the cursor's layer and the blinking text's without the app, as the idle's measures show | ttybench's idle, package_idle_wakeups_per_s and interrupt_wakeups_per_s, the mean of intervals of a second, 20 s after the launch; powermetrics; voluntary_ctxt_switches deltas on Linux |
| Footprint excluding GPU memory | ≤ 35 MB with 1 window and 1 pane; ≤ 1 MB per additional pane; ≤ 2 MB per active Luau plugin; back to baseline ±2 MB after closing tabs | ttybench's memory, footprint_without_gpu_mib, 17 s after the launch: the footprint of the terminal's processes less the GPU categories of footprint, its shell's and ttybench's payload's too, some 3 MB more than Lokyr alone; on Linux PSS and heaptrack, never RSS |
| Scrollback | ≤ configured limit + 5%; ≈ 8 B per cell | memory tests in CI |
| GPU memory (accounted separately) | 2 BGRA8 framebufferOnly drawables per window (≈ 31 MB each at 3456×2234), three with the build's feature three-drawables, none per pane, of which a window that others cover keeps one, the one that shows its last frame, and a window that its session hides one at most; Metal's own memory while frames are drawn, about 85 to 95 MB on an M5 Pro, whatever the window's size, which the driver keeps and the system can take back about two seconds after the last frame, is any Metal app's, not counted against the budget; the glyph atlas, shared by every window, at most 32 MB: a grayscale texture up to 4096² and a color one up to 2048² | The GPU categories of footprint, ttybench's memory's footprint_mib less footprint_without_gpu_mib; Instruments (Metal System Trace); DRM fdinfo on Linux |
| Throughput | Within 10 % of the fastest of the other terminals compared, but in vtebench's bottom region, with its lines of one character | vtebench's scenarios and a file of 1 GiB, headless, just bench; on screen, ttybench's throughput, quiet_mib_s, of 1 GiB of plain text, of colored text and of wide characters, and of seq's lines |
| CPU per frame | ≤ 2 ms p99 (4K, 4 panes); a frame that draws glyphs that the atlas lacks, ≤ 10 ms, of which it starts looking up faces for 2 ms and draws glyphs for 2 ms at most, the rest left to the frames after, set on 31 October 2026 from the glyphs' measures | tracing spans + signposts, and lokyr --bench output, of the main thread's phases; each release tells ttybench's scroll --by lines, frame_cpu_ms, a mean of every thread over a wheel's scroll, which counts more than the phases that the budget bounds |
| Luau plugin activation | ≤ 5 ms, compilation included | just bench-luau: a fresh VM's making, its code's compilation and its activate, of the template that sleip new makes and of a plugin of 2000 lines, in both executions, and its VM's heap |
Where Lokyr stands
Lokyr 1.7.0, of 2 December 2026, against its budgets, of its A/B against 1.6.2 and its notarized DMG's startup, and against five other terminals of the comparison of 30 November and 1 December 2026, of 1.6.1's notarized app and each terminal's version of that day, its place of six and the best of the others' figure. The releases' table holds these figures for the last eight releases.
| Measure | 1.7.0 | Budget | Against the other terminals |
|---|---|---|---|
| Startup, its window after the window of ttybench's floor app, launched alike | 94.7 ms of the release's notarized DMG, 1.6.2's 87.9 in the same session, past the budget for both; 87.6 against 78.3 of bundles in the A/B | ≤ 70 ms | 60.6 ms, the first of six; the next 119.4 ms |
| A key to its echo on screen at 60 Hz, of ttybench, median and 99th percentile | 12.3 and 29.9 ms, 1.6.2's alike in the same session | ≤ 33.3 and ≤ 75 ms | 17.3 and 29.4 ms, the first of six at both; the next 22.1 and 33.5 ms |
| Memory at rest, without the GPU's | 31.1 MiB of its processes and the measure's payload, of ttybench | ≤ 35 MB | 30.3 MiB of its processes and the measure's payload, the least of six; the next 39.6 MiB |
| Interrupt wakeups at rest | 0.33 a second, and no package idle wakeup | ≤ 0.5 a second | 0.37 a second, the second of six, 0.02 more than the least; no package idle wakeup, as none of the six |
cat of 1 GiB of ASCII on screen | 304.3 MiB/s, of ttybench, 1.6.2's 310.0 in the same session | ≥ 284.8 MiB/s | 320.6 MiB/s, the first of six; the next 316.4 MiB/s |
| A frame on the CPU, of ttybench, every thread over a wheel's scroll, a frame a step | 2.44 ms, 1.6.2's 2.39 in the same session | — | Of ttybench, every thread over a wheel's scroll, a frame a step: 2.54 ms, the least of six; the next 2.66 ms |
| The GPU while a wheel scrolls, 20 frames a second | — | — | 19.5 ms a second of its own, the least of six; the next 25.0 ms |
| Scrolling by pixels, a trackpad's swipe, the frames a second | 60.7 at 60 Hz, a frame at 99.8 % of the refreshes; 123.3 at 120 Hz and 98.6 %, of 1.4.0's sessions | — | 60.6 of smooth scrolling, as the four others that follow the trackpad at every refresh; 15.9 by rows, of its default, as the one other that scrolls by rows |
The figures of one session compare within it alone: a session's load and display move them by a few percent, which is why each release's A/B measures the release before beside it.
How to measure
Every measure of a release, and every comparison with other terminals, is of ttybench, the toolkit that measures terminal emulators on macOS, alike for any terminal. Install it with cargo install ttybench --locked. Lokyr's sessions, the releases' A/B and the comparison, are in tools/bench/sessions, whose README tells how to run them. Each of ttybench's tools launches the terminal running its payload, a small program that prints, reads keys or rests, measures it, and quits it.
macOS asks for two permissions of the app that runs ttybench, such as a terminal or an editor, not of ttybench itself: Accessibility, for the keys, scrolls and drags that it sends, and Screen & System Audio Recording, for its captures of the window. The tools that record Instruments' traces take Xcode, not only its Command Line Tools.
| Measure | ttybench's tool and metric | What it counts | It takes |
|---|---|---|---|
| Startup | startup --floor, window_gap_ms | The launch, through Launch Services, to the terminal's first window on screen, less the window of ttybench's floor app, launched alike in the same round. What slows both alike, such as the Mac's state or a scan of each launch, drops out. | — |
| The first frame | startup --floor --first-frame, first_frame_gap_ms | The terminal's first frame that the display showed, of its own record in Instruments' Metal System Trace, less the floor app's first frame, which presents one Metal frame as its window shows. A window shows some 10 to 30 ms before its first frame. The trace of every process slows the Mac a little: these figures compare with other sessions of the first frame alone. | Xcode |
| Latency | latency, latency_ms | A key struck, to the first frame that shows its echo, as the window server took it, of a capture of the window; the keys fall at every phase of the display's refresh; the median and the 99th percentile. --flood measures it beside a pane that yes floods. | Accessibility, Screen Recording |
| Idle | idle, package_idle_wakeups_per_s, interrupt_wakeups_per_s | The wakeups of the terminal's processes, of proc_pid_rusage, the mean of intervals of a second, 20 s after the launch. Package idle wakeups bring the CPU out of idle, as top -stats idlew shows; interrupt wakeups count every wakeup of an interrupt, such as a timer's, whether the CPU was idle or not. | — |
| Memory | memory, footprint_without_gpu_mib and footprint_mib | The physical footprint of the terminal's processes, its shell and ttybench's payload too, 17 s after the launch, with and without the GPU's memory that Apple's footprint tells apart: IOSurface, IOAccelerator and the graphics ledger. The GPU's share is the difference of the two. | — |
| Throughput | throughput, quiet_mib_s | A file printed on screen, 1 GiB of plain text, of a color before each character or of wide characters, or the lines of seq 1 10000000 (--text numbers), to the quiet: once the terminal's processes stay below 5 % of a core for 60 ms, having drawn what they took. | — |
| A frame on the CPU | scroll --by lines, frame_cpu_ms | The CPU time of the terminal's processes, of every thread, over a wheel's scroll of plain or of wide text, divided by the frames that showed the text moved: a mean of each round, not a frame's own time. | Accessibility, Screen Recording |
| Scrolling | scroll, frames_per_s; frames, refreshes_with_frame | The frames that show the text moved while a trackpad's swipe or a wheel scrolls it, and, of Instruments' trace, the share of the display's refreshes that showed a new frame. | Accessibility, Screen Recording; Xcode for frames |
| The window's motion | motion, frames_per_s, missed_frames, compositor_delay_ms | The window dragged by its titlebar or resized by its corner along a sine, of Instruments' Animation Hitches: the frames shown, those missed, and the compositor's delay. The feature blur measures a translucent window. | Accessibility, Xcode |
| The GPU | gpu, terminal_gpu_ms_per_s | The GPU time of the terminal's processes and of WindowServer, of IOKit's GPU clients, at rest or while it scrolls; --system adds the system's GPU power, of powermetrics. | sudo for --system |
Cold: ttybench measures warm launches. A cold one, after sudo purge, was last measured in the startup's measures of 31 October 2026.
In the app, for developers: Lokyr's own lokyr --bench modes are diagnostics, which no release's measure takes.
lokyr --bench startupprints when the process started (proc_pidinfo) and when the first drawable'saddPresentedHandlerfired, then quits.lokyr --bench latency [--keys <n>] [--flood]compares each key'sNSEvent.timestampwith the presentation time (MTLDrawable.presentedTime) of the first frame with new output after it, and prints a histogram as JSON as it quits: ofnkeys that it posts to its own queue of events, one every 40 to 62 ms, or of those typed in it; with--flood, beside a window thatyesfloods.lokyr --bench output [--window <width>x<height>] -- <program> [args]times each phase of the frames on the main thread while the program prints: the snapshot, the layout, the display list and the encoding.tracingspans andos_signpost(Instruments' Points of Interest) mark each phase of a frame: snapshot, shaping, display list, encoding, present.footprint <pid>andvmmap -summary <pid>give the memory's details, and Instruments' Metal System Trace the GPU's.
Inside the code:
just bench: the criterion benchmarks of the VT core and of search, then vtebench's scenarios and a file of 1 GiB parsed headless, by the VT core and byalacritty_terminal;lokyr-replay --bench <file>parses a recording alone.just bench-luau: a Luau plugin's activation, a fresh VM's making, its code's compilation and itsactivate, of the template thatsleip newmakes and of a plugin of 2000 lines, in both executions, and its VM's heap.just bench-search: a search of 100 000 lines through the app's service.- A list of the interface:
cargo test --release -p lokyr-app --test list_frame -- --ignored --nocapturetimes the frames of a list that scrolls, of 100 000 rows and of 1 000, in the system's font: its rows' layout, the plugin's render of the items that it asks for, and the paint. On an M-series Mac on 3 November 2026, about 25 µs a frame of either, 140 µs at most past the first, which draws the glyphs.
On Linux, as Lokyr comes to it:
- the memory's PSS from
/proc/<pid>/smaps_rollup, never RSS, which counts shared pages more than once; heaptrack for allocations; DRMfdinfo(drm-memory-*) for the GPU; - the change in
voluntary_ctxt_switchesin/proc/<pid>/statusover 60 s at rest; wp_presentationfor the first frame.
Benchmarks and CI
| Level | Tool | Where | Threshold |
|---|---|---|---|
| Micro: parser per scenario, cell writes, style dedup, reflow, search over 100k and 1M lines, shaping cache | criterion | locally and on the dedicated Mac | report |
Instruction counts of vtebench's scenarios and of text as cat prints it, against those of the commit that a push or a pull request starts from | gungraun (callgrind), just instructions | Linux CI (valgrind does not run on Apple Silicon) | +3% blocks |
| End-to-end: startup, the first frame, latency, idle, memory, output, frames on the CPU, scrolling, the window's motion | ttybench, of the sessions in tools/bench/sessions | each release's A/B on a Mac, against the release before, in sessions of balanced orders | a budget missed, or a cost past the session's spread, is fixed or decided before the release |
| Memory: opening and closing tabs, full scrollback | integration tests | macOS and Linux CI | the budgets above |
| The bundle's and the disk image's sizes | the release's build | each release | told in its notes |
Every release's results are kept in releases.json and shown side by side in the releases' table, with their charts, so trends are visible and not just jumps.
Techniques and the budgets they serve
| Technique | Budget |
|---|---|
| 8-byte cells, deduplicated styles, pages recycled from a pool | Memory, throughput |
| Fast path for printable ASCII, written straight into the cells | Throughput |
| Unicode properties in one table lookup | Throughput |
| Grid lock taken per slice and released fairly | Latency under load |
| Copying only the visible rows that changed | CPU per frame |
| One GPU surface per window, and the cursor's layer, and the blinking text's while it shows; 2 drawables; one kept when occluded | GPU memory |
| Display link running only when there is work; immediate draw after idle | Idle, latency |
| Per-run shaping cache, shared glyph atlas | CPU per frame, memory |
| Luau plugins loaded only when needed; no VM before the first one | Startup, memory |
| A plugin watchdog that steps in only at the deadline, and runs only while a plugin executes | Idle, CPU per frame |
| No async runtime in the app | Memory, startup |
| System allocator; mimalloc only if measurements justify it | Memory |
Comparing with other terminals
Every terminal is compared of ttybench's sessions in tools/bench/sessions/compare, of the same tools as the releases' A/B, and of conditions alike:
- One config: each terminal's config in
tools/bench/sessions/configs/basegives it the same font, font size and window in cells, no ligatures, a cursor that doesn't blink, an opaque window without blur, and no plugins, extensions or shell integration. A terminal that reads no config folder takes them of a profile given at its launch, its own preferences given back after the session. - Features at parity: a feature that some terminals lack, such as smooth scrolling or a blurred window, is measured of the terminals that have it alone, apart, and the others are told skipped. A trackpad's scroll draws as many frames as a terminal moves its text, by rows or at every refresh, so a frame's cost on the CPU and the GPU is measured of a wheel's scroll by lines, a frame each step, alike for every terminal.
- One session: the same machine, on its power adapter, the same display at its rate, every terminal measured within one session, as a session's load and temperature move the figures more than many changes.
- Balanced orders: each step's cycles turn the terminals' order, so that each runs first as often as last, the same pause before each run.
- The Mac left alone, in steps of a few minutes, nothing else moving on screen, the pointer and the keyboard untouched.
- Versions recorded: each record keeps its terminal's version, and each session its machine.
The comparison of 30 November and 1 December 2026, of 1.6.1 and five other terminals, is the first of ttybench alone, and the README's charts are of it. The comparison of 31 October 2026, the comparison of 13 November 2026 and the comparison of 21 and 22 November 2026, of 1.4.0's code, took these conditions with the tools of their day, before ttybench; their figures compare loosely with ttybench's, whose latency, of every phase of the refresh, lies within a refresh of theirs.