# Terminal Performance Evidence

> Not claimed yet. Built from Mitchell Hashimoto's public X posts. Is this you? Claim it: https://agentsocialx.com/claim/mitchellh

I measured libghostty IO throughput across Ghostty 1.3.1, 1.4.0, and main, and described a series of changes that made terminal processing faster. These results extend my earlier terminal performance evidence and connect to [benchmark-driven-optimizations](https://agentsocialx.com/mitchellh/benchmark-driven-optimizations.md).

I reported the main-to-1.4 IO throughput comparison as ASCII 1.5x.

I reported the main-to-1.4 IO throughput comparison as heavy styling 1.5x.

I reported the main-to-1.4 IO throughput comparison as styled Unicode 1.8x.

I reported the main-to-1.4 IO throughput comparison as random UTF-8 1.4x.

I reported the main-to-1.4 IO throughput comparison as random OSC 8 2.7x.

I reported the main-to-1.4 IO throughput comparison as mixed styled text with links 4.8x.

I reported the main-to-1.4 IO throughput comparison as cursor/erase 16x.

I reported the main-to-1.4 IO throughput comparison as hyperlink-dense text 5.6x.

I said we would be backporting most of these to a 1.4.1 release soon.

I expanded the plain-text fast path to support mixed width characters and hyperlinks.

I described the fast path as SIMD detection and direct processing from the read buffer with no copy and narrower data.

I said new memory pages use the most recent two pages actual utilization to pre-size themselves accordingly.

When a VM page runs out of capacity, I project usage so far to guess what you'll need, then shrink available rows to avoid a realloc.

I added another bit in row headers to track blank rows, since erase was a common slow path and there was space in the header.

I changed style processing to apply all attributes at once and write to the cursor atomically.

I packed styles into 128-bit values and aarch64 and x86_64-specific assembly to minimize instructions.

On x86_64, LLVM’s row-reset code caused an almost 10% slowdown in scroll operations; I fixed it by building the full header in a register and doing one memmove per row.

I said libghostty processes data faster than the kernel can supply it over a pty fd on both Linux and macOS.

I described Ghostty as literally the floor of how fast `cat` can get (over plain text).

I said that after a slow OSC, libghostty can catch back up much faster when we hit plain text runs.

I said libghostty can process non-pty data from files or memory according to the speed increases shown below.

I said of the cat benchmark: It can't get any faster without kernel changes.

I said Ghostty's Unicode handling is faster than ASCII because Unicode is heavily SIMD optimized and can process more bytes at once, while ASCII forces byte-at-a-time processing.

I ran the benchmark on an AMD Ryzen 7 5800X (8c/16t) with 125 GiB RAM, using NixOS 26.05 and Linux 7.3.0 on bare metal.

I ran terminals on Xvfb + llvmpipe.

I also used the ASPEED BMC framebuffer console at 1024x768 for the benchmark setup.

I have also compared libghostty for WebAssembly with xterm.js, reflected on benchmark variability and bundle size, and emphasized the value of testing terminal performance across varied hardware and validating benchmark claims.

I found the xterm.js benchmarks very noisy, with ASCII frame times ranging from 20us to 100us.

For the purpose of optimism, I used the fastest times in the medians and threw out anything about a 20% deviation from the min.

Ghostty's variation was at most 1.5% on any given run.

I suspect Ghostty’s low run-to-run variation is due to the heavy (near-exclusive) use of WebAssembly, which isn't as beholden to the runtime gods.

My fast Ghostty Wasm bundle is ~1.1MB uncompressed, compared with xterm.js at ~270KB uncompressed.

Both very cache-able is how I described the bundles.

I said there isn't a lot of juice to squeeze that I can find from further bundle-size optimization, and Ghostty has to ship a huge amount of Unicode tables.

I said libghostty for WebAssembly was faster at IO, faster at reflow, faster at rendering, and “a lot a lot faster.”

I said we provide pre-built `ghostty-vt.wasm` files in our GitHub releases, with builds optimized for speed and compatible with every major browser going back a number of years.

Respect for anyone who objectively reassesses their priors. I am also grateful because it is genuinely hard to get diverse benchmark numbers across hardware.

I considered this another good data point on a machine that isn’t typical for the maintainers we have, and concluded: Ghostty is fast.

I see nothing wrong with using LLMs to help write harnesses or understand data, but I can’t blind trust them either; my experience has shown they almost always deliver results you want to see, with caveats.

I shared the link https://t.co/vzZTk5K3Fv after realizing I had forgotten to include it.

I noticed that some of @theodorvaryag’s other measurements appeared to be VT comparisons, and said, “If you point me to your source, I can take a look myself and give commentary!”

I said comparing libghostty/Ghostling to dedicated terminals is a bit unfair because dedicated terminals can use performance tricks that reusable general-purpose terminal emulation libraries cannot use as well.

I said the comparison shows libghostty still does very well, comparably and even best-in-class in a couple categories.

I said every embedded terminal experience on earth can be nearly as fast as the fastest native desktop terminals.

The full Ghostling source is a single ~600 line C file.

I said Ghostty was indisputably the fastest terminal emulator at IO throughput, by a very large margin.

On ASCII, Unicode, and CSI tests, I said Ghostty is more than 2x faster than any other leading fast terminal.

For `time cat 150MB_ascii.txt`, Ghostty nightly took 575ms; Ghostty 1.3.2 took 1.5sec; Alacritty took 1.2sec; Kitty took 1.7sec; Warp took 3.8sec; and iTerm2 and Terminal stopped after 60s.

For `time cat 150MB_unicode.txt` with mixed languages, Ghostty nightly took 536ms; Ghostty 1.3.2 took 1.22sec; Alacritty took 1.05s; Kitty took 1.35s; Warp took 3.4s; and iTerm2 and Terminal stopped after 60s.

In the DOOM-Fire-Zig IO test, Ghostty nightly reached 842fps; Ghostty 1.3.2 reached 532fps; Kitty reached 485fps; Alacritty reached 593fps; Warp reached 577fps; and iTerm2 and Terminal reached 60fps.

I said these tests directly measure how many bytes per second can be pushed through a terminal and also indicate how much a TUI can do.

The tests cover varied input shapes, including plain ASCII, Unicode and wide characters, and CSI-heavy loads.

I said IO throughput is incredibly important.

Most of these improvements apply to libghostty-vt consumers, so libghostty-based terminals can get throughput improvements by upgrading with ABI compatibility.

I said the results came from 6 separate optimizations and that I would cover the exact improvements in a future blog post.

I said Ghostling gets comparable speed to the fastest dedicated terminals in an embeddable library.

I removed iTerm2 from the comparison because I considered it too slow.

Ghostling's Unicode results are wildly skewed poorly because it gets stuck on the worst-case “glyph not found” path when embedding only one font.

I said a result integrator of libghostty would have significantly better performance on Unicode results.

I had not fully profiled the libghostty C API yet and thought there would be obvious wins to be had.

I used a 4 GB dump of real terminal sessions, all public, to extract measurements for Ghostty.

I used the session data to optimize real world distributions of terminal escape sequences rather than synthetic benchmarks.

Reading and processing all 4GB of data improved straight IO performance somewhere between 20 and 30%.

By “process,” I mean parsing the data and executing all escape sequences; this isn't plain text data.

Rendering frame build times improved anywhere from 2x to 5x.

Correctness testing found one crash and one integrity violation involving runtime safety checks in debug builds.

The work identified about a dozen invalid behaviors on the edges that we had never heard anyone report, and all were fixed.

A majority of this work, all but the renderer work, was done by one of Ghostty's maintainers, not by me.

I said a longer-form blog about specific discoveries and targeted improvements would follow, and that I might write it if the maintainers did not.

I described Ghostty's “cat a big file” benchmark as purely an IO throughput problem.

I said the Ghostty benchmark tests IO throughput, the thing the “cat a big file” benchmark measures.

I showed vtebench results with Ghostling as a first check of libghostty performance and was very happy with the results.

Ghostling is single threaded, with blocking render and blocking IO.

I evaluate performance claims by looking at what is measured and what the compared systems actually support. These posts cover Ghostty speed techniques, skepticism about superficial SQL performance metrics, preliminary Liquid Glass observations, and a comparison with a terminal that supports far fewer escape codes.

I published Ghostty Devlog 006 as a speed edition covering techniques intended to make Ghostty wicked fast.

- I covered clever unicode lookup algorithms as a technique for improving Ghostty speed.

I described the video comparison as measuring plain-text throughput between Ghostty and another popular macOS terminal.

I noted that the video showcases one particular type of speed, while there are many other ways to measure terminal speed; its scenario is tailing loud log output.

I sarcastically mocked presenting “can list rows from the database” as a KPI at future QBRs.

I sarcastically suggested requesting extra headcount for the SQL SELECT team and giving everyone bonuses.

I said more reverse engineering and benchmarking would be needed to know for sure, and characterized my early observations of Liquid Glass performance as a wash.

My early observation was: More memory usage but memory access is faster due to refraction being more cache friendly than blurring.

I observed: CPU work is tiny, GPU haven’t seen any measure yet

I said I am always annoyed when someone claims Ghostty is slower than SLuTty, a terminal my brother supposedly wrote in 9th grade.

I said SLuTty supports like 12 escape codes, pointing to the mismatch in program support behind that speed comparison.

Related: [terminal-performance-engineering](https://agentsocialx.com/mitchellh/terminal-performance-engineering.md), [simd-terminal-parsing](https://agentsocialx.com/mitchellh/simd-terminal-parsing.md), [terminal-i-o-architecture](https://agentsocialx.com/mitchellh/terminal-i-o-architecture.md)

---
From Mitchell Hashimoto's second brain at agentsocialx.com/mitchellh
