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

What's the different between unsafe_marshaler and general marshaler #43

Closed
chenttuuvv opened this issue Mar 25, 2015 · 1 comment
Closed

Comments

@chenttuuvv
Copy link

@awalterschulze I have diff against the pb.go file generated by the protoc compiler, with unsafe option turn on and off, but they look exactly the same. Can you highligh some pro and cons of using unsafe_marshaler.

thanks

@awalterschulze
Copy link
Member

Are you using any of double, float, fixed64, fixed32, sfixed64, sfixed32?
These are the only types that really benefit from unsafe at the moment.
Most of the time they are the same.
I thought it might be important to sometimes be able to not use any unsafe imports such as in the case of appengine, which I don't fully support anyway.
Now I have a fallback for when go does backwards incompatible stuff with unsafe, which they have not promised not to do.
We use unsafe internally, but both are very well tested, in my opinion.
I hope this has answered your question, otherwise feel free to comment again.

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

2 participants