h.Back to the desk

Systems programming · open source

Ginti

How far can a familiar command-line tool go when you rethink how it reads?

Ginti is a Go implementation of wc, built around counting lines, words, and bytes. The work moves from a buffered ASCII state machine to concurrent reads, boundary handling, and memory-mapped files.

The published benchmark reports 1.1 GB processed in 0.25 seconds, compared with 2.70 seconds for GNU wc on a Ryzen 5 5600H with NVMe storage. Those numbers describe that workload and machine.

A design decision

Splitting a file across workers means accounting for words that cross chunk boundaries. ReadAt concurrency and boundary-peeking let the implementation divide the work while preserving the count.

The next question

The repository is the place to explore the implementation and its benchmark setup.

Explore the repository ↗