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

Improve performance #103

Open
alecthomas opened this issue Aug 31, 2020 · 1 comment
Open

Improve performance #103

alecthomas opened this issue Aug 31, 2020 · 1 comment

Comments

@alecthomas
Copy link
Owner

I'm now largely happy with the design and implementation of Participle, so it's time to start thinking about performance.

$ go test -v -bench=. ./
goos: darwin
goarch: amd64
pkg: github.com/alecthomas/participle/_examples/µc
BenchmarkParser
BenchmarkParser-12    	    163	  7393469 ns/op	   674820 B/s	5350378 B/op	  83749 allocs/op
PASS
ok  	github.com/alecthomas/participle/_examples/µc	1.958s

The parser generates a lot of garbage now, and throughput is not great.

@alecthomas
Copy link
Owner Author

The GraphQL parser is 5x faster:

➜ ~/…/_examples/graphql go test -bench=. .
goos: darwin
goarch: amd64
pkg: github.com/alecthomas/participle/_examples/graphql
BenchmarkParser-12    	   2572	   407658 ns/op	  2582288 B/s	 198843 B/op	   3198 allocs/op
PASS
ok  	github.com/alecthomas/participle/_examples/graphql	1.107s

2.5MB/s vs. 670KB/s. Could be the lookahead required in uc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant