Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamline synchronous processing #19

Merged
merged 1 commit into from
Mar 15, 2019
Merged

Conversation

bionoren
Copy link
Contributor

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

…del similar to filepath.Walk so that ledger.ParseLedger doesn't have to incur memory and context switching overhead of channels and goroutines
@howeyc howeyc merged commit 96af6de into howeyc:master Mar 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants