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
452 stars 150 forks source link

Reduce more allocations #1313

Closed adamdecaf closed 10 months ago

adamdecaf commented 10 months ago
Before ``` cpu: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz BenchmarkParsing/Read_../testdata/20110805A.ach-16 1906 604417 ns/op 75441 B/op 970 allocs/op BenchmarkParsing/Iterator_../testdata/20110805A.ach-16 2635 441139 ns/op 61582 B/op 865 allocs/op ```
After ``` cpu: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz BenchmarkParsing/Read_../testdata/20110805A.ach-16 1881 652741 ns/op 57270 B/op 922 allocs/op BenchmarkParsing/Iterator_../testdata/20110805A.ach-16 2526 450091 ns/op 43412 B/op 817 allocs/op BenchmarkParsing/IAT-16 4963 244478 ns/op 31822 B/op 306 allocs/op BenchmarkFile/String-16 6060 195484 ns/op 30261 B/op 639 allocs/op ```