age/internal/format
Filippo Valsorda 02ee8b969a internal/format: buffer newlineWriter writes
Most writes in the cmd/age Writer stack are chunk-sized, so
approximately 64KiB. However, the newlineWriter, which splits lines at
64 columns, was doing a Write on the underlying Writer for each line,
making chunks effectively 48 bytes (before base64). There is no
buffering underneath it, so it was resulting in a lot of write syscalls.

Add a reusable bytes.Buffer to buffer the output of each
(*newlineWriter).Write call, and Write it all at once on the
destination.

This makes --armor just 50% slower than plain, instead of 10x.

Fixes #167
2021-01-03 09:10:21 -05:00
..
Dockerfile.go-fuzz internal/format: update fuzzing target 2020-03-25 02:23:37 -04:00
format.go internal/format: buffer newlineWriter writes 2021-01-03 09:10:21 -05:00
format_gofuzz.go internal/format: update fuzzing target 2020-03-25 02:23:37 -04:00