Moved ledger parsing logic into a helper function using a callback model similar to filepath.Walk so that ledger.ParseLedger doesn't have to incur memory and context switching overhead of channels and goroutines.
This change results in a 10x performance improvement and a significant reduction in allocations for the existing benchmark.
Moved ledger parsing logic into a helper function using a callback model similar to filepath.Walk so that ledger.ParseLedger doesn't have to incur memory and context switching overhead of channels and goroutines.
This change results in a 10x performance improvement and a significant reduction in allocations for the existing benchmark.
Before: BenchmarkParseLedger-8 300000 3380 ns/op 4336 B/op 6 allocs/op
After: BenchmarkParseLedger-8 3000000 528 ns/op 4096 B/op 1 allocs/op
Resolves issue #18