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

Merge Lookout protobuffy to ruby-protobuf/protobuf v3.6.9 #23

Open
wants to merge 374 commits into
base: master
Choose a base branch
from

Conversation

atinm
Copy link

@atinm atinm commented Sep 16, 2016

This takes Lookouts changes related to http, logging and stats and merges them to v3.6.9 from upstream. It also updates the spec files to not use deprecated interfaces.

Dan Jones and others added 29 commits February 5, 2016 16:31
…n-encode

Speed Up Creates & Updates By Memoizing on encode
…che_tag_encoded_on_load

already loading field on define and should not need to calcualte the …
…ion during required? check; add decoding optimization for enum values in "fetch"
…e_opt

compress decoder to single method; only check nil? once on serializat…
If a required bool field is set to `false`, #define_getter returns its default value(=nil) wrongly because of the following code.

https://github.com/ruby-protobuf/protobuf/blob/master/lib/protobuf/field/base_field.rb#L230
```ruby
def define_getter
---
  @values[field.name] || field.default_value
```

This behavor was introduced by [this commit](ruby-protobuf@05aa775)

This commit fixes the above issue
This is a small change, but let's us keep the optimization in base
field.
Pull bool getter edge case into BoolField class
Changing values in repeated fields does not clear the memoized encoded
value. This means that changes to repated fields after the memoized
encoding has been computed will never be encoded. The pattern works for
other field types because the memoized value is being cleared in the
setter on the message before we call into the field. The field itself is
not involved in clearing the memoized value at all.

Repeated fields are a different story. If we were completely resetting a
repeated field to a new array, the memoized encoding would be correctly
cleared, but because the field array we are pushing into doesn't have any
concept of a message, let alone the specific message instance the field
belongs to, there is no way to clear the memoized encoded message.

We need to remove the memoization until we can find a better approach.

Fixes ruby-protobuf#304.
…oize_on_encode

Remove memoization on encode
Currently, ZMQ assumes that UDP broadcast based service discovery will
fit all needs. This change allows a user to create their own service
directory and plug it into the ZMQ connector.
Allow user defined service directories
@atinm
Copy link
Author

atinm commented Sep 16, 2016

@smathieu Please take a look - as explained in the commit, this is a merge of Lookout work with upstream.

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

Successfully merging this pull request may close these issues.