-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Message Reset() should use "clear" to empty m.known & m.ext #1674
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
Comments
You are mentioning Can you explain what the motivation is to use |
Yes, I am using types/dynamicpb. |
I used the MacBook Pro M2 (8 Cores) to test the new Reset2
The result shows that Reset2 can reduce memory allocation Benchmark Result:
Benchmark Code:
|
Thank you for the details. Would you be willing to contribute this change? See https://github.com/protocolbuffers/protobuf-go/blob/master/CONTRIBUTING.md |
change has been submitted for review: |
@aktau Why did you close this issue? The CL is still under review. |
I had been too optimistic when reading |
go1.21 add new builtin function clear() https://tip.golang.org/ref/spec#Clear
Message interface Reset() should use clear to empty all map
The text was updated successfully, but these errors were encountered: