moov-io / ach

ACH implements a reader, writer, and validator for Automated Clearing House (ACH) files. The HTTP server is available in a Docker image and the Go package is available.
https://moov-io.github.io/ach/
Apache License 2.0
447 stars 150 forks source link

all: reduce string allocations #1384

Closed adamdecaf closed 4 months ago

adamdecaf commented 4 months ago

Before:

BenchmarkLargeWEBWrite-16           1886        612136 ns/op       89070 B/op       2659 allocs/op
PASS
ok      github.com/moov-io/ach  3.844s

After:

BenchmarkLargeWEBWrite-16           2000        566199 ns/op       54180 B/op       2041 allocs/op
PASS
ok      github.com/moov-io/ach  3.210s