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

consider avoid new, use sync.Pool instead #19

Closed
csyangchen opened this issue Apr 15, 2016 · 1 comment
Closed

consider avoid new, use sync.Pool instead #19

csyangchen opened this issue Apr 15, 2016 · 1 comment

Comments

@csyangchen
Copy link

No description provided.

@csyangchen csyangchen changed the title consider avoid new, use sync.Pool instead consider avoid new, use sync.Pool instead Apr 15, 2016
@csyangchen
Copy link
Author

a simple benchmark:

// master
BenchmarkUaparser 300 3912050 ns/op 108179 B/op 414 allocs/op
// use sync.Pool + caller return *Client
BenchmarkUaparser 20000 70690 ns/op 1611 B/op 5 allocs/op

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

No branches or pull requests

1 participant