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

Can we remove this Reset? #87

Open
yuanjize opened this issue Sep 4, 2024 · 1 comment
Open

Can we remove this Reset? #87

yuanjize opened this issue Sep 4, 2024 · 1 comment

Comments

@yuanjize
Copy link

yuanjize commented Sep 4, 2024

defer gz.Reset(io.Discard)

Reset use many cpu,because it will call memclrNoHeapPointers.

I think just use Reset when we get it from pool will be better, remove Reset(io.Discard)

What do youk think?

@yuanjize
Copy link
Author

yuanjize commented Sep 4, 2024

BenchmarkGzipEncode2/GzipEncode_One_reset
BenchmarkGzipEncode2/GzipEncode_One_reset-16 2425 448301 ns/op 39512 B/op 30 allocs/op
BenchmarkGzipEncode2/GzipEncode_Two_reset
BenchmarkGzipEncode2/GzipEncode_Two_reset-16 2053 541121 ns/op 39637 B/op 30 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