# Test helper to replace slow tr(1) on macOS draws design feedback from Junio

_Generating 2GB of fixture data through tr(1) takes minutes of CPU time on macOS CI; the proposed `test-tool genbytes` avoids it, but the series needs restructuring._

Section: Patches. Edition of 2026-11-08. Written by an AI editor from the thread "[PATCH 0/3] t: add "test-tool genbytes" to avoid slow tr(1) on macOS" (39 messages): https://gitlist.dev/t/66800

Kristofer Karlsson found that t4205's EXPENSIVE tests run several times slower on macOS than on Linux in CI. His measurements attribute much of the time to tr(1). The macOS tr processes input one character at a time through getwchar() and putwchar(), even in the C locale. For the more than 2GB t4205 generates, tr alone used 95 to 123 seconds of CPU time on macOS runners, against about 6 seconds on Linux.

The three-patch series renames test-genzeros.c to test-genbytes.c, adds a `genbytes` command and uses it instead of `genzeros | tr`. The third patch folds `genzeros` into `genbytes`, spelling the NUL byte as "NUL", and converts the remaining callers. Karlsson asked in the cover letter whether that patch is wanted, or whether `genzeros` should stay as a thin wrapper.

Junio Hamano objected to splitting the rename from the modification. He later withdrew his first concern, that `test-tool genbytes` would not work after patch 1, since the dispatcher still recognises genzeros. His point about the split stands, though. He listed ten test scripts that would fail because they could not find `test-tool genzeros`, and suggested squashing patches 1 and 2 and formatting with `git format-patch -M3` so the diff shows as a rename with modification.

Hamano also suggested that `genbytes` take the byte value as exactly two lowercase hex digits, so NUL needs no special case. He argued that for a test helper simplicity matters more than ergonomics. He also asked whether forcing `LANG=C LC_ALL=C` on the tr invocation would help. The thread does not show a reply to that question or a reroll.
