-
Notifications
You must be signed in to change notification settings - Fork 15.5k
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
Merge C# proto3 from csharp-experimental to master #632
Conversation
…, it's pretty slow right now.
Cache a reference to Encoding.UTF8 - the property access is (rather surprisingly) significant. Additionally, when we detect that the string is all ASCII (due to the computed length in bytes being the length in characters), we can perform the encoding very efficiently ourselves.
… a single byte. Aside from anything else, this will be used for all tags for fields 1-15.
This makes repeated fields really awkward at the moment - but when we reimplement RepeatedField<T> to be backed by an array, we can cast the array directly...
Remove ICodedInputStream and ICodedOutputStream, and rewrite CodedInputStream and CodedOutputStream to be specific to the binary format. If we want to support text-based formats, that can be a whole different serialization mechanism.
This mirrors commit 7c86bbb in the pull request to the main protobuf project, but also reduces the size of the buffer created. (There's no point in creating a 1024-byte buffer if we're only skipping 5 bytes...)
…han an equality check.
I wouldn't expect this to affect anything, but it appears to.
This is effectively reimplementing List<T>, but with a few advantages: - We know that an empty repeated field is common, so don't allocate an array until we need to - With direct access to the array, we can easily convert enum values to int without boxing - We can relax the restrictions over what happens if the repeated field is modified while iterating, avoiding so much checking This is somewhat risky, in that reimplementing a building block like this is *always* risky, but hey... (The performance benefits are significant...)
… - files to be killed later.
We'll probably want a lot of the code from the serialization project when we do JSON, but enough of it will change that it's not worth keeping in a broken state for now.
- Make some members internal - Remove a lot of FrameworkPortability that isn't required - Start adding documentation comments - Remove some more group-based members - Not passing in "the last tag read" into Read*Array, g
Proto3 experimental C# fork
First attempt at using profile 259 for Google.Protobuf.
@anandolee @pherl I think we can proceed with this PR now (please see my e-mail). |
…ut_service Expose IsClientStreaming and IsServerStreaming in MethodDescriptor
Remove the C# Freeze API
Remove a few hangers-on from frozenness.
…o use it from the generated code soon. Additionally, change it to return the value passed, and make it generic with a class constraint. A separate method doesn't have the class constraint, for more unusual scenarios.
Throw on null for string/bytes single fields
@anandolee @pherl Freezing has been removed in #654 and #659. Once Travis becomes green, this should be ready to merge. |
Travis is green with the exception of jruby test, which I don't believe is related to this PR, because it was definitely passing before we passing in the past and the most recent PRs couldn't have really caused it. |
All the code in charp experimental are reviewed previously. |
Could you please double check the CLA tag? |
CLA is red because googlebot doesn't correctly handle situations where the autor field of the commit is not the same as the commiter field. That happens when you are merging branch that contains commits from multiple contributors. I've doublechecked that all the commits in this PR are from Jon, Jie or me. |
LGTM |
Merge C# proto3 from csharp-experimental to master
Wohoo! |
Merge C# proto3 from csharp-experimental to master
I think we are now in a good shape to merge C# proto3 back into master. Most of the proto3 functionality has been implemented and we addressed the cleanup we wanted:
C# cleanup tasks:
https://github.com/google/protobuf/issues?q=is%3Aissue+milestone%3A%22C%23+code+cleanup%22+is%3Aclosed