Files
ghostty/src
Mitchell Hashimoto f6cb8312b3 tinyio: implement a Windows version and use it in the C API
Implements TinyIO for Windows which is used to save binary and runtime
costs. As a reminder, binary costs are saved because `std.Io` uses a
vtable so compilers can't prune any unused functions, so you pay for the
full cost. We can noop unused functions to save. Runtime is saved
because there is less state to carry for unused functionality like
concurrency primitives.

The impl itself is mostly taken from Zig directly. I ran tests on
Windows (arm64) and verified everything works as expected so far!

Binary size measurements before/after:

  | Mode         | Io owner        | ghostty-vt.dll | vs. Threaded |
  |--------------|-----------------|---------------:|-------------:|
  | ReleaseFast  | std.Io.Threaded |      2,209,280 |              |
  | ReleaseFast  | std.Io.failing  |      1,815,552 |     -393,728 |
  | ReleaseFast  | TinyIo          |      1,826,816 |     -382,464 |
  | ReleaseSmall | std.Io.Threaded |      1,541,632 |              |
  | ReleaseSmall | std.Io.failing  |      1,190,912 |     -350,720 |
  | ReleaseSmall | TinyIo          |      1,199,616 |     -342,016 |

The runtime savings are relatively small, but 1KB per terminal ain't nothing:

  | Io owner        | Private, +100 terminals | Private, startup |
  |-----------------|------------------------:|-----------------:|
  | std.Io.Threaded |            +161,845,248 |          782,336 |
  | TinyIo          |            +161,742,848 |          729,088 |
2026-09-09 11:39:47 -07:00
..
2026-08-30 02:34:21 -06:00
2026-03-15 20:58:43 -04:00
2025-10-03 18:52:26 +02:00
2026-07-21 17:19:16 -07:00
2025-11-27 13:37:53 -08:00
2026-08-03 20:10:19 -07:00
2026-07-21 12:35:05 -07:00
2026-07-21 17:19:16 -07:00
2026-07-21 12:35:05 -07:00
2026-07-21 17:19:16 -07:00
2026-07-21 17:19:16 -07:00
2024-08-16 14:35:10 -07:00
2026-07-21 17:19:16 -07:00
2026-03-20 10:37:42 -05:00
2026-07-21 12:35:05 -07:00
2026-08-31 15:07:11 +03:00
2026-07-21 12:35:05 -07:00