From 98fd53750b129e5da86615e05745204b562c1976 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Mon, 24 Dec 2018 12:25:26 -0700 Subject: [PATCH 01/93] remove repeated_map with meta --- lib/protobuf/field/base_field.rb | 109 ++++++++--- .../field/base_field_method_definitions.rb | 179 ++++++++++++++++++ lib/protobuf/field/string_field.rb | 6 +- lib/protobuf/message/serialization.rb | 3 +- 4 files changed, 268 insertions(+), 29 deletions(-) create mode 100644 lib/protobuf/field/base_field_method_definitions.rb diff --git a/lib/protobuf/field/base_field.rb b/lib/protobuf/field/base_field.rb index 197ed9b4..9c29e301 100644 --- a/lib/protobuf/field/base_field.rb +++ b/lib/protobuf/field/base_field.rb @@ -1,6 +1,7 @@ require 'active_support/core_ext/hash/slice' require 'protobuf/field/field_array' require 'protobuf/field/field_hash' +require 'protobuf/field/base_field_method_definitions' module Protobuf module Field @@ -58,6 +59,12 @@ def initialize(message_class, rule, type_class, fully_qualified_name, tag, simpl validate_packed_field if packed? define_accessor(simple_name, fully_qualified_name) if simple_name + define_hash_accessor_for_message! + define_field_p! + define_field_and_present_p! + define_set_field! + define_set_method! + set_default_value! tag_encoded end @@ -81,7 +88,7 @@ def default options[:default] end - def default_value + def set_default_value! @default_value ||= if optional? || required? typed_default_value elsif map? @@ -93,6 +100,46 @@ def default_value end end + def default_value + @default_value + end + + def define_field_p! + if repeated? + ::Protobuf::Field::BaseFieldMethodDefinitions.define_repeated_field_p!(self) + else + ::Protobuf::Field::BaseFieldMethodDefinitions.define_base_field_p!(self) + end + end + + def define_field_and_present_p! + if type_class == ::Protobuf::Field::BoolField # boolean present check + ::Protobuf::Field::BaseFieldMethodDefinitions.define_bool_field_and_present_p!(self) + else + ::Protobuf::Field::BaseFieldMethodDefinitions.define_base_field_and_present_p!(self) + end + end + + def define_hash_accessor_for_message! + if map? + ::Protobuf::Field::BaseFieldMethodDefinitions.define_map_value_from_values!(self) + elsif repeated? + ::Protobuf::Field::BaseFieldMethodDefinitions.define_repeated_value_from_values!(self) + else + ::Protobuf::Field::BaseFieldMethodDefinitions.define_field_value_from_values!(self) + end + end + + def define_set_field! + if map? + ::Protobuf::Field::BaseFieldMethodDefinitions.define_map_set_field!(self) + elsif repeated? + ::Protobuf::Field::BaseFieldMethodDefinitions.define_repeated_set_field!(self) + else + ::Protobuf::Field::BaseFieldMethodDefinitions.define_base_set_field!(self) + end + end + def deprecated? @deprecated end @@ -118,7 +165,7 @@ def message? end def map? - @is_map ||= repeated_message? && type_class.get_option(:map_entry) + @is_map ||= repeated_message? && type_class.get_option!(:map_entry) end def optional? @@ -141,33 +188,45 @@ def required? @required end - # FIXME: need to cleanup (rename) this warthog of a method. - def set(message_instance, bytes) - return message_instance[name] = decode(bytes) unless repeated? - + def define_set_method! if map? - hash = message_instance[name] - entry = decode(bytes) - # decoded value could be nil for an - # enum value that is not recognized - hash[entry.key] = entry.value unless entry.value.nil? - return hash[entry.key] - end - - return message_instance[name] << decode(bytes) unless packed? - - array = message_instance[name] - stream = StringIO.new(bytes) - - if wire_type == ::Protobuf::WireType::VARINT - array << decode(Varint.decode(stream)) until stream.eof? - elsif wire_type == ::Protobuf::WireType::FIXED64 - array << decode(stream.read(8)) until stream.eof? - elsif wire_type == ::Protobuf::WireType::FIXED32 - array << decode(stream.read(4)) until stream.eof? + ::Protobuf::Field::BaseFieldMethodDefinitions.define_map_set_method!(self) + elsif repeated? && packed? + ::Protobuf::Field::BaseFieldMethodDefinitions.define_repeated_packed_set_method!(self) + elsif repeated? + ::Protobuf::Field::BaseFieldMethodDefinitions.define_repeated_not_packed_set_method!(self) + else + ::Protobuf::Field::BaseFieldMethodDefinitions.define_base_set_method!(self) end end +# # FIXME: need to cleanup (rename) this warthog of a method. +# def set(message_instance, bytes) +# return message_instance.set_field(name, decode(bytes), true, self) unless repeated? +# +# if map? +# hash = message_instance[name] +# entry = decode(bytes) +# # decoded value could be nil for an +# # enum value that is not recognized +# hash[entry.key] = entry.value unless entry.value.nil? +# return hash[entry.key] +# end +# +# return message_instance[name] << decode(bytes) unless packed? +# +# array = message_instance[name] +# stream = StringIO.new(bytes) +# +# if wire_type == ::Protobuf::WireType::VARINT +# array << decode(Varint.decode(stream)) until stream.eof? +# elsif wire_type == ::Protobuf::WireType::FIXED64 +# array << decode(stream.read(8)) until stream.eof? +# elsif wire_type == ::Protobuf::WireType::FIXED32 +# array << decode(stream.read(4)) until stream.eof? +# end +# end + def tag_encoded @tag_encoded ||= begin case diff --git a/lib/protobuf/field/base_field_method_definitions.rb b/lib/protobuf/field/base_field_method_definitions.rb new file mode 100644 index 00000000..62a0963d --- /dev/null +++ b/lib/protobuf/field/base_field_method_definitions.rb @@ -0,0 +1,179 @@ +module Protobuf + module Field + class BaseFieldMethodDefinitions + + def self.fully_qualified_name_string(selph) + fully_qualified_name = "" + fully_qualified_name << ":" + fully_qualified_name << '"' if selph.fully_qualified_name.to_s.start_with?(".") + fully_qualified_name << selph.fully_qualified_name.to_s + fully_qualified_name << '"' if selph.fully_qualified_name.to_s.start_with?(".") + fully_qualified_name + end + + def self.define_base_set_method!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def set(message_instance, bytes) + message_instance.set_field(name, decode(bytes), true, self) + end + RUBY + end + + def self.define_map_set_method!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def set(message_instance, bytes) + hash = message_instance[name] + entry = decode(bytes) + # decoded value could be nil for an + # enum value that is not recognized + hash[entry.key] = entry.value unless entry.value.nil? + hash[entry.key] + end + RUBY + end + + def self.define_repeated_not_packed_set_method!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def set(message_instance, bytes) + message_instance[name] << decode(bytes) + end + RUBY + end + + def self.define_repeated_packed_set_method!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def set(message_instance, bytes) + array = message_instance[name] + stream = ::StringIO.new(bytes) + + if wire_type == ::Protobuf::WireType::VARINT + array << decode(Varint.decode(stream)) until stream.eof? + elsif wire_type == ::Protobuf::WireType::FIXED64 + array << decode(stream.read(8)) until stream.eof? + elsif wire_type == ::Protobuf::WireType::FIXED32 + array << decode(stream.read(4)) until stream.eof? + end + end + RUBY + end + + def self.define_map_set_field!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def set_field(values, value, ignore_nil_for_repeated) + unless value.is_a?(Hash) + fail TypeError, <<-TYPE_ERROR + Expected map value + Got '#{value.class}' for map protobuf field #{selph.name} + TYPE_ERROR + end + + if value.empty? + values.delete(#{fully_qualified_name_string(selph)}) + else + values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldHash.new(self) + values[#{fully_qualified_name_string(selph)}].replace(value) + end + end + RUBY + end + + def self.define_repeated_set_field!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def set_field(values, value, ignore_nil_for_repeated) + if value.nil? && ignore_nil_for_repeated + ::Protobuf.deprecator.deprecation_warning("['#{fully_qualified_name_string(selph)}']=nil", "use an empty array instead of nil") + return + end + + unless value.is_a?(Array) + fail TypeError, <<-TYPE_ERROR + Expected repeated value of type '#{selph.type_class}' + Got '\#{value.class}' for repeated protobuf field #{selph.name} + TYPE_ERROR + end + + value = value.compact + + if value.empty? + values.delete(#{fully_qualified_name_string(selph)}) + else + values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldArray.new(self) + values[#{fully_qualified_name_string(selph)}].replace(value) + end + end + RUBY + end + + def self.define_base_set_field!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def set_field(values, value, ignore_nil_for_repeated) + if value.nil? + values.delete(#{fully_qualified_name_string(selph)}) + else + values[#{fully_qualified_name_string(selph)}] = coerce!(value) + end + end + RUBY + end + + def self.define_base_field_and_present_p!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def field_and_present?(values) + values[#{fully_qualified_name_string(selph)}].present? + end + RUBY + end + + def self.define_bool_field_and_present_p!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + BOOL_VALUES = [true, false].freeze unless defined?(BOOL_VALUES) + + def field_and_present?(values) + BOOL_VALUES.include?(values[#{fully_qualified_name_string(selph)}]) + end + RUBY + end + + def self.define_base_field_p!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def field?(values) + values.key?(#{fully_qualified_name_string(selph)}) + end + RUBY + end + + def self.define_repeated_field_p!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def field?(values) + values.key?(#{fully_qualified_name_string(selph)}) && values[#{fully_qualified_name_string(selph)}].present? + end + RUBY + end + + def self.define_field_value_from_values!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def value_from_values(values) + values.fetch(#{fully_qualified_name_string(selph)}) { default_value } + end + RUBY + end + + def self.define_map_value_from_values!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def value_from_values(values) + values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldHash.new(self) + end + RUBY + end + + def self.define_repeated_value_from_values!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def value_from_values(values) + values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldArray.new(self) + end + RUBY + end + + end + end +end diff --git a/lib/protobuf/field/string_field.rb b/lib/protobuf/field/string_field.rb index 43ac0b12..ad0bc553 100644 --- a/lib/protobuf/field/string_field.rb +++ b/lib/protobuf/field/string_field.rb @@ -15,13 +15,13 @@ class StringField < BytesField # def decode(bytes) - bytes_to_decode = bytes.dup + bytes_to_decode = "" + bytes bytes_to_decode.force_encoding(::Protobuf::Field::StringField::ENCODING) bytes_to_decode end def encode(value) - value_to_encode = value.dup + value_to_encode = "" + value # dup is slower value_to_encode.encode!(::Protobuf::Field::StringField::ENCODING, :invalid => :replace, :undef => :replace, :replace => "") value_to_encode.force_encoding(::Protobuf::Field::BytesField::BYTES_ENCODING) @@ -30,7 +30,7 @@ def encode(value) def encode_to_stream(value, stream) if value.encoding != ::Protobuf::Field::StringField::ENCODING - value = value.dup + value = "" + value value.encode!(::Protobuf::Field::StringField::ENCODING, :invalid => :replace, :undef => :replace, :replace => "") end diff --git a/lib/protobuf/message/serialization.rb b/lib/protobuf/message/serialization.rb index de6aa40d..246168de 100644 --- a/lib/protobuf/message/serialization.rb +++ b/lib/protobuf/message/serialization.rb @@ -76,7 +76,8 @@ def encode_to(stream) private def set_field_bytes(tag, bytes) - field = self.class.get_field(tag, true) + #field = self.class.get_field(tag, true) + field = _protobuf_message_field[tag] field.set(self, bytes) if field end From 66df35b0773d725f3ea4f743861a108ab87998c7 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Mon, 24 Dec 2018 12:29:22 -0700 Subject: [PATCH 02/93] more message changes --- lib/protobuf/message.rb | 95 +++++++++++------------------------------ protobuf.gemspec | 1 + 2 files changed, 26 insertions(+), 70 deletions(-) diff --git a/lib/protobuf/message.rb b/lib/protobuf/message.rb index 859864fd..429b8574 100644 --- a/lib/protobuf/message.rb +++ b/lib/protobuf/message.rb @@ -23,6 +23,15 @@ class Message include ::Protobuf::Message::Serialization ::Protobuf::Optionable.inject(self) { ::Google::Protobuf::MessageOptions } + def self.inherited(subclass) + subclass.const_set("PROTOBUF_MESSAGE_GET_FIELD", subclass.field_store) + subclass.class_eval <<~RUBY, __FILE__, __LINE__ + def _protobuf_message_field + PROTOBUF_MESSAGE_GET_FIELD + end + RUBY + end + ## # Class Methods # @@ -103,14 +112,10 @@ def each_field_for_serialization end def field?(name) - field = self.class.get_field(name, true) - return false if field.nil? - if field.repeated? - @values.key?(field.fully_qualified_name) && @values[field.fully_qualified_name].present? - else - @values.key?(field.fully_qualified_name) - end + field = _protobuf_message_field[name] + field && field.field?(@values) end + alias :respond_to_has? field? ::Protobuf.deprecator.define_deprecated_methods(self, :has_field? => :field?) def inspect @@ -121,13 +126,9 @@ def inspect "#<#{self.class} #{attrs}>" end - def respond_to_has?(key) - respond_to?(key) && field?(key) - end - def respond_to_has_and_present?(key) - respond_to_has?(key) && - (self[key].present? || [true, false].include?(self[key])) + field = _protobuf_message_field[key] + field && field.field_and_present?(@values) end # Return a hash-representation of the given fields for this message type. @@ -136,7 +137,7 @@ def to_hash @values.each_key do |field_name| value = self[field_name] - field = self.class.get_field(field_name, true) + field = _protobuf_message_field[field_name] hashed_value = value.respond_to?(:to_hash_value) ? value.to_hash_value : value result[field.name] = hashed_value end @@ -186,11 +187,8 @@ def ==(other) end def [](name) - field = self.class.get_field(name, true) - - return @values[field.fully_qualified_name] ||= ::Protobuf::Field::FieldHash.new(field) if field.map? - return @values[field.fully_qualified_name] ||= ::Protobuf::Field::FieldArray.new(field) if field.repeated? - @values.fetch(field.fully_qualified_name, field.default_value) + field = _protobuf_message_field[name] + field.value_from_values(@values) rescue # not having a field should be the exceptional state raise if field fail ArgumentError, "invalid field name=#{name.inspect}" @@ -200,6 +198,14 @@ def []=(name, value) set_field(name, value, true) end + def set_field(name, value, ignore_nil_for_repeated, field = nil) + if (field || field = _protobuf_message_field[name]) + field.set_field(@values, value, ignore_nil_for_repeated) + else + fail(::Protobuf::FieldNotDefinedError, name) unless ::Protobuf.ignore_unknown_fields? + end + end + ## # Instance Aliases # @@ -222,57 +228,6 @@ def []=(name, value) private - # rubocop:disable Metrics/MethodLength - def set_field(name, value, ignore_nil_for_repeated) - if (field = self.class.get_field(name, true)) - if field.map? - unless value.is_a?(Hash) - fail TypeError, <<-TYPE_ERROR - Expected map value - Got '#{value.class}' for map protobuf field #{field.name} - TYPE_ERROR - end - - if value.empty? - @values.delete(field.fully_qualified_name) - else - @values[field.fully_qualified_name] ||= ::Protobuf::Field::FieldHash.new(field) - @values[field.fully_qualified_name].replace(value) - end - elsif field.repeated? - if value.nil? && ignore_nil_for_repeated - ::Protobuf.deprecator.deprecation_warning("#{self.class}#[#{name}]=nil", "use an empty array instead of nil") - return - end - unless value.is_a?(Array) - fail TypeError, <<-TYPE_ERROR - Expected repeated value of type '#{field.type_class}' - Got '#{value.class}' for repeated protobuf field #{field.name} - TYPE_ERROR - end - - value = value.compact - - if value.empty? - @values.delete(field.fully_qualified_name) - else - @values[field.fully_qualified_name] ||= ::Protobuf::Field::FieldArray.new(field) - @values[field.fully_qualified_name].replace(value) - end - else - if value.nil? # rubocop:disable Style/IfInsideElse - @values.delete(field.fully_qualified_name) - else - @values[field.fully_qualified_name] = field.coerce!(value) - end - end - else - unless ::Protobuf.ignore_unknown_fields? - fail ::Protobuf::FieldNotDefinedError, name - end - end - end - def copy_to(object, method) duplicate = proc do |obj| case obj diff --git a/protobuf.gemspec b/protobuf.gemspec index 624a43eb..48719ed4 100644 --- a/protobuf.gemspec +++ b/protobuf.gemspec @@ -26,6 +26,7 @@ require "protobuf/version" s.add_dependency 'thor' s.add_dependency 'thread_safe' + s.add_development_dependency 'benchmark-ips' s.add_development_dependency 'ffi-rzmq' s.add_development_dependency 'rake', '< 11.0' # Rake 11.0.1 removes the last_comment method which rspec-core (< 3.4.4) uses s.add_development_dependency 'rspec', '>= 3.0' From f3c5599e651a3dabad1c89bcc7de3bc097613d42 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Mon, 24 Dec 2018 12:36:02 -0700 Subject: [PATCH 03/93] add to_hash benchmark --- varint_prof.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/varint_prof.rb b/varint_prof.rb index 7c864dc4..79a2177a 100644 --- a/varint_prof.rb +++ b/varint_prof.rb @@ -51,8 +51,13 @@ printer = JRuby::Profiler::FlameGraphProfilePrinter.new(result) printer.printProfile(STDOUT) else + TO_HASH = ::Test::Resource.new(:name => "derp", :date_created => 123456789) Benchmark.ips do |x| x.config(:time => 10, :warmup => 10) + x.report("to_hash => true java") do + TO_HASH.to_hash + end + x.report("to_proto => true java") do t = ::Test::Resource.new(:name => "derp", :date_created => 123456789) t.status = 3 From 0a07915560c9293bde5277e30dce2be99c4f50a4 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Mon, 24 Dec 2018 12:41:15 -0700 Subject: [PATCH 04/93] remove extra field access in hash methods --- lib/protobuf/message.rb | 2 +- varint_prof.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/protobuf/message.rb b/lib/protobuf/message.rb index 429b8574..c06e36e6 100644 --- a/lib/protobuf/message.rb +++ b/lib/protobuf/message.rb @@ -136,8 +136,8 @@ def to_hash result = {} @values.each_key do |field_name| - value = self[field_name] field = _protobuf_message_field[field_name] + value = field.value_from_values(@values) hashed_value = value.respond_to?(:to_hash_value) ? value.to_hash_value : value result[field.name] = hashed_value end diff --git a/varint_prof.rb b/varint_prof.rb index 79a2177a..056a1d96 100644 --- a/varint_prof.rb +++ b/varint_prof.rb @@ -53,7 +53,7 @@ else TO_HASH = ::Test::Resource.new(:name => "derp", :date_created => 123456789) Benchmark.ips do |x| - x.config(:time => 10, :warmup => 10) + x.config(:time => 20, :warmup => 10) x.report("to_hash => true java") do TO_HASH.to_hash end From 8ef1eecd2b087353a8681e93482c352577548b58 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Mon, 24 Dec 2018 19:55:48 -0700 Subject: [PATCH 05/93] add methods for required field tracking --- .../field/base_field_method_definitions.rb | 168 +++++++++++++----- lib/protobuf/message.rb | 32 ++-- lib/protobuf/message/fields.rb | 5 + 3 files changed, 141 insertions(+), 64 deletions(-) diff --git a/lib/protobuf/field/base_field_method_definitions.rb b/lib/protobuf/field/base_field_method_definitions.rb index 62a0963d..011dfaec 100644 --- a/lib/protobuf/field/base_field_method_definitions.rb +++ b/lib/protobuf/field/base_field_method_definitions.rb @@ -14,7 +14,7 @@ def self.fully_qualified_name_string(selph) def self.define_base_set_method!(selph) selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 def set(message_instance, bytes) - message_instance.set_field(name, decode(bytes), true, self) + message_instance.set_field("#{selph.name}", decode(bytes), true, self) end RUBY end @@ -22,7 +22,7 @@ def set(message_instance, bytes) def self.define_map_set_method!(selph) selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 def set(message_instance, bytes) - hash = message_instance[name] + hash = message_instance["#{selph.name}"] entry = decode(bytes) # decoded value could be nil for an # enum value that is not recognized @@ -35,7 +35,7 @@ def set(message_instance, bytes) def self.define_repeated_not_packed_set_method!(selph) selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 def set(message_instance, bytes) - message_instance[name] << decode(bytes) + message_instance["#{selph.name}"] << decode(bytes) end RUBY end @@ -43,7 +43,7 @@ def set(message_instance, bytes) def self.define_repeated_packed_set_method!(selph) selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 def set(message_instance, bytes) - array = message_instance[name] + array = message_instance["#{selph.name}"] stream = ::StringIO.new(bytes) if wire_type == ::Protobuf::WireType::VARINT @@ -58,62 +58,127 @@ def set(message_instance, bytes) end def self.define_map_set_field!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 - def set_field(values, value, ignore_nil_for_repeated) - unless value.is_a?(Hash) - fail TypeError, <<-TYPE_ERROR - Expected map value - Got '#{value.class}' for map protobuf field #{selph.name} - TYPE_ERROR + if selph.required? + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def set_field(values, value, ignore_nil_for_repeated, message_instance) + unless value.is_a?(Hash) + fail TypeError, <<-TYPE_ERROR + Expected map value + Got '#{value.class}' for map protobuf field #{selph.name} + TYPE_ERROR + end + + if value.empty? + values.delete(#{fully_qualified_name_string(selph)}) + message_instance._protobuf_message_required_field_tags << #{selph.tag} + else + message_instance._protobuf_message_required_field_tags.delete(#{selph.tag}) + values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldHash.new(self) + values[#{fully_qualified_name_string(selph)}].replace(value) + end end + RUBY + else + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def set_field(values, value, ignore_nil_for_repeated, message_instance) + unless value.is_a?(Hash) + fail TypeError, <<-TYPE_ERROR + Expected map value + Got '#{value.class}' for map protobuf field #{selph.name} + TYPE_ERROR + end - if value.empty? - values.delete(#{fully_qualified_name_string(selph)}) - else - values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldHash.new(self) - values[#{fully_qualified_name_string(selph)}].replace(value) + if value.empty? + values.delete(#{fully_qualified_name_string(selph)}) + else + values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldHash.new(self) + values[#{fully_qualified_name_string(selph)}].replace(value) + end end - end - RUBY + RUBY + end end def self.define_repeated_set_field!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 - def set_field(values, value, ignore_nil_for_repeated) - if value.nil? && ignore_nil_for_repeated - ::Protobuf.deprecator.deprecation_warning("['#{fully_qualified_name_string(selph)}']=nil", "use an empty array instead of nil") - return - end + if selph.required? + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def set_field(values, value, ignore_nil_for_repeated, message_instance) + if value.nil? && ignore_nil_for_repeated + ::Protobuf.deprecator.deprecation_warning("['#{fully_qualified_name_string(selph)}']=nil", "use an empty array instead of nil") + return + end + + unless value.is_a?(Array) + fail TypeError, <<-TYPE_ERROR + Expected repeated value of type '#{selph.type_class}' + Got '\#{value.class}' for repeated protobuf field #{selph.name} + TYPE_ERROR + end + + value = value.compact - unless value.is_a?(Array) - fail TypeError, <<-TYPE_ERROR - Expected repeated value of type '#{selph.type_class}' - Got '\#{value.class}' for repeated protobuf field #{selph.name} - TYPE_ERROR + if value.empty? + values.delete(#{fully_qualified_name_string(selph)}) + message_instance._protobuf_message_required_field_tags << #{selph.tag} + else + message_instance._protobuf_message_required_field_tags.delete(#{selph.tag}) + values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldArray.new(self) + values[#{fully_qualified_name_string(selph)}].replace(value) + end end + RUBY + else + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def set_field(values, value, ignore_nil_for_repeated, message_instance) + if value.nil? && ignore_nil_for_repeated + ::Protobuf.deprecator.deprecation_warning("['#{fully_qualified_name_string(selph)}']=nil", "use an empty array instead of nil") + return + end - value = value.compact + unless value.is_a?(Array) + fail TypeError, <<-TYPE_ERROR + Expected repeated value of type '#{selph.type_class}' + Got '\#{value.class}' for repeated protobuf field #{selph.name} + TYPE_ERROR + end - if value.empty? - values.delete(#{fully_qualified_name_string(selph)}) - else - values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldArray.new(self) - values[#{fully_qualified_name_string(selph)}].replace(value) + value = value.compact + + if value.empty? + values.delete(#{fully_qualified_name_string(selph)}) + else + values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldArray.new(self) + values[#{fully_qualified_name_string(selph)}].replace(value) + end end - end - RUBY + RUBY + end end def self.define_base_set_field!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 - def set_field(values, value, ignore_nil_for_repeated) - if value.nil? - values.delete(#{fully_qualified_name_string(selph)}) - else - values[#{fully_qualified_name_string(selph)}] = coerce!(value) + if selph.required? + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def set_field(values, value, ignore_nil_for_repeated, message_instance) + if value.nil? + values.delete(#{fully_qualified_name_string(selph)}) + message_instance._protobuf_message_required_field_tags << #{selph.tag} + else + message_instance._protobuf_message_required_field_tags.delete(#{selph.tag}) + values[#{fully_qualified_name_string(selph)}] = coerce!(value) + end end - end - RUBY + RUBY + else + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def set_field(values, value, ignore_nil_for_repeated, message_instance) + if value.nil? + values.delete(#{fully_qualified_name_string(selph)}) + else + values[#{fully_qualified_name_string(selph)}] = coerce!(value) + end + end + RUBY + end end def self.define_base_field_and_present_p!(selph) @@ -155,6 +220,7 @@ def self.define_field_value_from_values!(selph) def value_from_values(values) values.fetch(#{fully_qualified_name_string(selph)}) { default_value } end + alias :value_from_values_for_serialization value_from_values RUBY end @@ -163,6 +229,17 @@ def self.define_map_value_from_values!(selph) def value_from_values(values) values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldHash.new(self) end + + def value_from_values_for_serialization(values) + value = value_from_values(values) + + array = Array.new(value.size) + value.each do |k, v| + array << type_class.new(:key => k, :value => v) + end + + array + end RUBY end @@ -171,6 +248,7 @@ def self.define_repeated_value_from_values!(selph) def value_from_values(values) values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldArray.new(self) end + alias :value_from_values_for_serialization value_from_values RUBY end diff --git a/lib/protobuf/message.rb b/lib/protobuf/message.rb index c06e36e6..e08706ca 100644 --- a/lib/protobuf/message.rb +++ b/lib/protobuf/message.rb @@ -24,11 +24,16 @@ class Message ::Protobuf::Optionable.inject(self) { ::Google::Protobuf::MessageOptions } def self.inherited(subclass) + subclass.const_set("PROTOBUF_MESSAGE_REQUIRED_FIELD_TAGS", subclass.required_field_tags) subclass.const_set("PROTOBUF_MESSAGE_GET_FIELD", subclass.field_store) subclass.class_eval <<~RUBY, __FILE__, __LINE__ def _protobuf_message_field PROTOBUF_MESSAGE_GET_FIELD end + + def _protobuf_message_required_field_tags + @_protobuf_message_required_field_tags ||= PROTOBUF_MESSAGE_REQUIRED_FIELD_TAGS.dup + end RUBY end @@ -89,25 +94,14 @@ def each_field end def each_field_for_serialization - self.class.all_fields.each do |field| - value = @values[field.fully_qualified_name] - if value.nil? - fail ::Protobuf::SerializationError, "Required field #{self.class.name}##{field.name} does not have a value." if field.required? - next - end - if field.map? - # on-the-wire, maps are represented like an array of entries where - # each entry is a message of two fields, key and value. - array = Array.new(value.size) - i = 0 - value.each do |k, v| - array[i] = field.type_class.new(:key => k, :value => v) - i += 1 - end - value = array - end + _protobuf_message_required_field_tags.each do |tag| + field = _protobuf_message_field[tag] + fail ::Protobuf::SerializationError, "Required field #{self.class.name}##{field.name} does not have a value." + end - yield(field, value) + @values.each_key do |fully_qualified_name| + field = _protobuf_message_field[fully_qualified_name] + yield(field, field.value_from_values_for_serialization(@values)) end end @@ -200,7 +194,7 @@ def []=(name, value) def set_field(name, value, ignore_nil_for_repeated, field = nil) if (field || field = _protobuf_message_field[name]) - field.set_field(@values, value, ignore_nil_for_repeated) + field.set_field(@values, value, ignore_nil_for_repeated, self) else fail(::Protobuf::FieldNotDefinedError, name) unless ::Protobuf.ignore_unknown_fields? end diff --git a/lib/protobuf/message/fields.rb b/lib/protobuf/message/fields.rb index 6f5617a3..268851a8 100644 --- a/lib/protobuf/message/fields.rb +++ b/lib/protobuf/message/fields.rb @@ -41,6 +41,7 @@ def repeated(type_class, name, tag, options = {}) # Define a required field. # def required(type_class, name, tag, options = {}) + required_field_tags << tag define_field(:required, type_class, name, tag, options) end @@ -78,6 +79,10 @@ def extension_ranges @extension_ranges ||= [] end + def required_field_tags + @required_field_tags ||= [] + end + def extension_tag?(tag) tag.respond_to?(:to_i) && get_extension_field(tag).present? end From a71557a433e4a0b8b3b4bbb10dda59d43178d0a5 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Tue, 25 Dec 2018 18:04:03 -0700 Subject: [PATCH 06/93] add encode to stream to to field --- lib/protobuf/encoder.rb | 13 +- lib/protobuf/field/base_field.rb | 15 +- .../field/base_field_method_definitions.rb | 27 + profile.html | 7947 +++++++++++------ 4 files changed, 5315 insertions(+), 2687 deletions(-) diff --git a/lib/protobuf/encoder.rb b/lib/protobuf/encoder.rb index 5591ed4c..33e2d8ad 100644 --- a/lib/protobuf/encoder.rb +++ b/lib/protobuf/encoder.rb @@ -2,18 +2,7 @@ module Protobuf class Encoder def self.encode(message, stream) message.each_field_for_serialization do |field, value| - if field.repeated? - if field.packed? - packed_value = value.map { |val| field.encode(val) }.join - stream << "#{field.tag_encoded}#{::Protobuf::Field::VarintField.encode(packed_value.size)}#{packed_value}" - else - value.each do |val| - field.encode_to_stream(val, stream) - end - end - else - field.encode_to_stream(value, stream) - end + field.encode_to_stream(value, stream) end stream diff --git a/lib/protobuf/field/base_field.rb b/lib/protobuf/field/base_field.rb index d34eb612..74925ccb 100644 --- a/lib/protobuf/field/base_field.rb +++ b/lib/protobuf/field/base_field.rb @@ -66,6 +66,7 @@ def initialize(message_class, rule, type_class, fully_qualified_name, tag, simpl define_field_and_present_p! define_set_field! define_set_method! + define_encode_to_stream! set_default_value! tag_encoded end @@ -106,6 +107,16 @@ def default_value @default_value end + def define_encode_to_stream! + if repeated? && packed? + ::Protobuf::Field::BaseFieldMethodDefinitions.define_repeated_packed_encode_to_stream_method!(self) + elsif repeated? + ::Protobuf::Field::BaseFieldMethodDefinitions.define_repeated_not_packed_encode_to_stream_method!(self) + else + ::Protobuf::Field::BaseFieldMethodDefinitions.define_base_encode_to_stream_method!(self) + end + end + def define_field_p! if repeated? ::Protobuf::Field::BaseFieldMethodDefinitions.define_repeated_field_p!(self) @@ -150,10 +161,6 @@ def encode(_value) fail NotImplementedError, "#{self.class.name}##{__method__}" end - def encode_to_stream(value, stream) - stream << tag_encoded << encode(value) - end - def extension? @extension end diff --git a/lib/protobuf/field/base_field_method_definitions.rb b/lib/protobuf/field/base_field_method_definitions.rb index 011dfaec..d674fdb5 100644 --- a/lib/protobuf/field/base_field_method_definitions.rb +++ b/lib/protobuf/field/base_field_method_definitions.rb @@ -11,6 +11,33 @@ def self.fully_qualified_name_string(selph) fully_qualified_name end + def self.define_base_encode_to_stream_method!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def encode_to_stream(value, stream) + stream << tag_encoded << encode(value) + end + RUBY + end + + def self.define_repeated_not_packed_encode_to_stream_method!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def encode_to_stream(value, stream) + value.each do |val| + stream << tag_encoded << encode(val) + end + end + RUBY + end + + def self.define_repeated_packed_encode_to_stream_method!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def encode_to_stream(value, stream) + packed_value = value.map { |val| encode(val) }.join + stream << "\#{tag_encoded}\#{::Protobuf::Field::VarintField.encode(packed_value.size)}\#{packed_value}" + end + RUBY + end + def self.define_base_set_method!(selph) selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 def set(message_instance, bytes) diff --git a/profile.html b/profile.html index 76e05283..1d9dd45a 100644 --- a/profile.html +++ b/profile.html @@ -52,7 +52,7 @@

Profile Report: main

-

Total time: 23.21

+

Total time: 70.11

@@ -67,1677 +67,2113 @@

Total time: 23.21

- + - + - + - + - + - + - - - - - + + + + + - + - - - - - + + + + + - + - + - - + + - + - - - - + + + + - - - - - - - - - - + - - - - + + + + - - - - - + + + + + - - - - - + + + + + - + + + + + + + + + + - + - - + + - - - - - - - - + + + + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + + - - + - - + + + - + - - - - - + + + + + - + - - - + + + - + - - + - - + + + - + - - - - - + + + + + - - - - - - + + + + + - - - - - + + + + + - - - - - - - + + + + + + + + + + + + + + + + - + - + + + + + + + + + + - - - + + + - + - + - + - + - + - + - - - + + + - + - + + + + + + + + + + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - - - - - - + + + + + + - + - - - - + + + + - + + + + + + + + + + - - - - + + + + - - - - - - + + + + + + - + - - - - + + + + + + + + + + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - - + + + + + - + - + - + - + - + - + - + - + - - - - - + + + + + - + - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + - + - - - - - + + + + + - - + - - - - - + + + + + - + - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - - + - - - - - + + + + + - - - - - - - - + + + + + + + + - + - - - - - + + + + + - - + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - - + + - - + - - - - - + + + + + + - - - - + + + + - - - - - - - + + + + + + + - + - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + - + - - - - - + + + + + - + - + - - - + + + - + - - - - - + + + + + - + + + + + + + + + + - - - - - + + + + + + - - - - - + + + + + - - - - - - - + + + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - - - - - - + - - + + - + - - - - - + + + + + - + - - + + - - + + - + + - - - - - + + + + + - + + - - - - + + + - - - - - - - - + + + + + + + + - + - - - - - + + + + + - - - - - + + + + + - - - - - - - + + + + + + + - + - - - - - + + + + + - + - + + + + + + + + + + - - + + + + + + + + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - + + + + + + + + + + + - - + + - + - - + + - - + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + + + + + + + + + + + + + + + + + + + + - - - + + - - + - - - - - - - - - - - - + + + - + + - - - - - + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - - + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - - + + + + + + + + - + - - - - - + + + + + - + - - - - + + + + - + - - + + - + - - + + - - - - + + + + - + - + - + - + - + + + + + + + + + + - - - + + + - + - + - + - - + - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + + - - - - - + + + + + - - + + + + + + + + + + - - - - - + + + + + + - - - - - + + + + + - - - - - - - + + + + + + + - + - - - - - + + + + + - + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - - - - + + + + + - - - - - + + + + + - + - - + - - - - - - - - - - - - + + + - + - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - - - - - - + + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + + - - + + - - + + - - + + - - - + + - - - - + + + + + - - - + + - + - + - - - + + + - - - - - - + + + + + - - - - - - + + + + + + - + - - - - - + + + + + - + + - - - - - + + + + + - - + + + + + + + + + + - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - + - - - - + + + + + + + + + + + + + - + - - + + - - + + - + - - - - - + + + + + - - - - - - + + + + + + - + - - - - + + + + - + - - - - - + + + + + - - - - - - + + + + + + - + - - + + + + + + + + + + - - + + + - + - + + - - - + + - - + - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + - - + - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - + - - - - - + + + + + - + - - - - - - - - - - - - - - + + + + + - + + - - + - - + + + - - + + + + + + + + + + - - + - - + + + - + - - - - - + + + + + + - - - - + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + - - + + - + - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1746,1135 +2182,3251 @@

Total time: 23.21

- - + + - - + + - - + + + + + + + + + + + - - + + - - + + - - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - - - - - + + + + + + - - - - - + + + + + - - - - - - - + + + + + + + - + - - + - - + + + - + - - - - + + + + - - - - - - - + + + + + + + - + - - - - + + + + - + - - + - - + + + - - - - + + + + + + + + + + + + - - + + + - - - - - + + + + + - - - - - - + + + + + + - + - - - - - + + + + + - + - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - + + + + + + + - + - - - - - + + + + + - - - - + + + + - + - + - + - + - + - + - + - - - + + + - - + + - - - + + + - + - + - - - - - - - - - - - - - + + + + - - - - - + + + + + - - - - - - + + + + + + - + - - - - - + + + + + - + - + - + - + - - + + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - - - - - + + + + + - + - + + - - - + + - - + + + - - - + + - + + - - - - - + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + - - - + + - - + + + - - - + + - + + - - - - - + + + + + + + + + + + + + + - + - + - + - + - - + + - + - + - + - + - + - + - + - - - - - + + + + + - - - - - - + + + + + + - + - + - + - + - - + + - + - + - + - + - - - + + + - + - - + - - + + + + + + + + + + + + + - - + + - - + + - - - - + + + + - - + + - - - - - - - - - - - + - - + + + - - - - + + + - - + + + - - + - - + - - - - - - - - - - - + + + - + - - + + - - + + - - - - + + + + - - + + + + + + + + + + + + - + - + - + - - + + - + - + - + - - - - - + + + + + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + - + - + - - - + + + - - - - - + + + + + - + - + - - - + + + - + - + - + - + - + - + - + - + - + - - - + + + - + - - + - - + + + - - + - - + + + - - + - - - - + + + + + + + + + + + + + + - - - - - + + + + + - + - - + - - + + + - - + - - + + + - + + + + + + + + + + - - + + - - + + - - + + - - + + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - - - - - - - - - - - + - - + + + - - - - - - + + + + + - + - - + - - + + + - - + - - + + + - + + + + + + + + + + - + - - - + + + - - - - - + + + + + - + - + - - - + + + - + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - + - - - + + + - + + + + + + + + + + - - - + + + - + - + - - - + + + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - + + - - - + + - + + - - - + + - + - - - - + + + + - - - - - + + + + + - + - + + + + + + + + + + - - - + + + - + + - - + + - - - - - + + + + + + + + + + + + + - + - - - + + + - - - + + + - + - - - - - - - - - - - - - + + + - + - - + + @@ -2882,65 +5434,94 @@

Total time: 23.21

- - + + + + + + + + + + + - + + + - - - + + + + + + + + + + + - - - + + + - - - + + + + + + + + + + + + + - + - - - + + + - - - - + + + + - + - - + + - - + + @@ -2948,8 +5529,8 @@

Total time: 23.21

- - + + @@ -2958,8 +5539,8 @@

Total time: 23.21

- - + + @@ -2967,46 +5548,46 @@

Total time: 23.21

- - + + - + - - - - - + + + + + - + - - - - + + + + - - - - + + + + - + - - - + + + @@ -3014,1239 +5595,1277 @@

Total time: 23.21

- - + + - + + + + + + + + + - - + + + + - - - - - + + + + + - - - - - + + + + + - + + - + - - - + + + - - - - - + + + + - - + + + + + + + + + + - - + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - + + + + + + + - - + + + + + + + + + + - - - - - + + - - - - - + + + + + + - - - - - - - - + + + + + + - + + + + + + + + + + - - + + + + - - - - + + - - - - - + - - + + - + + + + + + + + + + + + - + + + + - - - + - - - - - - - + + - + + + + + + + + + + + + + - - - + - - - - - + + - + - - - + - - - - + + + + + + + + + + + + + + - - - - - - - + + - - - + + + + + - - + + + + + + + + + + - + + - + + + + + + + + + + + + + + + + - + - + + + - - - + + + + + + + + + - - - + - + - - - - - - - - - - - + + + + + + - - - - - + - - - - - + + + + + + - + - - - - - + + + - - - - - - - - + + + + + - - + + + - - - - + + + + + + - + + - - - - + + + + - - - - - - - - - - - - - - - - + + + - - - - - - + + + - + - - + + + + + + + + - - - - - + + + + - - - - + - - - + + + - - + + + + + - - - - + + + - + + + + - - + + + - - - - - - - - - + - - - + + - + + + + - + + + - - - - - + + - - - + + + + + + + - - - - - + + + + + + + + + + + + + + + - - + + + + + + - - + - - - - - + + + + + + + + + - - - - + + - - - + + - - - + + + + - - - - + + + + + + - - - - + - - - - - - + - - - - - - - - - + + + - + + - + - - - - - - - + - - + - - - - - - + + + + + - - - - - - - + - - + + + - - - + + - - + + + - - - - - + + - + + + + + + - + + - - - + + - - - - - - - - - - - - - + + + + + + + + + + + + - + + + + - - + + - - - - - - + + + + + + + + + + + - + + + + - - - - - + - + + + + + - - + - - - - + - + - - + + - + + - - - - - + + + + + + + + + + + + + - - - - - - + - - - + + - + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + - + + + + + - + + - - + - + + - - - - - - - - + - - - + - + + - + - + + - - - + + + - - + - + + - - + + - - - + + - - + + - - - - - - - - + - - + - + + + @@ -4254,69 +6873,54 @@

Total time: 23.21

- - - + - - + + - + - + - - - - - - - + + - - - - - - - - @@ -4328,59 +6932,61 @@

Total time: 23.21

+ + + + + + - - - - + - + - - + + - - + + - @@ -4392,7 +6998,6 @@

Total time: 23.21

- @@ -4408,12 +7013,13 @@

Total time: 23.21

+ - + @@ -4425,7 +7031,6 @@

Total time: 23.21

- @@ -4434,6 +7039,7 @@

Total time: 23.21

+ @@ -4441,7 +7047,6 @@

Total time: 23.21

- From 6f4327b07e6f8ccbf828bf291e2e74058ff74451 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Tue, 25 Dec 2018 18:43:29 -0700 Subject: [PATCH 07/93] do not define the encode to stream is a field level value is already present --- .../field/base_field_method_definitions.rb | 6 + lib/protobuf/field/string_field.rb | 12 +- profile.html | 6932 ++++++++--------- 3 files changed, 3384 insertions(+), 3566 deletions(-) diff --git a/lib/protobuf/field/base_field_method_definitions.rb b/lib/protobuf/field/base_field_method_definitions.rb index d674fdb5..e39f61f0 100644 --- a/lib/protobuf/field/base_field_method_definitions.rb +++ b/lib/protobuf/field/base_field_method_definitions.rb @@ -12,6 +12,8 @@ def self.fully_qualified_name_string(selph) end def self.define_base_encode_to_stream_method!(selph) + return if selph.respond_to?(:encode_to_stream) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 def encode_to_stream(value, stream) stream << tag_encoded << encode(value) @@ -20,6 +22,8 @@ def encode_to_stream(value, stream) end def self.define_repeated_not_packed_encode_to_stream_method!(selph) + return if selph.respond_to?(:encode_to_stream) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 def encode_to_stream(value, stream) value.each do |val| @@ -30,6 +34,8 @@ def encode_to_stream(value, stream) end def self.define_repeated_packed_encode_to_stream_method!(selph) + return if selph.respond_to?(:encode_to_stream) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 def encode_to_stream(value, stream) packed_value = value.map { |val| encode(val) }.join diff --git a/lib/protobuf/field/string_field.rb b/lib/protobuf/field/string_field.rb index 1248a3aa..fa6f33cf 100644 --- a/lib/protobuf/field/string_field.rb +++ b/lib/protobuf/field/string_field.rb @@ -18,6 +18,14 @@ def acceptable?(val) val.is_a?(String) || val.nil? || val.is_a?(Symbol) end + def coerce!(value) + if value.nil? + nil + else + value.to_s + end + end + def decode(bytes) bytes_to_decode = "" + bytes bytes_to_decode.force_encoding(::Protobuf::Field::StringField::ENCODING) @@ -26,7 +34,9 @@ def decode(bytes) def encode(value) value_to_encode = "" + value # dup is slower - value_to_encode.encode!(::Protobuf::Field::StringField::ENCODING, :invalid => :replace, :undef => :replace, :replace => "") + unless value_to_encode.encoding == ENCODING + value_to_encode.encode!(::Protobuf::Field::StringField::ENCODING, :invalid => :replace, :undef => :replace, :replace => "") + end value_to_encode.force_encoding(::Protobuf::Field::BytesField::BYTES_ENCODING) "#{::Protobuf::Field::VarintField.encode(value_to_encode.size)}#{value_to_encode}" diff --git a/profile.html b/profile.html index 1d9dd45a..0afe829f 100644 --- a/profile.html +++ b/profile.html @@ -52,7 +52,7 @@

Profile Report: main

-

Total time: 70.11

+

Total time: 69.40

%Total
100% 0%23.2170.11 0.0023.2170.11 0 (top)
20.0660.20 0.0020.0660.20 1/1 Benchmark::IPS.ips
0.940.000.942/112Kernel.require2.840.112.731/5Fixnum#times
0.920.040.881/5##times2.630.012.622/115Kernel.require
0.812.57 0.000.816/18772.575/1904 Kernel.require
0.470.060.4117/191.840.191.6524/26 Kernel.load
0.110.000.111/468431Gem::Specification.each_gemspec
0.220.000.2219/4684310.120.060.062/5 Kernel.require
0.280.080.20466834/468431Protobuf::Message#each_field_for_serialization2.840.112.731/5(top)
10.000.199.811/468431Benchmark::IPS::Job#run_warmup60.190.0060.192/5Benchmark::IPS::Job#run
90%0%63.150.1762.985Fixnum#times
10.0540.15 0.0010.051/46843140.151/1 Benchmark::IPS::Job#run_benchmark
90%1%21.030.3120.71468431##each
20.040.0020.041/1Benchmark::IPS::Job#run_warmup
19.730.1619.57217694/217694Benchmark::IPS::Job::Entry#call_times1.130.021.1210000/393326Protobuf::Message::Serialization::ClassMethods.decode_from
1.870.301.57933668/933668Protobuf::Field::BaseField#encode_to_stream1.090.051.0410000/393326Protobuf::Encoder.encode
1.030.300.73466834/466834Protobuf::Field::StringField#encode_to_stream0.350.020.3320000/1182416Class#new
0.540.430.104202197/9808248##[]0.140.040.0910000/393326Test::Resource#status=
0.390.390.13 0.004201506/7002511Protobuf::Field::BaseField#fully_qualified_name0.134/395067Bundler::SpecSet#tsort_each_node
0.270.270.002801004/2801004Protobuf::Field::BaseField#required?0.170.010.161/395067Bundler::LockfileParser#initialize
0.190.19 0.001400502/4201506Protobuf::Field::BaseField#map?0.191/395067Bundler::Source::Path#load_spec_files
0.170.170.24 0.001400502/5602467Protobuf::Field::BaseField#repeated?0.241/395067Gem::Specification.each_gemspec
0.110.110.002801021/2801653##nil?0.700.010.6820/395067Kernel.require
0.920.040.881/5(top)20.041.6718.381/395067Benchmark::IPS::Job#run_warmup
20.050.0020.052/5Benchmark::IPS::Job#run40.150.0240.131/395067Benchmark::IPS::Job#run_benchmark
90%0%21.000.0620.945##times88%2%62.051.8160.24395067Array#each
57.551.9155.641400333/1400333Benchmark::IPS::Job::Entry#call_times
10.050.710.420.291400883/1400883Benchmark::Timing.now
0.19 0.0010.051/1Benchmark::IPS::Job#run_benchmark0.1912/13Gem::Specification.load
10.000.19 0.0010.000.19 1/1Benchmark::IPS::Job#run_warmupBundler::Source::Path#validate_spec
0.410.17 0.010.4110000/466834Protobuf::Message::Serialization::ClassMethods.decode_from0.16160/838Kernel.send
0.310.160.160.001400337/1400337Float#<
0.12 0.010.3010000/466834Protobuf::Encoder.encode0.12118/118TSort.each_strongly_connected_component_from
20.0660.20 0.0020.0660.20 1/1 (top)
86%85% 0%20.0660.20 0.0020.0660.20 1 Benchmark::IPS.ips
20.0560.19 0.0020.0560.19 1/1 Benchmark::IPS::Job#run
20.0560.19 0.0020.0560.19 1/1 Benchmark::IPS.ips
86%85% 0%20.0560.19 0.0020.0560.19 1 Benchmark::IPS::Job#run
20.0560.19 0.0020.0560.19 2/5##timesFixnum#times
19.730.1619.57217694/217694##each57.551.9155.641400333/1400333Array#each
85%0%19.730.1619.5721769482%2%57.551.9155.641400333 Benchmark::IPS::Job::Entry#call_times
19.510.3919.12456834/45741155.102.3252.785714009/5714540 Proc#call
0.540.540.007113788/7900374Fixnum#<
19.510.3919.12456834/45741155.102.3252.785714009/5714540 Benchmark::IPS::Job::Entry#call_times
84%1%19.540.4019.1445741178%3%55.162.3552.815714540 Proc#call
8.540.148.41456834/46683424.192.1822.015330683/5330683Protobuf::Message#to_hash
12.140.2311.91383326/393326 Protobuf::Message::Serialization::ClassMethods.decode_from
6.830.146.69456834/46683410.280.2810.00383326/393326 Protobuf::Encoder.encode
2.400.072.33456834/9350614.340.373.97766652/1182416 Class#new
1.150.111.04456834/4668341.680.381.30383326/393326 Test::Resource#status=
0.120.070.06456834/466834StringIO.new0.100.100.00383326/393326Protobuf::Message#to_proto
10.0540.15 0.0010.0540.15 1/1##timesFixnum#times
43%57% 0%10.0540.15 0.0010.0540.15 1 Benchmark::IPS::Job#run_benchmark
10.050.0010.051/468431##each40.150.0240.131/395067Array#each
10.000.0010.001/1##times10.421.718.70393326/5724010Protobuf::Message#each_field_for_serialization
22.019.3012.715330683/5724010Protobuf::Message#to_hash
43%0%10.000.0010.001Benchmark::IPS::Job#run_warmup46%15%32.4311.0121.415724010Hash#each_key
10.000.199.811/468431##each3.642.920.7110661366/10662885Kernel.respond_to?
0.410.010.4110000/466834##times3.590.343.25393326/393326Protobuf::Field::StringField(singleton)#encode_to_stream
8.540.148.41456834/466834Proc#call
38%0%8.950.148.81466834Protobuf::Message::Serialization::ClassMethods.decode_from2.491.810.685724009/6117335Protobuf::Field::Int64Field(singleton)#value_from_values
8.480.138.36466834/466834Protobuf::Message::Serialization.decode_from2.431.710.725724009/6117335Protobuf::Field::StringField(singleton)#value_from_values
0.330.060.27466834/935061Class#new1.880.301.58393326/393326Protobuf::Field::EnumField(singleton)#encode_to_stream
8.480.138.36466834/466834Protobuf::Message::Serialization::ClassMethods.decode_from1.710.301.40393326/393326Protobuf::Field::Int64Field(singleton)#encode_to_stream
36%0%8.480.138.36466834Protobuf::Message::Serialization.decode_from
1.681.680.0011841344/15386948Hash#[]
8.360.887.47466834/466834Protobuf::Decoder.decode_each_field1.281.280.0010661366/13026447Hash#[]=
8.360.887.47466834/466834Protobuf::Message::Serialization.decode_from1.241.240.0011841344/14201302Test::Resource#_protobuf_message_field
36%3%8.360.887.47466834Protobuf::Decoder.decode_each_field
6.570.456.131400502/1400502Protobuf::Message::Serialization.set_field_bytes
0.520.330.192801004/2801004Protobuf::Varint.decode
0.100.101.131.13 0.001867336/1867336StringIO#eof10661366/10661556Protobuf::Field::BaseField#name
0.310.010.3010000/466834##times0.350.070.28393326/786652Protobuf::Field::EnumField(singleton)#value_from_values
6.830.146.69456834/46683424.192.1822.015330683/5330683 Proc#call
30%0%7.140.156.99466834Protobuf::Encoder.encode34%3%24.192.1822.015330683Protobuf::Message#to_hash
6.990.186.81466834/466834Protobuf::Message#each_field_for_serialization22.019.3012.715330683/5724010Hash#each_key
6.990.186.81466834/466834Protobuf::Encoder.encode20.040.0020.041/1Fixnum#times
30%28% 0%6.990.186.81466834Protobuf::Message#each_field_for_serialization20.040.0020.041Benchmark::IPS::Job#run_warmup
0.280.080.20466834/468431##each20.041.6718.381/395067Array#each
6.570.456.131400502/1400502Protobuf::Decoder.decode_each_field1.130.021.1210000/393326Fixnum#times
12.140.2311.91383326/393326Proc#call
28%1%6.570.456.131400502Protobuf::Message::Serialization.set_field_bytes18%0%13.270.2513.03393326Protobuf::Message::Serialization::ClassMethods.decode_from
5.540.535.011400502/1400502Protobuf::Field::BaseField#set12.260.2811.97393326/393326Protobuf::Message::Serialization.decode_from
0.520.77 0.210.321400502/4201813Protobuf::Message::Fields::ClassMethods.get_field0.56393326/1182416Class#new
1.070.270.80466834/2801004Test::Resource#status=12.260.2811.97393326/393326Protobuf::Message::Serialization::ClassMethods.decode_from
17%0%12.260.2811.97393326Protobuf::Message::Serialization.decode_from
2.020.601.42933668/2801004##each11.971.5210.46393326/393326Protobuf::Decoder.decode_each_field
3.070.872.191400502/2801004Protobuf::Message#[]=11.971.5210.46393326/393326Protobuf::Message::Serialization.decode_from
26%7%6.161.744.422801004Protobuf::Message#set_field17%2%11.971.5210.46393326Protobuf::Decoder.decode_each_field
1.040.440.602801004/4201813Protobuf::Message::Fields::ClassMethods.get_field9.040.808.241179978/1179978Protobuf::Message::Serialization.set_field_bytes
0.810.290.52933668/933668Protobuf::Field::IntegerField#coerce!0.930.570.362359956/2359956Protobuf::Varint.decode
0.75 0.190.56933668/933668Protobuf::Field::EnumField#coerce!
0.370.370.19 0.002801004/4201506Protobuf::Field::BaseField#map?393326/393326StringIO#read
0.330.200.12933668/933668Protobuf::Field::BytesField#coerce!0.160.160.001573304/1573304StringIO#eof
0.310.310.130.13 0.002801004/7002511Protobuf::Field::BaseField#fully_qualified_name1572988/1575615Fixnum#==
0.300.300.002801004/5602467Protobuf::Field::BaseField#repeated?1.090.051.0410000/393326Fixnum#times
10.28 0.280.280.002801004/2805760##[]=10.00383326/393326Proc#call
0.120.120.002801004/4669248Kernel.class
16%0%11.370.3311.04393326Protobuf::Encoder.encode
0.110.110.002801004/4669192Kernel.nil?11.040.4510.59393326/393326Protobuf::Message#each_field_for_serialization
5.540.535.011400502/1400502Protobuf::Message::Serialization.set_field_bytes11.040.4510.59393326/393326Protobuf::Encoder.encode
23%2%5.540.535.011400502Protobuf::Field::BaseField#set15%0%11.040.4510.59393326Protobuf::Message#each_field_for_serialization
3.250.193.071400502/1400502Protobuf::Message#[]=10.421.718.70393326/5724010Hash#each_key
0.92 0.120.120.00393326/1179979Test::Resource#_protobuf_message_required_field_tags
9.04 0.80466834/466834Protobuf::Field::EnumField#decode8.241179978/1179978Protobuf::Decoder.decode_each_field
12%1%9.040.808.241179978Protobuf::Message::Serialization.set_field_bytes
0.280.200.08466834/933668Protobuf::Field::IntegerField#decode3.230.262.97393326/393326Protobuf::Field::EnumField(singleton)#set
0.190.120.08466834/466834Protobuf::Field::StringField#decode2.310.242.07393326/393326Protobuf::Field::Int64Field(singleton)#set
0.180.182.240.271.98393326/393326Protobuf::Field::StringField(singleton)#set
0.260.26 0.001400502/5602467Protobuf::Field::BaseField#repeated?1179978/15386948Hash#[]
0.180.180.200.20 0.001400502/1400502Protobuf::Field::BaseField#name1179978/14201302Test::Resource#_protobuf_message_field
0.230.010.231/935061Bundler::Dsl#to_definition1.140.170.97393326/2359958Protobuf::Field::EnumField(singleton)#set
0.330.060.27466834/935061Protobuf::Message::Serialization::ClassMethods.decode_from1.340.161.18393326/2359958Protobuf::Field::Int64Field(singleton)#set
2.400.072.33456834/935061Proc#call1.390.261.13393326/2359958Test::Resource#status=
1.530.241.29393326/2359958Protobuf::Field::StringField(singleton)#set
2.970.562.41786654/2359958Hash#each
14%11% 1%3.350.253.11935061Class#new8.371.406.972359958Protobuf::Message#set_field
2.690.392.30933668/933668Protobuf::Message#initialize2.430.751.69786653/786653Protobuf::Field::StringField(singleton)#set_field
2.150.511.64786653/786653Protobuf::Field::Int64Field(singleton)#set_field
1.970.521.45786652/786652Protobuf::Field::EnumField(singleton)#set_field
0.230.23 0.000.221/1Bundler::Definition#initialize1179980/15386948Hash#[]
3.25 0.193.071400502/1400502Protobuf::Field::BaseField#set
14%0%3.25 0.193.071400502Protobuf::Message#[]=0.001179980/14201302Test::Resource#_protobuf_message_field
3.070.872.191400502/2801004Protobuf::Message#set_field0.130.060.0735/1182416Kernel.require
2.690.392.30933668/933668Class#new0.230.050.1814/1182416Kernel.eval
0.350.020.3320000/1182416Fixnum#times
0.440.010.43153/1182416Protobuf::Field.build
0.590.010.581/1182416Bundler::Dsl#to_definition
0.770.210.56393326/1182416Protobuf::Message::Serialization::ClassMethods.decode_from
4.340.373.97766652/1182416Proc#call
11%10% 1%2.690.392.30933668Protobuf::Message#initialize7.140.846.301182416Class#new
2.210.192.02933668/933879##each4.730.903.83786653/786653Protobuf::Message#initialize
0.580.010.571/1Bundler::Definition#initialize
0.430.020.42153/153Protobuf::Field::BaseField#initialize
2.21 0.192.02933668/933879Protobuf::Message#initialize0.000.191/1Bundler::LockfileParser#initialize
9%0%2.230.202.03933879##each
0.190.010.1817/17Gem::Specification#initialize
2.020.601.42933668/2801004Protobuf::Message#set_field0.120.120.00393326/393326StringIO#initialize
0.370.030.352/18771.490.071.422/1904 Kernel.load
0.812.57 0.000.816/18772.575/1904 (top)
0.942.62 0.000.94112/18772.62115/1904 Kernel.require
9% 0%2.120.032.0918776.670.076.601904 Kernel.require
0.792.22 0.000.792.22 1/1 Bundler.setup
0.220.700.010.6820/395067Array#each
0.33 0.000.2219/468431##each0.33109/109Protobuf::Message::Fields::ClassMethods.optional
0.110.24 0.000.110.24 1/1 Gem::Specification.load_defaults
1.870.301.57933668/933668##each
8%1%1.870.301.57933668Protobuf::Field::BaseField#encode_to_stream0.190.000.192/7IO.open
0.610.110.49466834/466834Protobuf::Field::EnumField#encode0.140.000.1437/37Protobuf::Message::Fields::ClassMethods.repeated
0.430.250.19466834/933668Protobuf::Field::IntegerField#encode0.130.060.0735/1182416Class#new
0.360.180.181867336/3267838IO::GenericWritable.<<0.120.060.062/5Fixnum#times
0.170.170.00933668/1400655Protobuf::Field::BaseField#tag_encoded4.730.903.83786653/786653Class#new
6%1%4.730.903.83786653Protobuf::Message#initialize
0.520.210.321400502/4201813Protobuf::Message::Serialization.set_field_bytes3.660.702.97786653/786864Hash#each
1.040.440.602801004/4201813Protobuf::Message#set_field3.660.702.97786653/786864Protobuf::Message#initialize
6%2%1.570.650.924201813Protobuf::Message::Fields::ClassMethods.get_field5%1%3.750.753.00786864Hash#each
0.500.500.004201813/4202318Protobuf::Message::Fields::ClassMethods.field_store2.970.562.41786654/2359958Protobuf::Message#set_field
3.642.920.7110661366/10662885Hash#each_key
5%4%3.642.930.7210662885Kernel.respond_to?
0.410.410.720.72 0.004201813/9808248##[]10662776/10662778Kernel.respond_to_missing?
1.150.111.04456834/466834Proc#call3.590.343.25393326/393326Hash#each_key
5% 0%1.200.131.07466834Test::Resource#status=3.590.343.25393326Protobuf::Field::StringField(singleton)#encode_to_stream
1.070.272.54 0.80466834/2801004Protobuf::Message#set_field
0.410.410.004201813/9808248Protobuf::Message::Fields::ClassMethods.get_field1.74393326/393326Protobuf::Field::StringField#encode
0.540.430.104202197/9808248##each
4%4%1.070.940.139808248##[]0.490.200.29786652/2359956IO::GenericWritable.<<
0.110.100.012803132/2803342##default0.230.230.00393326/1180131Protobuf::Field::BaseField#tag_encoded
1.030.300.73466834/466834##each3.230.262.97393326/393326Protobuf::Message::Serialization.set_field_bytes
4%1%1.030.300.73466834Protobuf::Field::StringField#encode_to_stream0%3.230.262.97393326Protobuf::Field::EnumField(singleton)#set
0.300.140.161400502/3267838IO::GenericWritable.<<1.830.251.58393326/393326Protobuf::Field::EnumField#decode
0.150.080.07466834/1400655Protobuf::Field::VarintField.encode1.140.170.97393326/2359958Protobuf::Message#set_field
0.120.120.140.14 0.00466834/1400655Protobuf::Field::BaseField#tag_encoded1179978/15386948Protobuf::Enum.enum_for_tag_integer
0.940.230.23 0.000.942/112(top)1179980/15386948Protobuf::Message#set_field
4%0%0.94
0.260.26 0.000.94112Kernel.require1179978/15386948Protobuf::Message::Serialization.set_field_bytes
0.940.34 0.000.94112/1877Kernel.require0.34261/15386948Set#include?
0.920.120.80466834/466834Protobuf::Field::BaseField#set1.681.680.0011841344/15386948Hash#each_key
3%0%0.920.120.80466834Protobuf::Field::EnumField#decode3%2.722.320.4015386948Hash#[]
0.560.170.39466834/466834Protobuf::Field::EnumField#acceptable?0.330.000.33153/295Bundler::DepProxy#hash
0.240.170.07466834/933668Protobuf::Field::IntegerField#decode2.630.012.622/115(top)
3%0%2.630.012.62115Kernel.require
0.390.220.16466834/933668Protobuf::Field::EnumField#encode2.620.002.62115/1904Kernel.require
0.430.250.19466834/933668Protobuf::Field::BaseField#encode_to_stream2.540.801.74393326/393326Protobuf::Field::StringField(singleton)#encode_to_stream
3%2%0.820.470.35933668Protobuf::Field::IntegerField#encode1%2.540.801.74393326Protobuf::Field::StringField#encode
0.210.120.09933668/14006551.221.060.16393326/393326String#encode!
0.280.160.13393326/1180131 Protobuf::Field::VarintField.encode
0.140.140.100.10 0.00933668/3267838##&393326/786790String#+
0.810.290.52933668/933668Protobuf::Message#set_field2.491.810.685724009/6117335Hash#each_key
3%1%0.810.290.52933668Protobuf::Field::IntegerField#coerce!2%2.491.810.686117335Protobuf::Field::Int64Field(singleton)#value_from_values
0.430.280.15933668/933668Protobuf::Field::IntegerField#acceptable?0.430.005724009/11842646Hash#fetch
0.790.000.791/1Kernel.require2.430.751.69786653/786653Protobuf::Message#set_field
3%0%0.790.000.791Bundler.setup1%2.430.751.69786653Protobuf::Field::StringField(singleton)#set_field
0.430.010.590.380.20786653/786653Protobuf::Field::BytesField#coerce!
0.53 0.421/2Bundler.definition0.11786653/1179979Test::Resource#_protobuf_message_required_field_tags
0.360.270.27 0.000.361/1Bundler::Runtime#setup786653/786836Array#delete
0.290.110.18466834/1400502Protobuf::Field::EnumField#acceptable?0.210.210.00786653/13026447Hash#[]=
0.500.170.33933668/1400502Protobuf::Field::EnumField#coerce!2.431.710.725724009/6117335Hash#each_key
3%1%0.790.280.511400502Protobuf::Enum.fetch2%2.431.710.726117335Protobuf::Field::StringField(singleton)#value_from_values
0.440.280.161400502/1400502Protobuf::Enum.enum_for_tag_integer0.430.430.005724009/11842646Hash#fetch
0.750.190.56933668/933668Protobuf::Message#set_field2.310.242.07393326/393326Protobuf::Message::Serialization.set_field_bytes
3% 0%0.750.190.56933668Protobuf::Field::EnumField#coerce!2.310.242.07393326Protobuf::Field::Int64Field(singleton)#set
0.500.170.33933668/1400502Protobuf::Enum.fetch1.340.161.18393326/2359958Protobuf::Message#set_field
0.310.310.002801004/7002511Protobuf::Message#set_field0.730.430.30393326/786652Protobuf::Field::IntegerField#decode
0.390.390.004201506/7002511##each2.240.271.98393326/393326Protobuf::Message::Serialization.set_field_bytes
3%3%0.700.700.007002511Protobuf::Field::BaseField#fully_qualified_name0%2.240.271.98393326Protobuf::Field::StringField(singleton)#set
0.300.140.161400502/3267838Protobuf::Field::StringField#encode_to_stream1.530.241.29393326/2359958Protobuf::Message#set_field
0.360.180.181867336/3267838Protobuf::Field::BaseField#encode_to_stream
2%1%0.660.310.343267838IO::GenericWritable.<<0.450.280.17393326/393326Protobuf::Field::StringField#decode
0.340.342.22 0.003267838/3267838StringIO#write2.221/1Kernel.require
3%0%2.220.002.221Bundler.setup
0.170.171.18 0.001400502/5602467##each1.181/1Bundler::Runtime#setup
0.180.180.001400502/5602467Protobuf::Field::BaseField#set1.020.011.001/2Bundler.definition
0.300.300.002801004/56024672.150.511.64786653/786653 Protobuf::Message#set_field
2%2%0.650.653%0%2.150.511.64786653Protobuf::Field::Int64Field(singleton)#set_field
1.460.570.88786653/786653Protobuf::Field::IntegerField#coerce!
0.120.12 0.005602467Protobuf::Field::BaseField#repeated?786653/13026447Hash#[]=
0.610.110.49466834/466834Protobuf::Field::BaseField#encode_to_stream1.970.521.45786652/786652Protobuf::Message#set_field
2% 0%0.610.110.49466834Protobuf::Field::EnumField#encode1.970.521.45786652Protobuf::Field::EnumField(singleton)#set_field
0.390.220.16466834/933668Protobuf::Field::IntegerField#encode1.270.330.93786652/786652Protobuf::Field::EnumField#coerce!
0.110.130.130.00786652/13026447Hash#[]=
1.880.301.58393326/393326Hash#each_key
2%0%1.880.301.58393326Protobuf::Field::EnumField(singleton)#encode_to_stream
1.150.240.91393326/393326Protobuf::Field::EnumField#encode
0.290.150.14786652/2359956IO::GenericWritable.<<
0.140.140.00393326/1180131Protobuf::Field::BaseField#tag_encoded
1.840.191.6524/26(top)
2%0%1.840.191.6526Kernel.load
1.49 0.071.422/1904Kernel.require
1.830.251.58393326/393326Protobuf::Field::EnumField(singleton)#set
2%0%1.830.251.58393326Protobuf::Field::EnumField#decode
1.040.310.73393326/393326Protobuf::Field::EnumField#acceptable?
0.540.330.21393326/786652Protobuf::Field::IntegerField#decode
0.14 0.04466834/467102Protobuf::Enum#to_i0.0910000/393326Fixnum#times
1.680.381.30383326/393326Proc#call
2%0%1.810.421.39393326Test::Resource#status=
1.390.261.13393326/2359958Protobuf::Message#set_field
0.120.120.00786653/13026447Protobuf::Field::Int64Field(singleton)#set_field
0.130.130.00786652/13026447Protobuf::Field::EnumField(singleton)#set_field
0.210.210.00786653/13026447Protobuf::Field::StringField(singleton)#set_field
1.281.280.0010661366/13026447Hash#each_key
2%2%1.791.770.0213026447Hash#[]=
1.710.301.40393326/393326Hash#each_key
2%0%1.710.301.40393326Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.860.480.38393326/786652Protobuf::Field::IntegerField#encode
0.380.150.22786652/2359956IO::GenericWritable.<<
0.160.160.00393326/1180131Protobuf::Field::BaseField#tag_encoded
0.19 0.19 0.001400502/4201506##each1179980/14201302Protobuf::Message#set_field
0.370.370.200.20 0.002801004/4201506Protobuf::Message#set_field1179978/14201302Protobuf::Message::Serialization.set_field_bytes
1.241.240.0011841344/14201302Hash#each_key
2% 2%0.560.561.621.62 0.004201506Protobuf::Field::BaseField#map?14201302Test::Resource#_protobuf_message_field
0.560.170.68 0.39466834/466834Protobuf::Field::EnumField#decode0.29393326/786652Protobuf::Field::EnumField#encode
0.860.480.38393326/786652Protobuf::Field::Int64Field(singleton)#encode_to_stream
2%1%1.540.870.67786652Protobuf::Field::IntegerField#encode
0.370.210.16786652/1180131Protobuf::Field::VarintField.encode
0.310.310.00786559/1573117Fixnum#&
1.460.570.88786653/786653Protobuf::Field::Int64Field(singleton)#set_field
2% 0%1.460.570.88786653Protobuf::Field::IntegerField#coerce!
0.710.520.18786653/786653Protobuf::Field::IntegerField#acceptable?
0.560.170.39466834Protobuf::Field::EnumField#acceptable?0.200.37393326/1179987Protobuf::Field::EnumField#acceptable?
0.830.300.53786652/1179987Protobuf::Field::EnumField#coerce!
1%0%1.390.490.901179987Protobuf::Enum.fetch
0.790.530.271179978/1179978Protobuf::Enum.enum_for_tag_integer
0.29 0.110.18466834/1400502Protobuf::Enum.fetch0.110.001179987/2754972Kernel.kind_of?
0.170.010.16160/838Array#each
1.100.001.101/838Bundler::Runtime#requested_specs
1%0%1.280.011.26838Kernel.send
1.100.001.101/1Bundler::Definition#requested_specs
0.110.000.1177/79Bundler::LockfileParser#parse_source
0.540.330.21393326/786652Protobuf::Field::EnumField#decode
0.730.430.30393326/786652Protobuf::Field::Int64Field(singleton)#set
1%1%1.270.760.51786652Protobuf::Field::IntegerField#decode
0.270.190.08786652/786915Numeric#nonzero?
0.250.250.00786558/1573117Fixnum#&
1.270.330.93786652/786652Protobuf::Field::EnumField(singleton)#set_field
1%0%1.270.330.93786652Protobuf::Field::EnumField#coerce!
0.830.300.53786652/1179987Protobuf::Enum.fetch
0.110.110.00786652/1180209Protobuf::Field::BaseField#type_class
1.221.060.16393326/393326Protobuf::Field::StringField#encode
1%1%1.221.060.16393326String#encode!
0.160.160.002359956/2362883Hash#default
1.180.001.181/1Bundler.setup
1%0%1.180.001.181Bundler::Runtime#setup
1.100.001.101/1Bundler::Runtime#requested_specs
0.290.150.14786652/2359956Protobuf::Field::EnumField(singleton)#encode_to_stream
0.380.150.22786652/2359956Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.490.200.29786652/2359956Protobuf::Field::StringField(singleton)#encode_to_stream
1%0%1.160.510.652359956IO::GenericWritable.<<
0.650.650.002359956/2359956StringIO#write
1.150.240.91393326/393326Protobuf::Field::EnumField(singleton)#encode_to_stream
1%0%1.150.240.91393326Protobuf::Field::EnumField#encode
0.680.390.29393326/786652Protobuf::Field::IntegerField#encode
0.230.150.08393326/393594Protobuf::Enum#to_i
1.131.130.0010661366/10661556Hash#each_key
1%1%1.131.130.0010661556Protobuf::Field::BaseField#name
1.100.001.101/1Bundler::Runtime#setup
1%0%1.100.001.101Bundler::Runtime#requested_specs
1.100.001.101/838Kernel.send
1.100.001.101/1Kernel.send
1%0%1.100.001.101Bundler::Definition#requested_specs
1.100.001.101/1Bundler::Definition#specs_for
1.100.001.101/1Bundler::Definition#requested_specs
1%0%1.100.001.101Bundler::Definition#specs_for
1.080.001.081/1Bundler::Definition#specs
1.080.001.081/1Bundler::Definition#specs_for
1%0%1.080.001.081Bundler::Definition#specs
0.570.000.571/1Bundler::Definition#resolve
0.470.000.471/1Bundler::SpecSet#materialize
1.040.310.73393326/393326Protobuf::Field::EnumField#decode
1%0%1.040.310.73393326Protobuf::Field::EnumField#acceptable?
0.560.200.37393326/1179987Protobuf::Enum.fetch
1.020.011.001/2Bundler.setup
1%0%1.020.011.002Bundler.definition
0.820.010.811/1Bundler::Definition.build
0.130.000.131/1Bundler.configure
0.930.570.362359956/2359956Protobuf::Decoder.decode_each_field
1%0%0.930.570.362359956Protobuf::Varint.decode
0.360.360.002359956/2359956ProtobufJavaHelpers::Varinter.read_varint
0.430.430.005724009/11842646Protobuf::Field::StringField(singleton)#value_from_values
0.430.430.005724009/11842646Protobuf::Field::Int64Field(singleton)#value_from_values
1%1%0.920.910.0111842646Hash#fetch
0.820.010.811/1Bundler.definition
1%0%0.820.010.811Bundler::Definition.build
0.790.000.791/1Bundler::Dsl.evaluate
0.790.530.271179978/1179978Protobuf::Enum.fetch
1%0%0.790.530.271179978Protobuf::Enum.enum_for_tag_integer
0.140.140.001179978/15386948Hash#[]
0.130.130.001179978/1180431Array#first
0.790.000.791/1Bundler::Definition.build
1%0%0.790.000.791Bundler::Dsl.evaluate
0.590.000.591/1Bundler::Dsl#to_definition
0.170.000.171/1Bundler::Dsl#eval_gemfile
0.720.720.0010662776/10662778Kernel.respond_to?
1%1%0.720.720.0010662778Kernel.respond_to_missing?
0.710.520.18786653/786653Protobuf::Field::IntegerField#coerce!
1%0%0.710.520.18786653Protobuf::Field::IntegerField#acceptable?
0.100.100.00786653/2754972Kernel.kind_of?
0.710.420.291400883/1400883Array#each
1%0%0.710.420.291400883Benchmark::Timing.now
0.290.290.001400883/1400884Process.clock_gettime
0.280.160.13393326/1180131Protobuf::Field::StringField#encode
0.370.210.16786652/1180131Protobuf::Field::IntegerField#encode
0%0%0.660.370.291180131Protobuf::Field::VarintField.encode
0.290.290.001180131/1180131ProtobufJavaHelpers::Varinter.to_varint
0.650.650.002359956/2359956IO::GenericWritable.<<
0%0%0.650.650.002359956StringIO#write
0.120.120.00393326/1179979Protobuf::Message#each_field_for_serialization
0.530.420.11786653/1179979Protobuf::Field::StringField(singleton)#set_field
0%0%0.640.540.111179979Test::Resource#_protobuf_message_required_field_tags
0.110.110.00786653/787731Kernel.dup
0.540.540.007113788/7900374Benchmark::IPS::Job::Entry#call_times
0%0%0.630.630.007900374Fixnum#<
0.590.000.591/1Bundler::Dsl.evaluate
0%0%0.590.000.591Bundler::Dsl#to_definition
0.590.010.581/1182416Class#new
0.590.380.20786653/786653Protobuf::Field::StringField(singleton)#set_field
0%0%0.590.380.20786653Protobuf::Field::BytesField#coerce!
0.130.130.00786653/796051Module#===
0.580.010.571/1Class#new
0%0%0.580.010.571Bundler::Definition#initialize
0.220.000.221/1Bundler::Definition#converge_paths
0.400.000.401/6Bundler::Definition#resolve
0%0%0.570.000.576Bundler::SpecSet#for
0.570.010.566/6Kernel.loop
0.570.000.571/1Bundler::Definition#specs
0%0%0.570.000.571Bundler::Definition#resolve
0.400.000.401/6Bundler::SpecSet#for
0.160.000.161/1Bundler::Definition#converge_locked_specs
0.570.010.566/6Bundler::SpecSet#for
0%0%0.570.010.566Kernel.loop
0.360.000.35240/240Set#add?
0.190.010.18215/215Bundler::SpecSet#spec_for_dependency
0.250.250.00786558/1573117Protobuf::Field::IntegerField#decode
0.310.310.00786559/1573117Protobuf::Field::IntegerField#encode
0%0%0.550.550.001573117Fixnum#&
0.140.140.00393326/1180131Protobuf::Field::EnumField(singleton)#encode_to_stream
0.160.160.00393326/1180131Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.230.230.00393326/1180131Protobuf::Field::StringField(singleton)#encode_to_stream
0%0%0.550.540.011180131Protobuf::Field::BaseField#tag_encoded
0.140.000.1337/153Protobuf::Message::Fields::ClassMethods.repeated
0.330.010.32109/153Protobuf::Message::Fields::ClassMethods.optional
0%0%0.480.010.47153Protobuf::Message::Fields::ClassMethods.define_field
0.460.000.45153/153Protobuf::Field.build
0.470.000.471/1Bundler::Definition#specs
0%0%0.470.000.471Bundler::SpecSet#materialize
0.340.000.341/223Array#map!
0.460.000.45153/153Protobuf::Message::Fields::ClassMethods.define_field
0%0%0.460.000.45153Protobuf::Field.build
0.440.010.43153/1182416Class#new
0.450.280.17393326/393326Protobuf::Field::StringField(singleton)#set
0%0%0.450.280.17393326Protobuf::Field::StringField#decode
0.130.130.00393326/786790String#+
0.430.020.42153/153Class#new
0%0%0.430.020.42153Protobuf::Field::BaseField#initialize
0.340.000.341/223Bundler::SpecSet#materialize
0%0%0.390.010.39223Array#map!
0.340.000.3439/39Bundler::LazySpecification#__materialize__
0.160.000.161/984Bundler::Dsl#eval_gemfile
0%0%0.390.190.20984BasicObject#instance_eval
0.150.000.151/1Bundler::Dsl#gemspec
0.360.360.002359956/2359956Protobuf::Varint.decode
0%0%0.360.360.002359956ProtobufJavaHelpers::Varinter.read_varint
0.360.000.35240/240Kernel.loop
0%0%0.360.000.35240Set#add?
0.340.000.34240/261Set#include?
0.330.000.33144/1249Bundler::DepProxy#hash
0%0%0.350.000.351249Array#hash
0.320.000.32144/390Gem::Dependency#hash
0.350.070.28393326/786652Hash#each_key
0%0%0.350.070.28786652Protobuf::Field::EnumField(singleton)#value_from_values
0.340.000.34240/261Set#add?
0%0%0.340.000.34261Set#include?
0.340.000.34261/15386948Hash#[]
0.340.000.3439/39Array#map!
0%0%0.340.000.3439Bundler::LazySpecification#__materialize__
0.230.000.2338/38Bundler::Source::Rubygems#specs
0.320.000.32144/390Array#hash
0%0%0.340.010.33390Gem::Dependency#hash
0.320.310.01390/390Gem::Requirement#hash
0.330.000.33153/295Hash#[]
0%0%0.330.000.33295Bundler::DepProxy#hash
0.330.000.33144/1249Array#hash
0.330.000.33109/109Kernel.require
0%0%0.330.000.33109Protobuf::Message::Fields::ClassMethods.optional
0.330.010.32109/153Protobuf::Message::Fields::ClassMethods.define_field
0.320.310.01390/390Gem::Dependency#hash
0%0%0.320.310.01390Gem::Requirement#hash
0.100.100.00786653/2754972Protobuf::Field::IntegerField#acceptable?
0.110.110.001179987/2754972Protobuf::Enum.fetch
0%0%0.310.310.002754972Kernel.kind_of?
0.290.290.001400883/1400884Benchmark::Timing.now
0%0%0.290.290.001400884Process.clock_gettime
0.290.290.001180131/1180131Protobuf::Field::VarintField.encode
0%0%0.290.290.001180131ProtobufJavaHelpers::Varinter.to_varint
0.190.050.1413/14Gem::Specification.load
0%0%0.290.050.2314Kernel.eval
0.230.050.1814/1182416Class#new
0.270.270.00786653/786836Protobuf::Field::StringField(singleton)#set_field
0%0%0.280.280.00786836Array#delete
0.270.190.08786652/786915Protobuf::Field::IntegerField#decode
0%0%0.270.190.08786915Numeric#nonzero?
0.240.000.241/1Kernel.require
0%0%0.240.000.241Gem::Specification.load_defaults
0.240.000.241/1Gem::Specification.each_spec
0.240.000.241/1Gem::Specification.load_defaults
0%0%0.240.000.241Gem::Specification.each_spec
0.240.000.241/1Gem::Specification.each_gemspec
0.240.000.241/1Gem::Specification.each_spec
0%0%0.240.000.241Gem::Specification.each_gemspec
0.240.000.241/395067Array#each
0.210.000.211/2Bundler::Source::Rubygems#installed_specs
0%0%0.240.000.232Bundler::Index.build
0.160.000.161/1Bundler::RubygemsIntegration::MoreFuture#all_specs
0.230.150.08393326/393594Protobuf::Field::EnumField#encode
0%0%0.230.150.08393594Protobuf::Enum#to_i
0.100.100.00393326/786790Protobuf::Field::StringField#encode
0.130.130.00393326/786790Protobuf::Field::StringField#decode
0%0%0.230.230.00786790String#+
0%0%0.230.230.002754943Kernel.nil?
0.220.000.221/142Bundler::Definition#converge_paths
0%0%0.230.000.23142Array#any?
0.220.000.221/1Bundler::Definition#specs_changed?
0.230.000.2338/38Bundler::LazySpecification#__materialize__
0%0%0.230.000.2338Bundler::Source::Rubygems#specs
0.210.000.211/1Bundler::Source::Rubygems#installed_specs
0.100.000.101/630Bundler::Dsl#gemspec
0%0%0.220.040.18630Array#map
0.100.000.101/2Bundler.load_gemspec
0%0%0.220.040.18287Array#select
0.220.000.221/1Bundler::Definition#initialize
0%0%0.220.000.221Bundler::Definition#converge_paths
0.220.000.221/142Array#any?
0.220.000.221/1Array#any?
0%0%0.220.000.221Bundler::Definition#specs_changed?
0.240.170.07466834/933668Protobuf::Field::EnumField#decode0.210.000.211/1Bundler::Definition#specs_for_source_changed?
0.280.200.08466834/933668Protobuf::Field::BaseField#set0.210.000.211/1Bundler::Definition#specs_changed?
2%1%0.530.380.15933668Protobuf::Field::IntegerField#decode0%0%0.210.000.211Bundler::Definition#specs_for_source_changed?
0.110.110.20 0.00933668/3267838##&0.201/2Bundler::Source::Path#specs
0.520.33 0.192801004/2801004Protobuf::Decoder.decode_each_field0.000.1912/13Array#each
2%1%0.520.330.192801004Protobuf::Varint.decode0%0%0.210.010.2013Gem::Specification.load
0.190.190.002801004/2801004ProtobufJavaHelpers::Varinter.read_varint0.050.1413/14Kernel.eval
0.500.500.21 0.004201813/4202318Protobuf::Message::Fields::ClassMethods.get_field0.211/1Bundler::Source::Rubygems#specs
2%2%0.510.510%0%0.210.000.211Bundler::Source::Rubygems#installed_specs
0.21 0.004202318Protobuf::Message::Fields::ClassMethods.field_store0.211/2Bundler::Index.build
0.470.060.4117/19(top)0.200.000.201/2Bundler::Definition#specs_for_source_changed?
2% 0%0.470.060.4119Kernel.load0%0.200.000.202Bundler::Source::Path#specs
0.370.030.352/1877Kernel.require0.200.000.202/2Bundler::Source::Path#local_specs
0.440.28 0.161400502/1400502Protobuf::Enum.fetch
1%1%0.440.28 0.161400502Protobuf::Enum.enum_for_tag_integer
0.430.280.15933668/933668Protobuf::Field::IntegerField#coerce!0.002359956/2362883String#encode!
1%1%0.430.280.15933668Protobuf::Field::IntegerField#acceptable?0%0%0.200.160.042362883Hash#default
0.430.010.421/2Bundler.setup0.200.000.202/2Bundler::Source::Path#specs
1% 0%0.430.010.420%0.200.000.20 2Bundler.definitionBundler::Source::Path#local_specs
0.340.20 0.000.340.20 1/1Bundler::Definition.buildBundler::Source::Path#load_spec_files
0.330.20 0.000.331/869Bundler::Runtime#requested_specs0.201/1Bundler::Source::Path#local_specs
1% 0%0.410%0.20 0.000.41869Kernel.send0.201Bundler::Source::Path#load_spec_files
0.330.19 0.000.331/1Bundler::Definition#requested_specs
0.150.080.07466834/1400655Protobuf::Field::StringField#encode_to_stream0.191/395067Array#each
0.210.120.09933668/1400655Protobuf::Field::IntegerField#encode0.190.000.192/7Kernel.require
1% 0%0.360.200.161400655Protobuf::Field::VarintField.encode0%0.190.000.197IO.open
0.160.160.001400655/1400655ProtobufJavaHelpers::Varinter.to_varint0.180.080.112/2IO#each_line
0.360.19 0.000.360.19 1/1Bundler.setupArray#each
1% 0%0.360%0.19 0.000.360.19 1Bundler::Runtime#setupBundler::Source::Path#validate_spec
0.330.19 0.000.330.19 1/1Bundler::Runtime#requested_specs
0.340.340.003267838/3267838IO::GenericWritable.<<
1%1%0.340.340.003267838StringIO#writeBundler::RubygemsIntegration#validate
0.340.19 0.000.340.19 1/1Bundler.definitionBundler::Source::Path#validate_spec
1% 0%0.340%0.19 0.000.340.19 1Bundler::Definition.buildBundler::RubygemsIntegration#validate
0.330.18 0.000.330.18 1/1Bundler::Dsl.evaluateBundler::UI::Silent#silence
0.330.19 0.000.330.19 1/1Bundler::Runtime#setupClass#new
1% 0%0.330%0.19 0.000.330.19 1Bundler::Runtime#requested_specsBundler::LockfileParser#initialize
0.330.000.331/869Kernel.send0.170.010.161/395067Array#each
0.330.190.19 0.000.331/1Kernel.send393326/393326Protobuf::Decoder.decode_each_field
1% 0%0.330%0.190.19 0.000.331Bundler::Definition#requested_specs393326StringIO#read
0.330.000.331/1Bundler::Definition#specs_for0.190.010.18215/215Kernel.loop
0%0%0.190.010.18215Bundler::SpecSet#spec_for_dependency
0.330.190.010.1817/17Class#new
0%0%0.190.010.1817Gem::Specification#initialize
0.110.11 0.000.331/1Bundler::Definition#requested_specs786652/1180209Protobuf::Field::EnumField#coerce!
1% 0%0.330%0.190.19 0.000.331Bundler::Definition#specs_for1180209Protobuf::Field::BaseField#type_class
0.320.000.321/1Bundler::Definition#specs0.180.080.112/2IO.open
0%0%0.180.080.112IO#each_line
0.330.18 0.000.330.18 1/1Bundler::Definition.buildBundler::RubygemsIntegration#validate
1% 0%0.330%0.18 0.000.330.18 1Bundler::Dsl.evaluateBundler::UI::Silent#silence
0.230.18 0.000.230.18 1/1Bundler::Dsl#to_definitionGem::Specification#validate
0.330.200.12933668/933668Protobuf::Message#set_field0.180.000.181/1Bundler::UI::Silent#silence
1% 0%0.330.200.12933668Protobuf::Field::BytesField#coerce!0%0.180.000.181Gem::Specification#validate
0.320.17 0.000.320.17 1/1Bundler::Definition#specs_forBundler::Dsl.evaluate
1% 0%0.320%0.17 0.000.320.17 1Bundler::Definition#specsBundler::Dsl#eval_gemfile
0.220.16 0.000.221/1Bundler::SpecSet#materialize0.161/984BasicObject#instance_eval
0.110.110.16 0.00933668/3267838Protobuf::Field::IntegerField#decode0.161/1Bundler::Definition#resolve
0%0%0.160.000.161Bundler::Definition#converge_locked_specs
0.140.140.160.16 0.00933668/3267838Protobuf::Field::IntegerField#encode1573304/1573304Protobuf::Decoder.decode_each_field
1%1%0.310.310%0%0.160.16 0.003267838##&1573304StringIO#eof
0.120.120.00466834/1400655Protobuf::Field::StringField#encode_to_stream
0.170.170.16 0.00933668/1400655Protobuf::Field::BaseField#encode_to_stream0.161/1Bundler::Index.build
1%1%0.300.300%0%0.16 0.001400655Protobuf::Field::BaseField#tag_encoded0.161Bundler::RubygemsIntegration::MoreFuture#all_specs
0.280.280.15 0.002801004/2805760Protobuf::Message#set_field
1%1%0.290.280.012805760##[]=0.151/1Gem::Specification.stubs
0.270.270.160.16 0.002801004/2801004##each1400337/1400337Array#each
1%1%0.270.270%0%0.160.16 0.002801004Protobuf::Field::BaseField#required?1400337Float#<
0%0%0.160.000.159Bundler::SpecSet#each
0.230.15 0.000.230.15 1/1Bundler::Dsl.evaluateBasicObject#instance_eval
1% 0%0.230%0.15 0.000.230.15 1Bundler::Dsl#to_definitionBundler::Dsl#gemspec
0.230.010.231/935061Class#new0.100.000.101/630Array#map
0.230.15 0.000.220.15 1/1Class#newBundler::RubygemsIntegration::MoreFuture#all_specs
0% 0%0.230.15 0.000.220.15 1Bundler::Definition#initializeGem::Specification.stubs
0%0%0.140.000.1410Bundler::SpecSet#sorted
0.130.000.134/4TSort.tsort
0.180.14 0.000.181/389Bundler::SpecSet#materialize0.1437/37Kernel.require
0% 0%0.220.020.20389##map!0.140.000.1437Protobuf::Message::Fields::ClassMethods.repeated
0.180.14 0.000.1838/38Bundler::LazySpecification#__materialize__0.1337/153Protobuf::Message::Fields::ClassMethods.define_field
0.220.13 0.000.220.13 1/1Bundler::Definition#specsBundler.definition
0% 0%0.220.13 0.000.220.13 1Bundler::SpecSet#materializeBundler.configure
0.180.13 0.000.181/389##map!0.131/1Bundler.configure_gem_home_and_path
0.120.120.13 0.002801004/4669248Protobuf::Message#set_field0.131/1Bundler.configure
0% 0%0.200.200.13 0.004669248Kernel.class0.131Bundler.configure_gem_home_and_path
0.19 0.120.08466834/466834Protobuf::Field::BaseField#set0.000.121/1Bundler.configure_gem_path
0.130.130.001572988/1575615Protobuf::Decoder.decode_each_field
0% 0%0.190.120.08466834Protobuf::Field::StringField#decode0.130.130.001575615Fixnum#==
0.190.190.13 0.002801004/2801004Protobuf::Varint.decode0.134/4Bundler::SpecSet#sorted
0% 0%0.190.190.13 0.002801004ProtobufJavaHelpers::Varinter.read_varint0.134TSort.tsort
0.130.000.134/4TSort.tsort
0.110.110.130.13 0.002801004/4669192Protobuf::Message#set_field786653/796051Protobuf::Field::BytesField#coerce!
0% 0%0.190.190.130.13 0.004669192Kernel.nil?796051Module#===
0.180.13 0.000.1838/38##map!0.134/4TSort.tsort
0% 0%0.180.13 0.000.1838Bundler::LazySpecification#__materialize__0.134TSort.tsort
0.150.13 0.000.1537/37Bundler::Source::Rubygems#specs0.134/4Enumerable#to_a
0.180.180.001400502/1400502Protobuf::Field::BaseField#set
0%0%0.180.180.11 0.001400502Protobuf::Field::BaseField#name0.1050/193Bundler::Index.sort_specs
0% 0%0.180.180.003269205Kernel.kind_of?0.130.010.12193Enumerable#sort_by
0.160.160.13 0.001400655/1400655Protobuf::Field::VarintField.encode0.134/8Enumerator#each
0% 0%0.160.160.13 0.001400655ProtobufJavaHelpers::Varinter.to_varint0.138TSort.tsort_each
0.130.000.134/4TSort.each_strongly_connected_component
0.120.13 0.000.123/285Gem::Specification.gemspec_stubs_in0.134/8Enumerable#to_a
0% 0%0.160.020.14285##select0.130.000.138Enumerator#each
0.120.13 0.000.1267/67Gem::StubSpecification#valid?0.134/8TSort.tsort_each
0.150.13 0.000.151/2Bundler::Source::Rubygems#installed_specs0.134/4TSort.tsort
0% 0%0.160.13 0.000.152Bundler::Index.build0.134Enumerable#to_a
0.140.13 0.000.141/1Bundler::RubygemsIntegration::MoreFuture#all_specs0.134/8Enumerator#each
0.150.13 0.000.1537/37Bundler::LazySpecification#__materialize__0.134/4TSort.tsort_each
0% 0%0.150.13 0.000.1537Bundler::Source::Rubygems#specs0.134TSort.each_strongly_connected_component
0.150.13 0.000.151/1Bundler::Source::Rubygems#installed_specs0.134/122Method#call
0.150.13 0.000.151/1Bundler::Source::Rubygems#specs0.134/122TSort.each_strongly_connected_component
0% 0%0.150.130.000.13122Method#call
0.13 0.000.151Bundler::Source::Rubygems#installed_specs0.134/4Bundler::SpecSet#tsort_each_node
0.150.11 0.000.151/2Bundler::Index.build0.11118/118Bundler::SpecSet#tsort_each_child
0.140.13 0.000.141/1Bundler::Index.build0.134/4Method#call
0% 0%0.140.13 0.000.141Bundler::RubygemsIntegration::MoreFuture#all_specs0.134Bundler::SpecSet#tsort_each_node
0.140.13 0.000.141/1Gem::Specification.stubs0.134/395067Array#each
0.140.130.13 0.000.141/1Bundler::RubygemsIntegration::MoreFuture#all_specs1179978/1180431Protobuf::Enum.enum_for_tag_integer
0% 0%0.140.130.13 0.000.141Gem::Specification.stubs1180431Array#first
0.120.070.06456834/466834Proc#call0.010.12118/118Array#each
0% 0%0.130.070.06466834StringIO.new0.120.010.12118TSort.each_strongly_connected_component_from
0% 0%0.130.120.010.12336Bundler::SpecSet#lookup
0.11 0.000.133Gem::Specification.gemspec_stubs_in0.108/50Bundler::Index.sort_specs
0.12 0.00 0.123/285##select1/1Bundler.configure_gem_home_and_path
0% 0% 0.120.030.0960Kernel.eval0.000.121Bundler.configure_gem_path
0.120.000.121/1Bundler.use_system_gems?
0.12 0.000.1167/1199Gem::StubSpecification#valid?0.121/1Bundler.configure_gem_path
0% 0% 0.12 0.000.111199Gem::StubSpecification#data0.121Bundler.use_system_gems?
0.110.010.1167/67Kernel.open
0%0%0.12 0.12 0.001400529Protobuf::Field::BaseField#type_class0.121/2Bundler.configured_bundle_path
0.12 0.00 0.1267/67##select1/2Bundler.use_system_gems?
0% 0.12 0.00 0.1267Gem::StubSpecification#valid?2Bundler.configured_bundle_path
0.100.010.091/218Bundler.settings
0.120.12 0.000.1167/1199Gem::StubSpecification#data393326/393326Class#new
0%0%0.120.120.00393326StringIO#initialize
0.110.01 0.1167/67Gem::StubSpecification#data0.00786653/787731Test::Resource#_protobuf_message_required_field_tags
0% 0% 0.110.01 0.1167Kernel.open0.00787731Kernel.dup
0%0%0.110.080.03583Module#module_eval
0.11 0.10 0.012803132/2803342##[]0.091/218Bundler.configured_bundle_path
0% 0% 0.110.100.012803342##default0.020.09218Bundler.settings
0.110.110.100.10 0.002801021/2801653##each383326/393326Proc#call
0% 0.11 0.11 0.002801653##nil?393326Protobuf::Message#to_proto
0.11 0.00 0.111/1Kernel.require77/79Kernel.send
0% 0.11 0.00 0.111Gem::Specification.load_defaults79Bundler::LockfileParser#parse_source
0.110.000.111/1Gem::Specification.each_spec0.100.020.0873/73Bundler::LockfileParser#parse_spec
0.110.070.04466834/467102Protobuf::Field::EnumField#encode0.000.11118/118Method#call
0% 0% 0.110.070.04467102Protobuf::Enum#to_i0.000.11118Bundler::SpecSet#tsort_each_child
0.11 0.000.111/1Gem::Specification.load_defaults0.108/50Bundler::SpecSet#lookup
0% 0.11 0.00 0.111Gem::Specification.each_spec50Bundler::Index.sort_specs
0.11 0.000.1050/193Enumerable#sort_by
0%0% 0.111/1Gem::Specification.each_gemspec0.110.00786652String#force_encoding
0.110.000.111/1Gem::Specification.each_spec0.100.020.0873/73Bundler::LockfileParser#parse_source
0% 0%0.110.000.111Gem::Specification.each_gemspec0.100.020.0873Bundler::LockfileParser#parse_spec
0.110.10 0.000.111/468431##each0.101/2Array#map
0% 0% 0.100.070.04467605BasicObject#!=0.000.102Bundler.load_gemspec
0.100.000.101/1Bundler.load_gemspec_uncached
0.10 0.001867336/1867336Protobuf::Decoder.decode_each_field0.101/1Bundler.load_gemspec
0% 0% 0.100.10 0.001867336StringIO#eof
0.101Bundler.load_gemspec_uncached
@@ -67,165 +67,156 @@

Total time: 70.11

- + - + - + - + - + - + - - - - - - - - - - - - + + + - + - + - + - + - + + + + + + + + + + - + - + + - - - - - - - - - - - + - + - + - - - + + + - + - + - + - + - + - + - + - - - - + + + + - + - - - - + + + + - + - + - - + + - + - - - - + + + + - + - - - - + + + + - - - - + + + + @@ -234,82 +225,82 @@

Total time: 70.11

- + - + - - + + - - - - + + + + - - - - + + + + - + - - + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - + - + - + @@ -318,821 +309,821 @@

Total time: 70.11

- + - - - - + + + + - + - - + - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - + + - + - + - - + + - + - + - + - + - + - + - + - + - - + + - + - - - - + + + + - - - - + + + + - - - - - - + + + + + + - + - - - - + + + + - + - - - - - + + + + + - + - - - - + + + + - + - - - - - + + + + + - + - - - - + + + + - + - - - - + + + + - + - - + + - + - + - - + + - - + + - + - - + + - + - + - - + + - - + + - + - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - + - + - + - + - - - - + + + + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - + + - + - + - - + + - + - + - + - + - - + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - + + - + - + - - - - + + + + - + - - - - + + + + - + - + - - + + - + - - - - + + + + - + - + - - + + - + - - + + - + - + - - + + - + - + - - + + - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - + + - + - + - + - + - - + + - + - - + + - + - - + + - + - - + + @@ -1140,165 +1131,165 @@

Total time: 70.11

- - + + - - - - + + + + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - + - + - + - + - - - - - - - - - - + - - + + - + - - + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + + + - + - + - + - + - + - + - + @@ -1307,1319 +1298,1236 @@

Total time: 70.11

- - - - - - - - - - + - + - - + + - + - - - - + + + + + + + + + + + + + - + - - - - + + + + - - - - + + + + - + - + - - + + - + + + + + + + + + + - + - - + + - + - - + + - + - - - - + + + + - + - - - - + + + + - - - - - + + + + + - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - + - - + + - + - - - - + + + + - + - + - - + + - - - - - - - - - - - - - - + + + + + - - - - - - - - + + + + + + + + - + - + + - - - + + + - - - - + + + + - - - - - - + + + + + + - + - + + - - - + + - + - - - + + + - - - + + + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - + - - + + - - + + - - - - - + + + + + + + + + + + + + - - - - - - + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + - + - - - - + + + + - - - - + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - + + - + - + - - + + - + - + - - - - + + + + - - - - - - + + + + + + - + - - - - - + + + + + - - + - - - - - - - - - - + - - - + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - + - - + + - + - - + + - + - - - - + + + + - + - - - - + + + + - + - + - + - + - + - + - + - + - + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - + + - + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - + + - + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - + + + + - + - - - + + + - + - - - - + + + + - - - - - - - - - - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + - + - - + + - - + + - - - - - - - - - - - + + - - + + - - + + - + - - - - - + + + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - + + - + - - - - - + + + + + - - - - - + + + + + - + + + + + + + + + + - - - - - + + + + + - - - - - + + + + + - - + + - - - - - + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - + + + + + + - + - - - - - + + + + + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - - + + + + + - - - - - + + + + + - - - - - - - - + + + + + + + + - + - - - - - + + + + + + + + + + + + + + - + + - - + + - - + + + + + + + + + + + - + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + - + - - - + + + - + - - - - + + + + - + - - + + - - - - + + + + - + - - + + - + - + - - + + - + - - - - + + + + - - - - + + + + - + - + - - + + - + - - + + - + - - - - - + + + + + - - - - - - - - - - - - - - - + + + + + + - - + - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - + - - - - + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - + - - + + - + - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - + - - + - - + + + - - - + + - - + + + - + + + + + + + + + + @@ -2638,7 +2546,7 @@

Total time: 70.11

- + @@ -2666,114 +2574,151 @@

Total time: 70.11

- + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - - - + + + - + - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -2782,170 +2727,179 @@

Total time: 70.11

- + - + - - + + - + - + - + - + - - + + - + - - + + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - + - + - + - + - - - - - + + + + + + + + + + + + + + - - - - + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + - + - + - + - + - + - + @@ -2954,201 +2908,192 @@

Total time: 70.11

- + - + - + - + - - - - + + + + - - + + + + + + + + + + + - - + + - + - - - - - + + + + + - - - - - - - - - - - - + + + - - + + - + - - - - + + + + - - - - - + + + + + - + - - + + - + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - + + - - - - - + + + + + - + + - - + + - - + + - - - + + - - + + - - + + - - + + @@ -3169,48 +3114,20 @@

Total time: 70.11

- + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -3219,693 +3136,751 @@

Total time: 70.11

- + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - - - + + + - - - - - - - - - - + - - + - - - - - - - - - - - - - - + + + + + + - - - - - + + + + + - - - - - + + + + + - + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - - - - - + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - + + + + + - + - + + - - - + + - + - + - + - + - + - + - + - + - + - - - - + + + + + + + + + + + + + - - - + + + - + + - - - - - + + + + + - - - - - - + + + + + - - - - - + + + + + - + - - + - - + + + - + - - - - - + + + + + - - - - + + + + - + + + + + + + + + + - + - + - + - + - + - + - + - + - + - - - + + + - - - - - + + + + + - + - - - - - + + + + + - + - - + - - + + + - - - - - + + + + + - + + + + + + + + + + - + - - - + + + - + - - - + + + - + - + - - - + + + - + + + + + + + + + + + + + + + + + + + + + + - - - - + + - - - - - + + + + + - + - + + - - - + + - + - - - - - + + + + + - - - - - + + + + + - + - + + - - - + + - + + - - - + + - + + - - - - - + + + + + - + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + - - - + + - - - - - - - - - - - - - - + + + + + - + - + - - - + + + + + + + + + + + + - - - + + + - + + - + + - - - + + - - + + - - - + + - - - - - - - - - - - - - + + + + + - - - + + + - - - + + - - + - - + + + + + + + + + + + + - - + + + - - + + - - + + - - + + - - + + - - - - + + + + - - - - - + + + + + - + - - + + @@ -3913,128 +3888,118 @@

Total time: 70.11

- - + + - - + + - + - + - + - + - - + + - + - - + - - + + + - - + - - + + + - - + - - - - - - - - - - - - - - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -4042,152 +4007,171 @@

Total time: 70.11

- + - + - + - + - + - + - - + + - + - - - + + + - - - - - + + + + + - + - + - - - - - - - - - - - - - + + + + - - - - - + + + + + - + + + + + + + + + + + - - - + + + - - + - - + + + + + + + + + + + + + + + + + + + + + + - - + + - - - + + - - + + - + - + - + - + - + - + - + - + - - + + @@ -4195,113 +4179,122 @@

Total time: 70.11

- - + + - + - + - - - + + + - + - + - - - + + + - - - - - + + + + + - + + + + + + + + + + + + - - - + + + + + + + + + + + - - - - - - + + + + + - + - + - + - + - + - + - + - + - + - - - + + + - + - + + - - - + + - - - - - - - - - - - - + + + - + @@ -4320,7 +4313,7 @@

Total time: 70.11

- + @@ -4329,13 +4322,13 @@

Total time: 70.11

- + - + - + @@ -4343,49 +4336,49 @@

Total time: 70.11

- - + + - + - - + + - + - + - + - + - + - + - + - + - + - - - + + + - + @@ -4404,7 +4397,7 @@

Total time: 70.11

- + @@ -4413,26 +4406,26 @@

Total time: 70.11

- + - - - - - + + + + + - - - - + + + + - + @@ -4451,7 +4444,7 @@

Total time: 70.11

- + @@ -4479,16 +4472,16 @@

Total time: 70.11

- + - + - + @@ -4507,16 +4500,16 @@

Total time: 70.11

- + - + - + @@ -4535,7 +4528,7 @@

Total time: 70.11

- + @@ -4544,7 +4537,7 @@

Total time: 70.11

- + @@ -4563,7 +4556,7 @@

Total time: 70.11

- + @@ -4572,7 +4565,7 @@

Total time: 70.11

- + @@ -4580,7 +4573,7 @@

Total time: 70.11

- + @@ -4589,113 +4582,47 @@

Total time: 70.11

- - - - - - - - - - + - + - - - + + + - - - - - - - - - - - - - - - - - - - - - + + - + - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - + + + - + @@ -4714,7 +4641,7 @@

Total time: 70.11

- + @@ -4742,62 +4669,44 @@

Total time: 70.11

- + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - + - - - + + + - + - - + + @@ -4805,8 +4714,8 @@

Total time: 70.11

- - + + @@ -4816,7 +4725,7 @@

Total time: 70.11

- + @@ -4825,26 +4734,26 @@

Total time: 70.11

- + - + - + - - - + + + - + - - + + @@ -4852,20 +4761,10 @@

Total time: 70.11

- - + + - - - - - - - - - - @@ -4873,7 +4772,7 @@

Total time: 70.11

- + @@ -4882,108 +4781,80 @@

Total time: 70.11

- + - + - - - - - + + + + + - + - + - + - - - - - - - - - - - - - - - - - - - - - + + - + - - - + + + - - - - - - - - - - - + + - + - + - + - + - + - + - + @@ -4991,86 +4862,58 @@

Total time: 70.11

- + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - + + - + - - + + @@ -5078,8 +4921,8 @@

Total time: 70.11

- - + + @@ -5088,8 +4931,8 @@

Total time: 70.11

- - + + @@ -5097,46 +4940,27 @@

Total time: 70.11

- - + + - + - - - - - - - - - - - - - - - - - - - - - + + - + - - + + @@ -5144,27 +4968,27 @@

Total time: 70.11

- - + + - + - - + + - + - - + + @@ -5172,205 +4996,224 @@

Total time: 70.11

- - + + - + + + + + + + + + + + - - - - + + + + - - + - + - - - + + + + - + - - - + + + - + - + - - - + + + - + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - - - - - + + + + + - - - - - + + + + + - + + - + - + - + + + + + + + + + + - + - + - - - + + + - + - + - + - + - + - + - + - + - + - - - + + + - + - - + - - + + + - - + - - + + + - - + - + - - + + - - - + + + + - + - - + + - - + - - + + - + - + - - - + + + - + - - + + @@ -5378,27 +5221,27 @@

Total time: 70.11

- - + + - + - - + + - + - - + + @@ -5406,27 +5249,27 @@

Total time: 70.11

- - + + - + - - + + - + - - + + @@ -5434,94 +5277,93 @@

Total time: 70.11

- - + + - + - - - - - + + + + + - + - - - + + + - - - + + + - - + + - - - + + - - - + + + + - - + + - - - - - + + + + - + - - - + + + - - - + + + - + - - + + - - + + @@ -5529,46 +5371,28 @@

Total time: 70.11

- - + + - - - - - - - - - - - - - - - - - - - - - + + + - + - - + + @@ -5576,75 +5400,56 @@

Total time: 70.11

- - + + - + - + - - + + - - - - - - - - - - + - - - - - - - - - - - - + + - + - - - - + + + + - - - - + + + + - + - - + + @@ -5652,1270 +5457,1272 @@

Total time: 70.11

- - - - - - - - - - - + + - - + - + - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + - - - + + + + - - - - - - - - - - + + - - - - - - - - + + + + + + + + - - + + + - - - - + + + + + - - + + + + + + + + + - - - - - - - + + + + + + - - - - + + + + + + + + + - + + - + - + + + - - + + + + - - - - - + - - - - - - - + - - - - + + + - + - - + + + + + - - - - - - - - + + - - - - - + + + + + + + + - + - - + - + + - - - - - - - - - - + + + + + + + - - - - - + + + + + + + - + + + - + + + + + - - - - + - + + + + + - - + + + + + + - - - - - - - - - + - + + + - - - - - - - - - - - - - - - - + + - + + + + - - - + + + + + + + + + + + - - - + + - - - - - - + + - + + + + + + + - + + - - - - - - + - + + + + + + + + + + + - - - - - - + + + + + + - + + + + + - - - + + + - - - - - - - - - - - - - - + + + - - + + + - - - - + + + + + - - - + + + + + + - - - + - + + - - - - - - - - + + + + + + + + + - - - - + + + + + - + - - - + + - - - - - + + - - - - - + - - + - - - + + + - + + + + + + - - + + - - - - + + - - - + + + + - - + + - - - - - - - + + + + + + + + - - - - - + - - - - - - - - - - + - - - - - - + + + + + + + - + - - - - - - - + + - + + + + + - - + + + - - + + + + + - - - - + + + - - - - - + + + - - - + + + + + + - + + + + + + + + + + - - + - + - - + + - - + + + + - + + + + - + - - - - - + + - - + + - + - - + + + + + + - - - + + + + - - + + + + + + + + - - - - - - + - - - + + - + + + + - - - - - + - - - - - - - - - - - - - + + + + + + - - - - - - - - - + + + - - + + + + - - - - + + - + + + + - - - + - - + - + + + - + - - - + - - + + + - - - - - + + - - - + + + + + - + - - - - + + + - + + + - - + + + + + - - - - - - + + - - + + + + + + - - - + - + - - - - + + - + + + - - + + + + + - - + + - + + - + + + - + + + + - - + + + + + - - - - - - + - - + + + + - - - + + - + + - - - - - + - + + + + - - + - - + + + + + + - + - + @@ -6924,6 +6731,7 @@

Total time: 70.11

+ @@ -6932,18 +6740,13 @@

Total time: 70.11

- - - - - - + @@ -6953,41 +6756,41 @@

Total time: 70.11

- + + - + - - + - - + + @@ -7003,6 +6806,7 @@

Total time: 70.11

+ @@ -7013,13 +6817,11 @@

Total time: 70.11

- - @@ -7030,6 +6832,7 @@

Total time: 70.11

+ @@ -7039,7 +6842,6 @@

Total time: 70.11

- From 98d5c1435108154bb0fabaeedb55d6488aadc1b7 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Wed, 26 Dec 2018 09:03:35 -0700 Subject: [PATCH 08/93] remove respond_to in to_hash --- lib/protobuf/field/base_field.rb | 107 ++---------------- .../field/base_field_method_definitions.rb | 24 +++- lib/protobuf/message.rb | 4 +- 3 files changed, 30 insertions(+), 105 deletions(-) diff --git a/lib/protobuf/field/base_field.rb b/lib/protobuf/field/base_field.rb index d34eb612..6550b498 100644 --- a/lib/protobuf/field/base_field.rb +++ b/lib/protobuf/field/base_field.rb @@ -66,6 +66,7 @@ def initialize(message_class, rule, type_class, fully_qualified_name, tag, simpl define_field_and_present_p! define_set_field! define_set_method! + define_to_message_hash! set_default_value! tag_encoded end @@ -142,6 +143,14 @@ def define_set_field! end end + def define_to_message_hash! + if message? || enum? || repeated? || map? + ::Protobuf::Field::BaseFieldMethodDefinitions.define_to_hash_value_to_message_hash!(self) + else + ::Protobuf::Field::BaseFieldMethodDefinitions.define_base_to_message_hash!(self) + end + end + def deprecated? @deprecated end @@ -162,77 +171,6 @@ def enum? false end -# def define_field_method! -# if repeated? -# def field?(values) -# values.key?(fully_qualified_name) && values[fully_qualified_name].present? -# end -# else -# def field?(values) -# values.key?(fully_qualified_name) -# end -# end -# end - -# def define_for_serialization! -# set_map! -# -# if map? -# if required? -# def for_serialization(values) -# value = values[fully_qualified_name] -# -# if value.nil? -# fail ::Protobuf::SerializationError, "Required field #{self.class.name}##{name} does not have a value." -# else -# # on-the-wire, maps are represented like an array of entries where -# # each entry is a message of two fields, key and value. -# array = Array.new(value.size) -# i = 0 -# value.each do |k, v| -# array[i] = type_class.new(:key => k, :value => v) -# i += 1 -# end -# value = array -# end -# -# value -# end -# else -# def for_serialization(values) -# value = values[fully_qualified_name] -# -# unless value.nil? -# # on-the-wire, maps are represented like an array of entries where -# # each entry is a message of two fields, key and value. -# array = Array.new(value.size) -# i = 0 -# value.each do |k, v| -# array[i] = type_class.new(:key => k, :value => v) -# i += 1 -# end -# value = array -# end -# -# value -# end -# end -# else -# if required? -# def for_serialization(values) -# value = values[fully_qualified_name] -# fail ::Protobuf::SerializationError, "Required field #{self.class.name}##{name} does not have a value." if value.nil? -# -# value -# end -# else -# def for_serialization(values) -# values[@fully_qualified_name] -# end -# end -# end -# end - def message? false end @@ -282,33 +220,6 @@ def define_set_method! end end -# # FIXME: need to cleanup (rename) this warthog of a method. -# def set(message_instance, bytes) -# return message_instance.set_field(name, decode(bytes), true, self) unless repeated? -# -# if map? -# hash = message_instance[name] -# entry = decode(bytes) -# # decoded value could be nil for an -# # enum value that is not recognized -# hash[entry.key] = entry.value unless entry.value.nil? -# return hash[entry.key] -# end -# -# return message_instance[name] << decode(bytes) unless packed? -# -# array = message_instance[name] -# stream = StringIO.new(bytes) -# -# if wire_type == ::Protobuf::WireType::VARINT -# array << decode(Varint.decode(stream)) until stream.eof? -# elsif wire_type == ::Protobuf::WireType::FIXED64 -# array << decode(stream.read(8)) until stream.eof? -# elsif wire_type == ::Protobuf::WireType::FIXED32 -# array << decode(stream.read(4)) until stream.eof? -# end -# end - def tag_encoded @tag_encoded ||= begin case diff --git a/lib/protobuf/field/base_field_method_definitions.rb b/lib/protobuf/field/base_field_method_definitions.rb index 62a0963d..ba64fce9 100644 --- a/lib/protobuf/field/base_field_method_definitions.rb +++ b/lib/protobuf/field/base_field_method_definitions.rb @@ -11,10 +11,26 @@ def self.fully_qualified_name_string(selph) fully_qualified_name end + def self.define_to_hash_value_to_message_hash!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def to_message_hash(values, result) + result["#{selph.name}"] = value_from_values(values).to_hash_value + end + RUBY + end + + def self.define_base_to_message_hash!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def to_message_hash(values, result) + result["#{selph.name}"] = value_from_values(values) + end + RUBY + end + def self.define_base_set_method!(selph) selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 def set(message_instance, bytes) - message_instance.set_field(name, decode(bytes), true, self) + message_instance.set_field("#{selph.name}", decode(bytes), true, self) end RUBY end @@ -22,7 +38,7 @@ def set(message_instance, bytes) def self.define_map_set_method!(selph) selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 def set(message_instance, bytes) - hash = message_instance[name] + hash = message_instance["#{selph.name}"] entry = decode(bytes) # decoded value could be nil for an # enum value that is not recognized @@ -35,7 +51,7 @@ def set(message_instance, bytes) def self.define_repeated_not_packed_set_method!(selph) selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 def set(message_instance, bytes) - message_instance[name] << decode(bytes) + message_instance["#{selph.name}"] << decode(bytes) end RUBY end @@ -43,7 +59,7 @@ def set(message_instance, bytes) def self.define_repeated_packed_set_method!(selph) selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 def set(message_instance, bytes) - array = message_instance[name] + array = message_instance["#{selph.name}"] stream = ::StringIO.new(bytes) if wire_type == ::Protobuf::WireType::VARINT diff --git a/lib/protobuf/message.rb b/lib/protobuf/message.rb index c06e36e6..98297d5c 100644 --- a/lib/protobuf/message.rb +++ b/lib/protobuf/message.rb @@ -137,9 +137,7 @@ def to_hash @values.each_key do |field_name| field = _protobuf_message_field[field_name] - value = field.value_from_values(@values) - hashed_value = value.respond_to?(:to_hash_value) ? value.to_hash_value : value - result[field.name] = hashed_value + field.to_message_hash(@values, result) end result From 10c7ee53d614d32aa7c70c210ba63869874e469f Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Wed, 26 Dec 2018 10:27:24 -0700 Subject: [PATCH 09/93] start by copying string and dump the tag_encoded when we write the encode_to_stream methods --- lib/protobuf/field/base_field_method_definitions.rb | 6 +++--- lib/protobuf/field/string_field.rb | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/protobuf/field/base_field_method_definitions.rb b/lib/protobuf/field/base_field_method_definitions.rb index b83c5b5f..ce6a3bf5 100644 --- a/lib/protobuf/field/base_field_method_definitions.rb +++ b/lib/protobuf/field/base_field_method_definitions.rb @@ -33,7 +33,7 @@ def self.define_repeated_packed_encode_to_stream_method!(selph) selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 def encode_to_stream(value, stream) packed_value = value.map { |val| encode(val) }.join - stream << "\#{tag_encoded}\#{::Protobuf::Field::VarintField.encode(packed_value.size)}\#{packed_value}" + stream << #{selph.tag_encoded.dump} << "\#{::Protobuf::Field::VarintField.encode(packed_value.size)}\#{packed_value}" end RUBY end @@ -43,7 +43,7 @@ def self.define_base_encode_to_stream_method!(selph) selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 def encode_to_stream(value, stream) - stream << tag_encoded << encode(value) + stream << #{selph.tag_encoded.dump} << encode(value) end RUBY end @@ -54,7 +54,7 @@ def self.define_repeated_not_packed_encode_to_stream_method!(selph) selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 def encode_to_stream(value, stream) value.each do |val| - stream << tag_encoded << encode(val) + stream << #{selph.tag_encoded.dump} << encode(val) end end RUBY diff --git a/lib/protobuf/field/string_field.rb b/lib/protobuf/field/string_field.rb index fa6f33cf..8889816a 100644 --- a/lib/protobuf/field/string_field.rb +++ b/lib/protobuf/field/string_field.rb @@ -43,13 +43,12 @@ def encode(value) end def encode_to_stream(value, stream) - if value.encoding != ::Protobuf::Field::StringField::ENCODING - value = "" + value - value.encode!(::Protobuf::Field::StringField::ENCODING, :invalid => :replace, :undef => :replace, :replace => "") + new_value = "" + value + if new_value.encoding != ::Protobuf::Field::StringField::ENCODING + new_value.encode!(::Protobuf::Field::StringField::ENCODING, :invalid => :replace, :undef => :replace, :replace => "") end - byte_size = ::Protobuf::Field::VarintField.encode(value.bytesize) - stream << tag_encoded << byte_size << value + stream << tag_encoded << ::Protobuf::Field::VarintField.encode(new_value.bytesize) << new_value end def json_encode(value) From fe1b5050fb5ca416c026dc69af812f7f25718904 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Wed, 26 Dec 2018 11:36:36 -0700 Subject: [PATCH 10/93] move all encode_to_stream methods to definitions --- lib/protobuf/field/base_field.rb | 4 + .../field/base_field_method_definitions.rb | 30 +- lib/protobuf/field/bytes_field.rb | 7 - lib/protobuf/field/string_field.rb | 9 - profile.html | 7778 +++++++---------- 5 files changed, 3046 insertions(+), 4782 deletions(-) diff --git a/lib/protobuf/field/base_field.rb b/lib/protobuf/field/base_field.rb index 9f185582..7cb668b7 100644 --- a/lib/protobuf/field/base_field.rb +++ b/lib/protobuf/field/base_field.rb @@ -113,6 +113,10 @@ def define_encode_to_stream! ::Protobuf::Field::BaseFieldMethodDefinitions.define_repeated_packed_encode_to_stream_method!(self) elsif repeated? ::Protobuf::Field::BaseFieldMethodDefinitions.define_repeated_not_packed_encode_to_stream_method!(self) + elsif message? || type_class == ::Protobuf::Field::BytesField + ::Protobuf::Field::BaseFieldMethodDefinitions.define_bytes_encode_to_stream_method!(self) + elsif type_class == ::Protobuf::Field::StringField + ::Protobuf::Field::BaseFieldMethodDefinitions.define_string_encode_to_stream_method!(self) else ::Protobuf::Field::BaseFieldMethodDefinitions.define_base_encode_to_stream_method!(self) end diff --git a/lib/protobuf/field/base_field_method_definitions.rb b/lib/protobuf/field/base_field_method_definitions.rb index ce6a3bf5..f4207b57 100644 --- a/lib/protobuf/field/base_field_method_definitions.rb +++ b/lib/protobuf/field/base_field_method_definitions.rb @@ -28,8 +28,6 @@ def to_message_hash(values, result) end def self.define_repeated_packed_encode_to_stream_method!(selph) - return if selph.respond_to?(:encode_to_stream) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 def encode_to_stream(value, stream) packed_value = value.map { |val| encode(val) }.join @@ -38,9 +36,31 @@ def encode_to_stream(value, stream) RUBY end - def self.define_base_encode_to_stream_method!(selph) - return if selph.respond_to?(:encode_to_stream) + def self.define_bytes_encode_to_stream_method!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def encode_to_stream(value, stream) + value = value.encode if value.is_a?(::Protobuf::Message) + byte_size = ::Protobuf::Field::VarintField.encode(value.bytesize) + + stream << #{selph.tag_encoded.dump} << byte_size << value + end + RUBY + end + + def self.define_string_encode_to_stream_method!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def encode_to_stream(value, stream) + new_value = "" + value + if new_value.encoding != ::Protobuf::Field::StringField::ENCODING + new_value.encode!(::Protobuf::Field::StringField::ENCODING, :invalid => :replace, :undef => :replace, :replace => "") + end + stream << #{selph.tag_encoded.dump} << ::Protobuf::Field::VarintField.encode(new_value.bytesize) << new_value + end + RUBY + end + + def self.define_base_encode_to_stream_method!(selph) selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 def encode_to_stream(value, stream) stream << #{selph.tag_encoded.dump} << encode(value) @@ -49,8 +69,6 @@ def encode_to_stream(value, stream) end def self.define_repeated_not_packed_encode_to_stream_method!(selph) - return if selph.respond_to?(:encode_to_stream) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 def encode_to_stream(value, stream) value.each do |val| diff --git a/lib/protobuf/field/bytes_field.rb b/lib/protobuf/field/bytes_field.rb index 9546780e..40aa3fbe 100644 --- a/lib/protobuf/field/bytes_field.rb +++ b/lib/protobuf/field/bytes_field.rb @@ -46,13 +46,6 @@ def encode(value) "#{string_size}#{value_to_encode}" end - def encode_to_stream(value, stream) - value = value.encode if value.is_a?(::Protobuf::Message) - byte_size = ::Protobuf::Field::VarintField.encode(value.bytesize) - - stream << tag_encoded << byte_size << value - end - def wire_type ::Protobuf::WireType::LENGTH_DELIMITED end diff --git a/lib/protobuf/field/string_field.rb b/lib/protobuf/field/string_field.rb index 8889816a..a59fd652 100644 --- a/lib/protobuf/field/string_field.rb +++ b/lib/protobuf/field/string_field.rb @@ -42,15 +42,6 @@ def encode(value) "#{::Protobuf::Field::VarintField.encode(value_to_encode.size)}#{value_to_encode}" end - def encode_to_stream(value, stream) - new_value = "" + value - if new_value.encoding != ::Protobuf::Field::StringField::ENCODING - new_value.encode!(::Protobuf::Field::StringField::ENCODING, :invalid => :replace, :undef => :replace, :replace => "") - end - - stream << tag_encoded << ::Protobuf::Field::VarintField.encode(new_value.bytesize) << new_value - end - def json_encode(value) value end diff --git a/profile.html b/profile.html index 0afe829f..2e13a6ae 100644 --- a/profile.html +++ b/profile.html @@ -52,7 +52,7 @@

Profile Report: main

-

Total time: 69.40

+

Total time: 63.12

%Total
100% 0%70.1169.40 0.0070.1169.40 0 (top)
60.2060.09 0.0060.2060.09 1/1 Benchmark::IPS.ips
2.840.112.731/5Fixnum#times
2.630.012.622.650.002.65 2/115 Kernel.require
2.572.43 0.002.572.42 5/1904 Kernel.require
1.842.400.122.281/5Fixnum#times
1.80 0.191.651.61 24/26 Kernel.load
2.40 0.120.060.062/5Kernel.require
2.840.112.732.28 1/5 (top)
60.1960.08 0.0060.1960.08 2/5 Benchmark::IPS::Job#run
90% 0%63.150.1762.9862.570.1662.40 5 Fixnum#times
40.1540.08 0.0040.1540.08 1/1 Benchmark::IPS::Job#run_benchmark
20.0420.00 0.0020.0420.00 1/1 Benchmark::IPS::Job#run_warmup
1.130.021.1210000/3933261.080.011.0610000/415768 Protobuf::Message::Serialization::ClassMethods.decode_from
1.090.051.0410000/3933260.760.030.7310000/415768 Protobuf::Encoder.encode
0.350.31 0.020.3320000/11824160.2920000/1249742 Class#new
0.140.040.0910000/3933260.110.030.0810000/415768 Test::Resource#status=
0.130.000.134/3950670.110.010.114/417509 Bundler::SpecSet#tsort_each_node
0.170.010.161/3950670.140.020.121/417509 Bundler::LockfileParser#initialize
0.19 0.00 0.191/3950671/417509 Bundler::Source::Path#load_spec_files
0.240.25 0.000.241/3950670.251/417509 Gem::Specification.each_gemspec
0.700.010.6820/3950670.660.020.6420/417509 Kernel.require
20.041.6718.381/39506720.001.6818.321/417509 Benchmark::IPS::Job#run_warmup
40.1540.08 0.0240.131/39506740.061/417509 Benchmark::IPS::Job#run_benchmark
88%89% 2%62.051.8160.2439506761.891.8460.05417509 Array#each
57.551.9155.641400333/140033357.531.9455.591412256/1412256 Benchmark::IPS::Job::Entry#call_times
0.710.420.291400883/14008830.640.400.241412810/1412810 Benchmark::Timing.now
0.190.20 0.000.190.20 12/13 Gem::Specification.load
0.19 1/1 Bundler::Source::Path#validate_spec
0.170.01 0.16160/838Kernel.send0.160.001412260/1412260Float#<
0.160.160.13 0.001400337/1400337Float#<0.13160/838Kernel.send
0.120.11 0.010.120.10 118/118 TSort.each_strongly_connected_component_from
60.2060.09 0.0060.2060.09 1/1 (top)
85%86% 0%60.2060.09 0.0060.2060.09 1 Benchmark::IPS.ips
60.1960.08 0.0060.1960.08 1/1 Benchmark::IPS::Job#run
60.1960.08 0.0060.1960.08 1/1 Benchmark::IPS.ips
85%86% 0%60.1960.08 0.0060.1960.08 1 Benchmark::IPS::Job#run
60.1960.08 0.0060.1960.08 2/5 Fixnum#times
57.551.9155.641400333/140033357.531.9455.591412256/1412256 Array#each
82% 2%57.551.9155.64140033357.531.9455.591412256 Benchmark::IPS::Job::Entry#call_times
55.102.3252.785714009/571454055.042.2752.775853424/5853955 Proc#call
0.540.540.550.55 0.007113788/79003747265478/8096960 Fixnum#<
55.102.3252.785714009/571454055.042.2752.775853424/5853955 Benchmark::IPS::Job::Entry#call_times
78%79% 3%55.162.3552.81571454055.092.2952.805853955 Proc#call
24.192.1822.015330683/533068324.252.1522.105447656/5447656 Protobuf::Message#to_hash
12.140.2311.91383326/39332612.790.3012.49405768/415768 Protobuf::Message::Serialization::ClassMethods.decode_from
10.280.2810.00383326/3933269.780.329.45405768/415768 Protobuf::Encoder.encode
4.340.373.97766652/11824164.230.303.92811536/1249742 Class#new
1.680.381.550.25 1.30383326/393326405768/415768 Test::Resource#status=
0.100.100.110.11 0.00383326/393326405768/415768 Protobuf::Message#to_proto
40.1540.08 0.0040.1540.08 1/1 Fixnum#times
57% 0%40.1540.08 0.0040.1540.08 1 Benchmark::IPS::Job#run_benchmark
40.1540.08 0.0240.131/39506740.061/417509 Array#each
10.421.718.70393326/57240109.551.867.69415768/5863425 Protobuf::Message#each_field_for_serialization
22.019.3012.715330683/572401022.109.2512.855447656/5863425 Protobuf::Message#to_hash
46%15%32.4311.0121.41572401045%16%31.6511.1120.545863425 Hash#each_key
3.642.920.7110661366/106628853.382.760.6210895312/10896957 Kernel.respond_to?
3.590.343.25393326/393326Protobuf::Field::StringField(singleton)#encode_to_stream2.691.920.775863424/6279192Protobuf::Field::StringField(singleton)#value_from_values
2.491.810.685724009/61173352.661.890.775863424/6279192 Protobuf::Field::Int64Field(singleton)#value_from_values
2.431.710.725724009/6117335Protobuf::Field::StringField(singleton)#value_from_values2.340.691.66415768/415768Protobuf::Field::StringField#encode_to_stream
1.880.301.58393326/3933261.980.311.68415768/415768 Protobuf::Field::EnumField(singleton)#encode_to_stream
1.710.301.40393326/3933261.720.291.42415768/415768 Protobuf::Field::Int64Field(singleton)#encode_to_stream
1.681.681.671.67 0.0011841344/1538694812142616/15890196 Hash#[]
1.281.281.411.41 0.0010661366/13026447Hash#[]=10895312/10895502Protobuf::Field::BaseField#name
1.241.241.311.31 0.0011841344/1420130212142616/14637226 Test::Resource#_protobuf_message_field
1.131.130.990.99 0.0010661366/10661556Protobuf::Field::BaseField#name10895312/13395045Hash#[]=
0.350.070.28393326/7866520.380.080.29415768/831536 Protobuf::Field::EnumField(singleton)#value_from_values
24.192.1822.015330683/533068324.252.1522.105447656/5447656 Proc#call
34% 3%24.192.1822.01533068324.252.1522.105447656 Protobuf::Message#to_hash
22.019.3012.715330683/572401022.109.2512.855447656/5863425 Hash#each_key
20.0420.00 0.0020.0420.00 1/1 Fixnum#times
28% 0%20.0420.00 0.0020.0420.00 1 Benchmark::IPS::Job#run_warmup
20.041.6718.381/39506720.001.6818.321/417509 Array#each
1.130.021.1210000/3933261.080.011.0610000/415768 Fixnum#times
12.140.2311.91383326/39332612.790.3012.49405768/415768 Proc#call
18%19% 0%13.270.2513.0339332613.870.3213.56415768 Protobuf::Message::Serialization::ClassMethods.decode_from
12.260.2811.97393326/39332612.810.3112.50415768/415768 Protobuf::Message::Serialization.decode_from
0.770.210.56393326/11824160.750.180.57415768/1249742 Class#new
12.260.2811.97393326/39332612.810.3112.50415768/415768 Protobuf::Message::Serialization::ClassMethods.decode_from
17%18% 0%12.260.2811.9739332612.810.3112.50415768 Protobuf::Message::Serialization.decode_from
11.971.5210.46393326/39332612.501.4711.04415768/415768 Protobuf::Decoder.decode_each_field
11.971.5210.46393326/39332612.501.4711.04415768/415768 Protobuf::Message::Serialization.decode_from
17%18% 2%11.971.5210.4639332612.501.4711.04415768 Protobuf::Decoder.decode_each_field
9.040.808.241179978/11799789.561.058.511247304/1247304 Protobuf::Message::Serialization.set_field_bytes
0.930.570.970.61 0.362359956/23599562494608/2494608 Protobuf::Varint.decode
0.190.190.210.21 0.00393326/393326415768/415768 StringIO#read
0.16 0.16 0.001573304/15733041663072/1663072 StringIO#eof
0.130.130.140.14 0.001572988/15756151662784/1665061 Fixnum#==
1.090.051.0410000/3933260.760.030.7310000/415768 Fixnum#times
10.280.2810.00383326/3933269.780.329.45405768/415768 Proc#call
16%15% 0%11.370.3311.0439332610.540.3510.18415768 Protobuf::Encoder.encode
11.040.4510.59393326/39332610.180.479.72415768/415768 Protobuf::Message#each_field_for_serialization
11.040.4510.59393326/39332610.180.479.72415768/415768 Protobuf::Encoder.encode
15%14% 0%11.040.4510.5939332610.180.479.72415768 Protobuf::Message#each_field_for_serialization
10.421.718.70393326/57240109.551.867.69415768/5863425 Hash#each_key
0.120.120.110.11 0.00393326/1179979415768/1247305 Test::Resource#_protobuf_message_required_field_tags
9.040.808.241179978/11799789.561.058.511247304/1247304 Protobuf::Decoder.decode_each_field
12%13% 1%9.040.808.2411799789.561.058.511247304 Protobuf::Message::Serialization.set_field_bytes
3.233.29 0.262.97393326/3933263.03415768/415768 Protobuf::Field::EnumField(singleton)#set
2.310.242.07393326/3933262.390.252.14415768/415768 Protobuf::Field::Int64Field(singleton)#set
2.242.27 0.271.98393326/3933262.00415768/415768 Protobuf::Field::StringField(singleton)#set
0.260.260.320.32 0.001179978/153869481247304/15890196 Hash#[]
0.200.200.240.24 0.001179978/142013021247304/14637226 Test::Resource#_protobuf_message_field
1.141.15 0.170.97393326/23599580.98415768/2494610 Protobuf::Field::EnumField(singleton)#set
1.340.161.18393326/2359958Protobuf::Field::Int64Field(singleton)#set1.380.241.14415768/2494610Test::Resource#status=
1.390.261.13393326/2359958Test::Resource#status=0.151.24415768/2494610Protobuf::Field::Int64Field(singleton)#set
1.530.241.29393326/23599581.490.211.28415768/2494610 Protobuf::Field::StringField(singleton)#set
2.970.562.41786654/23599582.900.552.35831538/2494610 Hash#each
11% 1%8.371.406.9723599588.311.326.992494610 Protobuf::Message#set_field
2.430.751.69786653/7866532.370.761.61831537/831537 Protobuf::Field::StringField(singleton)#set_field
2.150.511.64786653/7866532.190.501.69831537/831537 Protobuf::Field::Int64Field(singleton)#set_field
1.970.521.45786652/7866522.000.491.51831536/831536 Protobuf::Field::EnumField(singleton)#set_field
0.230.230.240.24 0.001179980/153869481247306/15890196 Hash#[]
0.19 0.19 0.001179980/142013021247306/14637226 Test::Resource#_protobuf_message_field
0.130.12 0.060.0735/11824160.0635/1249742 Kernel.require
0.230.24 0.050.1814/11824160.1914/1249742 Kernel.eval
0.350.31 0.020.3320000/11824160.2920000/1249742 Fixnum#times
0.440.40 0.010.43153/11824160.39153/1249742 Protobuf::Field.build
0.59 0.010.581/11824160.571/1249742 Bundler::Dsl#to_definition
0.770.210.56393326/11824160.750.180.57415768/1249742 Protobuf::Message::Serialization::ClassMethods.decode_from
4.340.373.97766652/11824164.230.303.92811536/1249742 Proc#call
10% 1%7.140.846.3011824166.950.736.221249742 Class#new
4.730.903.83786653/7866534.660.873.78831537/831537 Protobuf::Message#initialize
0.580.57 0.01 0.57 1/1 Bundler::Definition#initialize
0.430.39 0.020.420.37 153/153 Protobuf::Field::BaseField#initialize
0.190.000.191/1Bundler::LockfileParser#initialize
0.190.010.200.02 0.18 17/17 Gem::Specification#initialize
0.120.120.150.000.151/1Bundler::LockfileParser#initialize
0.130.13 0.00393326/393326415768/415768 StringIO#initialize
1.491.44 0.071.421.37 2/1904 Kernel.load
2.572.43 0.002.572.42 5/1904 (top)
2.622.64 0.002.622.64 115/1904 Kernel.require
9% 0%6.676.51 0.076.606.44 1904 Kernel.require
2.222.21 0.002.222.21 1/1 Bundler.setup
0.700.010.6820/3950670.660.020.6420/417509 Array#each
0.330.32 0.000.330.31 109/109 Protobuf::Message::Fields::ClassMethods.optional
0.240.26 0.000.240.26 1/1 Gem::Specification.load_defaults
0.19 2/7 IO.open
0.140.000.1437/37Protobuf::Message::Fields::ClassMethods.repeated
0.130.12 0.060.0735/11824160.0635/1249742 Class#new
0.120.060.062/5Fixnum#times0.000.1237/37Protobuf::Message::Fields::ClassMethods.repeated
0.110.000.111/1Concurrent::Utility::NativeExtensionLoader.load_native_extensions
4.730.903.83786653/7866534.660.873.78831537/831537 Class#new
6% 1%4.730.903.837866534.660.873.78831537 Protobuf::Message#initialize
3.663.60 0.702.97786653/7868642.90831537/831748 Hash#each
0.100.100.00831537/831706Kernel.block_given?
3.663.60 0.702.97786653/7868642.90831537/831748 Protobuf::Message#initialize
5% 1%3.753.68 0.753.007868642.93831748 Hash#each
2.970.562.41786654/23599582.900.552.35831538/2494610 Protobuf::Message#set_field
3.642.920.7110661366/106628853.382.760.6210895312/10896957 Hash#each_key
5% 4%3.642.930.72106628853%3.392.770.6310896957 Kernel.respond_to?
0.720.720.630.63 0.0010662776/1066277810896824/10896826 Kernel.respond_to_missing?
3.590.343.25393326/393326Hash#each_key
5%0%3.590.343.25393326Protobuf::Field::StringField(singleton)#encode_to_stream
2.540.801.74393326/393326Protobuf::Field::StringField#encode
0.490.200.29786652/2359956IO::GenericWritable.<<
0.230.230.00393326/1180131Protobuf::Field::BaseField#tag_encoded
3.233.29 0.262.97393326/3933263.03415768/415768 Protobuf::Message::Serialization.set_field_bytes
4% 0%3.233.29 0.262.973933263.03415768 Protobuf::Field::EnumField(singleton)#set
1.830.251.58393326/3933261.880.241.64415768/415768 Protobuf::Field::EnumField#decode
1.141.15 0.170.97393326/23599580.98415768/2494610 Protobuf::Message#set_field
0.140.140.001179978/15386948Protobuf::Enum.enum_for_tag_integer
0.230.230.001179980/15386948Protobuf::Message#set_field2.691.920.775863424/6279192Hash#each_key
0.260.260.001179978/15386948Protobuf::Message::Serialization.set_field_bytes
3%2%2.691.920.776279192Protobuf::Field::StringField(singleton)#value_from_values
0.340.490.49 0.000.34261/15386948Set#include?5863424/12143918Hash#fetch
1.681.680.0011841344/153869482.661.890.775863424/6279192 Hash#each_key
3%3%2.722.320.4015386948Hash#[]2%2.661.890.776279192Protobuf::Field::Int64Field(singleton)#value_from_values
0.330.460.46 0.000.33153/295Bundler::DepProxy#hash5863424/12143918Hash#fetch
2.630.012.622.650.002.65 2/115 (top)
3% 0%2.630.012.622.650.002.65 115 Kernel.require
2.622.64 0.002.622.64 115/1904 Kernel.require
2.540.801.74393326/393326Protobuf::Field::StringField(singleton)#encode_to_stream
3%1%2.540.801.74393326Protobuf::Field::StringField#encode
1.221.06 0.16393326/393326String#encode!
0.28 0.160.13393326/1180131Protobuf::Field::VarintField.encode0.001247304/15890196Protobuf::Enum.enum_for_tag_integer
0.100.100.240.24 0.00393326/786790String#+1247306/15890196Protobuf::Message#set_field
2.491.810.685724009/61173350.320.320.001247304/15890196Protobuf::Message::Serialization.set_field_bytes
1.671.670.0012142616/15890196 Hash#each_key
3%2%2.491.810.686117335Protobuf::Field::Int64Field(singleton)#value_from_values3%2.472.400.0715890196Hash#[]
2.390.252.14415768/415768Protobuf::Message::Serialization.set_field_bytes
3%0%2.390.252.14415768Protobuf::Field::Int64Field(singleton)#set
1.390.151.24415768/2494610Protobuf::Message#set_field
0.75 0.430.430.005724009/11842646Hash#fetch0.32415768/831536Protobuf::Field::IntegerField#decode
2.430.751.69786653/7866532.370.761.61831537/831537 Protobuf::Message#set_field
3% 1%2.430.751.697866532.370.761.61831537 Protobuf::Field::StringField(singleton)#set_field
0.590.380.20786653/786653Protobuf::Field::BytesField#coerce!0.530.410.13831537/1247305Test::Resource#_protobuf_message_required_field_tags
0.530.420.11786653/1179979Test::Resource#_protobuf_message_required_field_tags0.520.370.15831537/831537Protobuf::Field::StringField#coerce!
0.270.270.290.29 0.00786653/786836831537/831720 Array#delete
0.210.210.180.18 0.00786653/13026447831537/13395045 Hash#[]=
2.431.710.725724009/61173352.340.691.66415768/415768 Hash#each_key
3%2%2.431.710.726117335Protobuf::Field::StringField(singleton)#value_from_values0%2.340.691.66415768Protobuf::Field::StringField#encode_to_stream
0.430.430.005724009/11842646Hash#fetch0.590.240.351247304/2910376IO::GenericWritable.<<
2.310.242.07393326/393326Protobuf::Message::Serialization.set_field_bytes
3%0%2.310.36 0.242.07393326Protobuf::Field::Int64Field(singleton)#set0.11415768/416553BasicObject#!=
1.340.161.18393326/2359958Protobuf::Message#set_field0.320.170.15415768/1247457Protobuf::Field::VarintField.encode
0.730.430.30393326/786652Protobuf::Field::IntegerField#decode0.250.250.00415768/1247457Protobuf::Field::BaseField#tag_encoded
2.242.27 0.271.98393326/3933262.00415768/415768 Protobuf::Message::Serialization.set_field_bytes
3% 0%2.242.27 0.271.983933262.00415768 Protobuf::Field::StringField(singleton)#set
1.530.241.29393326/23599581.490.211.28415768/2494610 Protobuf::Message#set_field
0.450.280.17393326/3933260.510.260.25415768/415768 Protobuf::Field::StringField#decode
2.222.21 0.002.222.21 1/1 Kernel.require
3% 0%2.222.21 0.002.222.21 1 Bundler.setup
1.181.17 0.001.181.17 1/1 Bundler::Runtime#setup
1.020.010.02 1.00 1/2 Bundler.definition
2.150.511.64786653/7866532.190.501.69831537/831537 Protobuf::Message#set_field
3% 0%2.150.511.647866532.190.501.69831537 Protobuf::Field::Int64Field(singleton)#set_field
1.460.570.88786653/7866531.490.600.89831537/831537 Protobuf::Field::IntegerField#coerce!
0.120.120.140.14 0.00786653/13026447831537/13395045 Hash#[]=
1.970.521.45786652/7866522.000.491.51831536/831536 Protobuf::Message#set_field
2% 0%1.970.521.457866522.000.491.51831536 Protobuf::Field::EnumField(singleton)#set_field
1.270.330.93786652/7866521.340.360.98831536/831536 Protobuf::Field::EnumField#coerce!
0.130.130.110.11 0.00786652/13026447831536/13395045 Hash#[]=
1.880.301.58393326/3933261.980.311.68415768/415768 Hash#each_key
2% 0%1.880.301.583933261.980.311.68415768 Protobuf::Field::EnumField(singleton)#encode_to_stream
1.150.240.91393326/3933261.250.260.99415768/415768 Protobuf::Field::EnumField#encode
0.290.150.14786652/23599560.300.160.13831536/2910376 IO::GenericWritable.<<
0.140.140.130.13 0.00393326/1180131415768/1247457 Protobuf::Field::BaseField#tag_encoded
1.840.191.6524/26(top)
2%0%1.840.191.6526Kernel.load
1.490.071.422/1904Kernel.require
1.830.251.58393326/3933261.880.241.64415768/415768 Protobuf::Field::EnumField(singleton)#set
2% 0%1.830.251.583933261.880.241.64415768 Protobuf::Field::EnumField#decode
1.040.310.73393326/3933260.320.72415768/415768 Protobuf::Field::EnumField#acceptable?
0.540.330.21393326/7866520.600.360.24415768/831536 Protobuf::Field::IntegerField#decode
0.140.040.0910000/393326Fixnum#times
1.680.381.30383326/393326Proc#call1.800.191.6124/26(top)
2% 0%1.810.421.39393326Test::Resource#status=1.800.191.6126Kernel.load
1.390.261.13393326/2359958Protobuf::Message#set_field1.440.071.372/1904Kernel.require
0.120.120.190.19 0.00786653/13026447Protobuf::Field::Int64Field(singleton)#set_field1247306/14637226Protobuf::Message#set_field
0.130.130.00786652/13026447Protobuf::Field::EnumField(singleton)#set_field
0.210.210.240.24 0.00786653/13026447Protobuf::Field::StringField(singleton)#set_field1247304/14637226Protobuf::Message::Serialization.set_field_bytes
1.281.281.311.31 0.0010661366/1302644712142616/14637226 Hash#each_key
2% 2%1.791.770.0213026447Hash#[]=1.741.740.0014637226Test::Resource#_protobuf_message_field
1.710.301.40393326/3933261.720.291.42415768/415768 Hash#each_key
2% 0%1.710.301.403933261.720.291.42415768 Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.860.480.38393326/7866520.960.490.47415768/831536 Protobuf::Field::IntegerField#encode
0.380.150.22786652/23599560.350.160.19831536/2910376 IO::GenericWritable.<<
0.160.160.110.11 0.00393326/1180131415768/1247457 Protobuf::Field::BaseField#tag_encoded
0.190.190.001179980/14201302Protobuf::Message#set_field0.750.400.34415768/831536Protobuf::Field::EnumField#encode
0.200.200.001179978/14201302Protobuf::Message::Serialization.set_field_bytes0.960.490.47415768/831536Protobuf::Field::Int64Field(singleton)#encode_to_stream
2%1%1.710.900.81831536Protobuf::Field::IntegerField#encode
1.241.240.0011841344/14201302Hash#each_key0.470.240.23831536/1247457Protobuf::Field::VarintField.encode
2%2%1.621.62
0.340.34 0.0014201302Test::Resource#_protobuf_message_field831464/1662929Fixnum#&
0.680.390.29393326/786652Protobuf::Field::EnumField#encode0.110.030.0810000/415768Fixnum#times
0.860.480.38393326/786652Protobuf::Field::Int64Field(singleton)#encode_to_stream1.550.251.30405768/415768Proc#call
2%1%1.540.870.67786652Protobuf::Field::IntegerField#encode
0.370.210.16786652/1180131Protobuf::Field::VarintField.encode0%1.660.281.38415768Test::Resource#status=
0.310.310.00786559/1573117Fixnum#&1.380.241.14415768/2494610Protobuf::Message#set_field
1.460.570.88786653/7866531.490.600.89831537/831537 Protobuf::Field::Int64Field(singleton)#set_field
2% 0%1.460.570.887866531.490.600.89831537 Protobuf::Field::IntegerField#coerce!
0.710.520.18786653/7866530.720.510.21831537/831537 Protobuf::Field::IntegerField#acceptable?
0.560.200.37393326/1179987Protobuf::Field::EnumField#acceptable?0.110.110.00831536/13395045Protobuf::Field::EnumField(singleton)#set_field
0.830.300.53786652/1179987Protobuf::Field::EnumField#coerce!0.140.140.00831537/13395045Protobuf::Field::Int64Field(singleton)#set_field
1%0%1.390.490.901179987Protobuf::Enum.fetch
0.180.180.00831537/13395045Protobuf::Field::StringField(singleton)#set_field
0.790.530.271179978/1179978Protobuf::Enum.enum_for_tag_integer0.990.990.0010895312/13395045Hash#each_key
2%2%1.461.440.0213395045Hash#[]=
0.110.111.411.41 0.001179987/2754972Kernel.kind_of?10895312/10895502Hash#each_key
2%2%1.411.410.0010895502Protobuf::Field::BaseField#name
0.170.010.16160/838Array#each0.530.190.34415768/1247313Protobuf::Field::EnumField#acceptable?
1.100.001.101/838Bundler::Runtime#requested_specs0.850.300.55831536/1247313Protobuf::Field::EnumField#coerce!
1% 0%1.280.011.26838Kernel.send1.380.490.901247313Protobuf::Enum.fetch
1.100.001.101/1Bundler::Definition#requested_specs0.780.520.271247304/1247304Protobuf::Enum.enum_for_tag_integer
0.110.00 0.1177/79Bundler::LockfileParser#parse_source0.001247313/2912066Kernel.kind_of?
0.540.330.21393326/7866520.600.360.24415768/831536 Protobuf::Field::EnumField#decode
0.730.75 0.430.30393326/7866520.32415768/831536 Protobuf::Field::Int64Field(singleton)#set
1% 1%1.270.760.517866521.340.780.56831536 Protobuf::Field::IntegerField#decode
0.270.190.290.21 0.08786652/786915831536/831799 Numeric#nonzero?
0.250.250.260.26 0.00786558/1573117831465/1662929 Fixnum#&
1.270.330.93786652/7866521.340.360.98831536/831536 Protobuf::Field::EnumField(singleton)#set_field
1% 0%1.270.330.937866521.340.360.98831536 Protobuf::Field::EnumField#coerce!
0.830.85 0.300.53786652/11799870.55831536/1247313 Protobuf::Enum.fetch
0.110.110.120.12 0.00786652/1180209831536/1247535 Protobuf::Field::BaseField#type_class
1.221.060.16393326/393326Protobuf::Field::StringField#encode1.250.260.99415768/415768Protobuf::Field::EnumField(singleton)#encode_to_stream
1%1%1.221.060.16393326String#encode!
0.160.160.002359956/2362883Hash#default0%1.250.260.99415768Protobuf::Field::EnumField#encode
1.180.001.181/1Bundler.setup
1%0%1.180.001.181Bundler::Runtime#setup0.750.400.34415768/831536Protobuf::Field::IntegerField#encode
1.100.001.101/1Bundler::Runtime#requested_specs0.240.140.10415768/416036Protobuf::Enum#to_i
0.290.150.14786652/23599560.300.160.13831536/2910376 Protobuf::Field::EnumField(singleton)#encode_to_stream
0.380.150.22786652/23599560.350.160.19831536/2910376 Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.490.200.29786652/2359956Protobuf::Field::StringField(singleton)#encode_to_stream0.590.240.351247304/2910376Protobuf::Field::StringField#encode_to_stream
1% 0%1.160.510.6523599561.240.560.682910376 IO::GenericWritable.<<
0.650.650.680.68 0.002359956/23599562910376/2910376 StringIO#write
1.150.240.91393326/393326Protobuf::Field::EnumField(singleton)#encode_to_stream0.130.000.13160/838Array#each
1.100.001.101/838Bundler::Runtime#requested_specs
1% 0%1.150.240.91393326Protobuf::Field::EnumField#encode
0.680.390.29393326/786652Protobuf::Field::IntegerField#encode1.240.001.23838Kernel.send
0.230.150.08393326/393594Protobuf::Enum#to_i1.100.001.101/1Bundler::Definition#requested_specs
1.131.131.17 0.0010661366/10661556Hash#each_key1.171/1Bundler.setup
1%1%1.131.130%1.17 0.0010661556Protobuf::Field::BaseField#name1.171Bundler::Runtime#setup
1.100.001.101/1Bundler::Runtime#requested_specs
1 Bundler::Runtime#requested_specs
1.10 1 Bundler::Definition#requested_specs
1.101.09 0.001.101.09 1/1 Bundler::Definition#specs_for
1.101.09 0.001.101.09 1/1 Bundler::Definition#requested_specs
1% 0%1.101.09 0.001.101.09 1 Bundler::Definition#specs_for
1.081.07 0.001.081.07 1/1 Bundler::Definition#specs
1.081.07 0.001.081.07 1/1 Bundler::Definition#specs_for
1% 0%1.081.07 0.001.081.07 1 Bundler::Definition#specs
0.570.54 0.000.570.54 1/1 Bundler::Definition#resolve
0.470.49 0.000.470.49 1/1 Bundler::SpecSet#materialize
1.040.310.73393326/3933260.320.72415768/415768 Protobuf::Field::EnumField#decode
1% 0% 1.040.310.733933260.320.72415768 Protobuf::Field::EnumField#acceptable?
0.560.200.37393326/11799870.530.190.34415768/1247313 Protobuf::Enum.fetch
0.100.100.00415768/1247535Protobuf::Field::BaseField#type_class
0.460.460.005863424/12143918Protobuf::Field::Int64Field(singleton)#value_from_values
0.490.490.005863424/12143918Protobuf::Field::StringField(singleton)#value_from_values
1%1%1.021.000.0212143918Hash#fetch
1.020.010.02 1.00 1/2 Bundler.setup 1% 0% 1.020.010.02 1.00 2 Bundler.definition
0.820.01 0.810.020.80 1/1 Bundler::Definition.build
0.130.14 0.000.130.14 1/1 Bundler.configure
0.930.570.970.61 0.362359956/23599562494608/2494608 Protobuf::Decoder.decode_each_field
1% 0%0.930.570.970.61 0.3623599562494608 Protobuf::Varint.decode
0.36 0.36 0.002359956/23599562494608/2494608 ProtobufJavaHelpers::Varinter.read_varint
0.430.430.005724009/11842646Protobuf::Field::StringField(singleton)#value_from_values
0.430.430.005724009/11842646Protobuf::Field::Int64Field(singleton)#value_from_values
1%1%0.920.910.0111842646Hash#fetch
0.820.01 0.810.020.80 1/1 Bundler.definition
1% 0%0.820.01 0.810.020.80 1 Bundler::Definition.build
0.790.78 0.000.790.78 1/1 Bundler::Dsl.evaluate
0.790.530.271179978/1179978Protobuf::Enum.fetch0.320.170.15415768/1247457Protobuf::Field::StringField#encode_to_stream
0.470.240.23831536/1247457Protobuf::Field::IntegerField#encode
1% 0% 0.790.530.271179978Protobuf::Enum.enum_for_tag_integer0.410.381247457Protobuf::Field::VarintField.encode
0.140.140.380.380.001247457/1247457ProtobufJavaHelpers::Varinter.to_varint
0.780.520.271247304/1247304Protobuf::Enum.fetch
1%0%0.780.520.271247304Protobuf::Enum.enum_for_tag_integer
0.160.16 0.001179978/153869481247304/15890196 Hash#[]
0.130.130.110.11 0.001179978/11804311247304/1247757 Array#first
0.790.78 0.000.790.78 1/1 Bundler::Definition.build
1% 0%0.790.78 0.000.790.78 1 Bundler::Dsl.evaluate
0.59 1/1 Bundler::Dsl#to_definition
0.170.16 0.000.170.16 1/1 Bundler::Dsl#eval_gemfile
0.720.720.0010662776/10662778Kernel.respond_to?0.510.21831537/831537Protobuf::Field::IntegerField#coerce!
1%1%0.720% 0.720.510.21831537Protobuf::Field::IntegerField#acceptable?
0.120.12 0.0010662778Kernel.respond_to_missing?831537/2912066Kernel.kind_of?
0.710.520.18786653/786653Protobuf::Field::IntegerField#coerce!0.680.680.002910376/2910376IO::GenericWritable.<<
1% 0%0.710.520.18786653Protobuf::Field::IntegerField#acceptable?
0.100.100%0.680.68 0.00786653/2754972Kernel.kind_of?2910376StringIO#write
0.710.420.291400883/14008830.640.400.241412810/1412810 Array#each
1% 0%0.710.420.2914008830%0.640.400.241412810 Benchmark::Timing.now
0.290.290.240.24 0.001400883/14008841412810/1412811 Process.clock_gettime
0.280.160.13393326/1180131Protobuf::Field::StringField#encode0.110.110.00415768/1247305Protobuf::Message#each_field_for_serialization
0.370.210.16786652/1180131Protobuf::Field::IntegerField#encode0.530.410.13831537/1247305Protobuf::Field::StringField(singleton)#set_field
0% 0%0.660.370.291180131Protobuf::Field::VarintField.encode0.640.520.131247305Test::Resource#_protobuf_message_required_field_tags
0.290.290.130.13 0.001180131/1180131ProtobufJavaHelpers::Varinter.to_varint831537/832615Kernel.dup
0.650.650.550.55 0.002359956/2359956IO::GenericWritable.<<7265478/8096960Benchmark::IPS::Job::Entry#call_times
0% 0%0.650.650.640.64 0.002359956StringIO#write8096960Fixnum#<
0.120.120.630.63 0.00393326/1179979Protobuf::Message#each_field_for_serialization
0.530.420.11786653/1179979Protobuf::Field::StringField(singleton)#set_field10896824/10896826Kernel.respond_to?
0% 0%0.640.540.111179979Test::Resource#_protobuf_message_required_field_tags0.630.630.0010896826Kernel.respond_to_missing?
0.110.110.260.26 0.00786653/787731Kernel.dup831465/1662929Protobuf::Field::IntegerField#decode
0.540.540.340.34 0.007113788/7900374Benchmark::IPS::Job::Entry#call_times831464/1662929Protobuf::Field::IntegerField#encode
0% 0%0.630.630.610.61 0.007900374Fixnum#<1662929Fixnum#&
1 Bundler::Dsl#to_definition
0.59 0.010.581/11824160.571/1249742 Class#new
0.590.380.20786653/786653Protobuf::Field::StringField(singleton)#set_field
0%0%0.590.380.20786653Protobuf::Field::BytesField#coerce!
0.130.130.00786653/796051Module#===
0.580.57 0.01 0.57 1/1
0% 0%0.580.57 0.01 0.57 1 Bundler::Definition#initialize
0.220.23 0.000.220.23 1/1 Bundler::Definition#converge_paths
0.400.000.401/6Bundler::Definition#resolve
0%0%0.570.000.576Bundler::SpecSet#for
0.570.010.566/6Kernel.loop
0.570.54 0.000.570.54 1/1 Bundler::Definition#specs
0% 0%0.570.54 0.000.570.54 1 Bundler::Definition#resolve
0.400.34 0.000.400.34 1/6 Bundler::SpecSet#for
0.160.19 0.000.160.19 1/1 Bundler::Definition#converge_locked_specs
0.570.010.566/6Bundler::SpecSet#for0.340.000.341/6Bundler::Definition#resolve
0% 0%0.570.010.560.530.000.53 6Kernel.loop
0.360.000.35240/240Set#add?Bundler::SpecSet#for
0.190.010.18215/215Bundler::SpecSet#spec_for_dependency
0.250.250.00786558/1573117Protobuf::Field::IntegerField#decode0.530.020.516/6Kernel.loop
0.310.310.00786559/1573117Protobuf::Field::IntegerField#encode0.530.020.516/6Bundler::SpecSet#for
0% 0%0.550.550.001573117Fixnum#&0.530.020.516Kernel.loop
0.460.010.46215/215Bundler::SpecSet#spec_for_dependency
0.140.140.110.11 0.00393326/1180131Protobuf::Field::EnumField(singleton)#encode_to_stream415768/1247457Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.160.160.130.13 0.00393326/1180131Protobuf::Field::Int64Field(singleton)#encode_to_stream415768/1247457Protobuf::Field::EnumField(singleton)#encode_to_stream
0.230.230.250.25 0.00393326/1180131Protobuf::Field::StringField(singleton)#encode_to_stream415768/1247457Protobuf::Field::StringField#encode_to_stream
0% 0%0.550.540.520.51 0.0111801311247457 Protobuf::Field::BaseField#tag_encoded
0.140.000.1337/153Protobuf::Message::Fields::ClassMethods.repeated0.520.370.15831537/831537Protobuf::Field::StringField(singleton)#set_field
0%0%0.520.370.15831537Protobuf::Field::StringField#coerce!
0.330.010.32109/153Protobuf::Message::Fields::ClassMethods.optional0.510.260.25415768/415768Protobuf::Field::StringField(singleton)#set
0% 0%0.480.010.47153Protobuf::Message::Fields::ClassMethods.define_field0.510.260.25415768Protobuf::Field::StringField#decode
0.460.180.18 0.000.45153/153Protobuf::Field.build415768/415906String#+
0.470.49 0.000.470.49 1/1 Bundler::Definition#specs
0% 0%0.470.49 0.000.470.49 1 Bundler::SpecSet#materialize
0.340.37 0.000.340.37 1/223 Array#map!
0.460.000.45153/153Protobuf::Message::Fields::ClassMethods.define_field0.010.46215/215Kernel.loop
0% 0% 0.460.010.46215Bundler::SpecSet#spec_for_dependency
0.35 0.000.45153Protobuf::Field.build0.34215/336Bundler::SpecSet#lookup
0.440.010.43153/1182416Class#new0.120.000.1237/153Protobuf::Message::Fields::ClassMethods.repeated
0.450.280.17393326/393326Protobuf::Field::StringField(singleton)#set0.310.010.30109/153Protobuf::Message::Fields::ClassMethods.optional
0% 0%0.450.280.17393326Protobuf::Field::StringField#decode0.440.010.43153Protobuf::Message::Fields::ClassMethods.define_field
0.130.130.41 0.00393326/786790String#+0.41153/153Protobuf::Field.build
0.430.020.42153/153Class#new0.350.000.34215/336Bundler::SpecSet#spec_for_dependency
0% 0%0.430.02 0.42153Protobuf::Field::BaseField#initialize0.010.41336Bundler::SpecSet#lookup
0.390.000.398/50Bundler::Index.sort_specs
0.340.37 0.000.340.37 1/223 Bundler::SpecSet#materialize
0% 0%0.390.42 0.010.390.41 223 Array#map!
0.340.37 0.000.340.37 39/39 Bundler::LazySpecification#__materialize__
0.160.41 0.000.161/984Bundler::Dsl#eval_gemfile0.41153/153Protobuf::Message::Fields::ClassMethods.define_field
0% 0%0.390.190.20984BasicObject#instance_eval0.410.000.41153Protobuf::Field.build
0.150.000.151/1Bundler::Dsl#gemspec0.400.010.39153/1249742Class#new
0.360.360.39 0.002359956/2359956Protobuf::Varint.decode0.3950/193Bundler::Index.sort_specs
0% 0%0.360.360.002359956ProtobufJavaHelpers::Varinter.read_varint0.410.010.40193Enumerable#sort_by
0.380.010.371378/1520Array#<=>
0.360.39 0.000.35240/240Kernel.loop0.398/50Bundler::SpecSet#lookup
0% 0%0.360.39 0.000.35240Set#add?0.3950Bundler::Index.sort_specs
0.340.39 0.000.34240/261Set#include?0.3950/193Enumerable#sort_by
0.390.020.37153/153Class#new
0%0%0.390.020.37153Protobuf::Field::BaseField#initialize
0.370.04 0.330.000.33144/1249Bundler::DepProxy#hash1378/1439Array#<=>
0% 0%0.350.000.351249Array#hash0.390.050.341439Gem::Version#<=>
0.320.300.30 0.000.32144/390Gem::Dependency#hash1224/1224Fixnum#>
0.350.070.28393326/786652Hash#each_key0.360.240.11415768/416553Protobuf::Field::StringField#encode_to_stream
0% 0%0.350.070.28786652Protobuf::Field::EnumField(singleton)#value_from_values0.380.250.13416553BasicObject#!=
0.340.380.38 0.000.34240/261Set#add?1247457/1247457Protobuf::Field::VarintField.encode
0% 0%0.340.380.38 0.000.34261Set#include?1247457ProtobufJavaHelpers::Varinter.to_varint
0.340.000.34261/15386948Hash#[]0.380.010.371378/1520Enumerable#sort_by
0%0%0.380.010.371520Array#<=>
0.370.040.331378/1439Gem::Version#<=>
0.340.380.080.29415768/831536Hash#each_key
0%0%0.380.080.29831536Protobuf::Field::EnumField(singleton)#value_from_values
0.37 0.000.340.37 39/39 Array#map!
0% 0%0.340.37 0.000.340.37 39 Bundler::LazySpecification#__materialize__
0.230.24 0.000.230.24 38/38 Bundler::Source::Rubygems#specs
0.320.360.36 0.000.32144/390Array#hash2494608/2494608Protobuf::Varint.decode
0% 0%0.340.010.33390Gem::Dependency#hash
0.320.310.01390/390Gem::Requirement#hash0.360.360.002494608ProtobufJavaHelpers::Varinter.read_varint
0.330.16 0.000.33153/295Hash#[]0.161/933Bundler::Dsl#eval_gemfile
0% 0% 0.330.140.19933BasicObject#instance_eval
0.15 0.000.33295Bundler::DepProxy#hash0.141/1Bundler::Dsl#gemspec
0.330.110.11 0.000.33144/1249Array#hash1247313/2912066Protobuf::Enum.fetch
0.330.120.12 0.000.33109/109Kernel.require831537/2912066Protobuf::Field::IntegerField#acceptable?
0% 0%0.330.000.33109Protobuf::Message::Fields::ClassMethods.optional
0.330.01 0.32109/153Protobuf::Message::Fields::ClassMethods.define_field0.320.002912066Kernel.kind_of?
0.320.00 0.310.01390/390Gem::Dependency#hash109/109Kernel.require
0% 0% 0.320.00 0.310.01390Gem::Requirement#hash109Protobuf::Message::Fields::ClassMethods.optional
0.100.100.310.010.30109/153Protobuf::Message::Fields::ClassMethods.define_field
0%0%0.300.30 0.00786653/2754972Protobuf::Field::IntegerField#acceptable?3743574Kernel.nil?
0.110.110.300.30 0.001179987/2754972Protobuf::Enum.fetch1224/1224Gem::Version#<=>
0% 0%0.310.310.300.30 0.002754972Kernel.kind_of?1224Fixnum#>
0.290.290.001400883/1400884Benchmark::Timing.now0.210.08831536/831799Protobuf::Field::IntegerField#decode
0% 0%0.290.290.001400884Process.clock_gettime0.300.210.08831799Numeric#nonzero?
0.29 0.29 0.001180131/1180131Protobuf::Field::VarintField.encode831537/831720Protobuf::Field::StringField(singleton)#set_field
0% 0.29 0.29 0.001180131ProtobufJavaHelpers::Varinter.to_varint831720Array#delete
0.190.050.140.040.15 13/14 Gem::Specification.load
0% 0%0.290.28 0.050.230.24 14 Kernel.eval
0.230.24 0.050.1814/11824160.1914/1249742 Class#new
0.270.270.23 0.00786653/786836Protobuf::Field::StringField(singleton)#set_field0.231/2Bundler::Source::Rubygems#installed_specs
0% 0%0.280.280.26 0.00786836Array#delete0.262Bundler::Index.build
0.270.190.08786652/786915Protobuf::Field::IntegerField#decode
0%0%0.270.190.08786915Numeric#nonzero?0.200.000.201/1Bundler::RubygemsIntegration::MoreFuture#all_specs
0.240.26 0.000.240.26 1/1 Kernel.require
0% 0%0.240.26 0.000.240.26 1 Gem::Specification.load_defaults
0.240.26 0.000.240.25 1/1 Gem::Specification.each_spec
0.240.26 0.000.240.25 1/1 Gem::Specification.load_defaults
0% 0%0.240.26 0.000.240.25 1 Gem::Specification.each_spec
0.240.25 0.000.240.25 1/1 Gem::Specification.each_gemspec
0.240.25 0.000.240.25 1/1 Gem::Specification.each_spec
0% 0%0.240.25 0.000.240.25 1 Gem::Specification.each_gemspec
0.240.25 0.000.241/3950670.251/417509 Array#each
0.210.10 0.000.211/2Bundler::Source::Rubygems#installed_specs0.103/287Gem::Specification.gemspec_stubs_in
0% 0%0.240.000.232Bundler::Index.build0.250.050.20287Array#select
0.160.10 0.000.161/1Bundler::RubygemsIntegration::MoreFuture#all_specs
0.230.150.08393326/393594Protobuf::Field::EnumField#encode0.1062/62Gem::StubSpecification#valid?
0% 0%0.230.150.08393594Protobuf::Enum#to_i0.240.050.20630Array#map
0.240.14 0.10415768/416036Protobuf::Field::EnumField#encode
0%0%0.240.14 0.100.00393326/786790Protobuf::Field::StringField#encode416036Protobuf::Enum#to_i
0.130.130.24 0.00393326/786790Protobuf::Field::StringField#decode0.2438/38Bundler::LazySpecification#__materialize__
0% 0%0.240.000.2438Bundler::Source::Rubygems#specs
0.230.00 0.231/1Bundler::Source::Rubygems#installed_specs
0.240.24 0.00786790String#+1412810/1412811Benchmark::Timing.now
0% 0%0.230.230.240.24 0.002754943Kernel.nil?1412811Process.clock_gettime
0.220.23 0.000.220.23 1/142 Bundler::Definition#converge_paths
0% 0%0.230.24 0.000.230.24 142 Array#any?
0.220.23 0.000.220.23 1/1 Bundler::Definition#specs_changed?
0.23 0.00 0.2338/38Bundler::LazySpecification#__materialize__1/1Bundler::Definition#initialize
0% 0.23 0.00 0.2338Bundler::Source::Rubygems#specs1Bundler::Definition#converge_paths
0.210.23 0.000.211/1Bundler::Source::Rubygems#installed_specs0.231/142Array#any?
0.100.23 0.000.101/630Bundler::Dsl#gemspec0.231/1Array#any?
0% 0%0.220.040.18630Array#map0.230.000.231Bundler::Definition#specs_changed?
0.210.000.211/1Bundler::Definition#specs_for_source_changed?
0.10 0.10 0.000.101/2Bundler.load_gemspec415768/1247535Protobuf::Field::EnumField#acceptable?
0.120.120.00831536/1247535Protobuf::Field::EnumField#coerce!
0% 0%0.220.040.18287Array#select0.230.230.001247535Protobuf::Field::BaseField#type_class
0.220.23 0.000.220.23 1/1Bundler::Definition#initializeBundler::Source::Rubygems#specs
0% 0%0.220.23 0.000.220.23 1Bundler::Definition#converge_pathsBundler::Source::Rubygems#installed_specs
0.220.23 0.000.221/142Array#any?0.231/2Bundler::Index.build
0.220.210.21 0.000.221/1Array#any?415768/415768Protobuf::Decoder.decode_each_field
0% 0%0.220.000.221Bundler::Definition#specs_changed?
0.210.00 0.211/1Bundler::Definition#specs_for_source_changed?0.00415768StringIO#read
1 Bundler::Definition#specs_for_source_changed?
0.20 1/2 Bundler::Source::Path#specs
0.190.20 0.000.190.20 12/13 Array#each
0% 0% 0.210.010.200.000.21 13 Gem::Specification.load
0.190.050.140.040.15 13/14 Kernel.eval
0.210.20 0.000.210.20 1/1Bundler::Source::Rubygems#specsBundler::Index.build
0% 0%0.210.20 0.000.210.20 1Bundler::Source::Rubygems#installed_specsBundler::RubygemsIntegration::MoreFuture#all_specs
0.210.19 0.000.211/2Bundler::Index.build0.191/1Gem::Specification.stubs
2 Bundler::Source::Path#specs
0.20 2/2 Bundler::Source::Path#local_specs
0.160.160.002359956/2362883String#encode!0.200.020.1817/17Class#new
0% 0% 0.200.160.042362883Hash#default0.020.1817Gem::Specification#initialize
2 Bundler::Source::Path#local_specs
0.20 1 Bundler::Source::Path#load_spec_files
0.19 0.00 0.191/3950671/417509 Array#each
7 IO.open
0.18 0.080.110.10 2/2 IO#each_line
1 Bundler::Source::Path#validate_spec
0.19 1/1 Bundler::RubygemsIntegration#validate
1 Bundler::RubygemsIntegration#validate
0.18 1/1 Bundler::UI::Silent#silence
0.00 0.19 1/1Class#newBundler::Definition#resolve
0% 0.00 0.19 1Bundler::LockfileParser#initialize
0.170.010.161/395067Array#eachBundler::Definition#converge_locked_specs
0.190.19 0.00393326/393326Protobuf::Decoder.decode_each_field0.191/1Bundler::RubygemsIntegration::MoreFuture#all_specs
0% 0% 0.190.19 0.00393326StringIO#read
0.190.010.18215/215Kernel.loop
0%0% 0.190.010.18215Bundler::SpecSet#spec_for_dependency1Gem::Specification.stubs
0.190.01 0.1817/17Class#new
0%0%0.190.01 0.1817Gem::Specification#initialize
0.110.11 0.00786652/1180209Protobuf::Field::EnumField#coerce!415768/415906Protobuf::Field::StringField#decode
0% 0%0.190.190.001180209Protobuf::Field::BaseField#type_class
0.180.080.112/2IO.open
0%0% 0.180.080.112IO#each_line0.00415906String#+
1 Bundler::UI::Silent#silence
0.18 1 Gem::Specification#validate
0.170.000.171/1Bundler::Dsl.evaluate0.180.080.102/2IO.open
0% 0%0.170.000.171Bundler::Dsl#eval_gemfile
0.160.000.161/984BasicObject#instance_eval
0.160.000.161/1Bundler::Definition#resolve0.180.080.102IO#each_line
0% 0%0.160.17 0.000.161Bundler::Definition#converge_locked_specs0.179Bundler::SpecSet#each
0.16 0.16 0.001573304/1573304Protobuf::Decoder.decode_each_field1412260/1412260Array#each
0% 0.16 0.16 0.001573304StringIO#eof1412260Float#<
0.00 0.16 1/1Bundler::Index.buildBundler::Dsl.evaluate
0% 0.00 0.16 1Bundler::RubygemsIntegration::MoreFuture#all_specsBundler::Dsl#eval_gemfile
0.150.16 0.000.151/1Gem::Specification.stubs0.161/933BasicObject#instance_eval
0.16 0.16 0.001400337/1400337Array#each1663072/1663072Protobuf::Decoder.decode_each_field
0% 0.16 0.16 0.001400337Float#<1663072StringIO#eof
0%0%0.160.000.159Bundler::SpecSet#each
0.00 0.15 1/1BasicObject#instance_evalClass#new
0% 0.00 0.15 1Bundler::Dsl#gemspecBundler::LockfileParser#initialize
0.100.000.101/630Array#map0.140.020.121/417509Array#each
0.15 0.000.150.14 1/1Bundler::RubygemsIntegration::MoreFuture#all_specsBasicObject#instance_eval
0% 0% 0.15 0.000.151Gem::Specification.stubs
0%0%0.140.00 0.1410Bundler::SpecSet#sorted
0.130.000.134/4TSort.tsort1Bundler::Dsl#gemspec
0.140.00 0.1437/37Kernel.require0.001662784/1665061Protobuf::Decoder.decode_each_field
0% 0% 0.140.000.1437Protobuf::Message::Fields::ClassMethods.repeated
0.14 0.000.1337/153Protobuf::Message::Fields::ClassMethods.define_field1665061Fixnum#==
0.130.14 0.000.130.14 1/1 Bundler.definition
0% 0%0.130.14 0.000.130.14 1 Bundler.configure
0.130.14 0.000.130.14 1/1 Bundler.configure_gem_home_and_path
0.130.14 0.000.130.14 1/1 Bundler.configure
0% 0%0.130.14 0.000.130.14 1 Bundler.configure_gem_home_and_path
0.120.13 0.000.120.13 1/1 Bundler.configure_gem_path
0.13 0.13 0.001572988/1575615Protobuf::Decoder.decode_each_field
0%0%0.130.130.001575615Fixnum#==
0.130.000.134/4Bundler::SpecSet#sorted831537/832615Test::Resource#_protobuf_message_required_field_tags
0% 0% 0.130.000.134TSort.tsort
0.13 0.000.134/4TSort.tsort832615Kernel.dup
0.13 0.13 0.00786653/796051Protobuf::Field::BytesField#coerce!415768/415768Class#new
0% 0.13 0.13 0.00796051Module#===415768StringIO#initialize
0.13 0.00 0.134/4TSort.tsort1/1Bundler.configure_gem_home_and_path
0% 0.13 0.00 0.134TSort.tsort1Bundler.configure_gem_path
0.13 0.00 0.134/4Enumerable#to_a
0.110.000.1050/193Bundler::Index.sort_specs
0%0%0.130.010.12193Enumerable#sort_by1/1Bundler.use_system_gems?
0.13 0.00 0.134/8Enumerator#each1/1Bundler.configure_gem_path
0% 0.13 0.00 0.138TSort.tsort_each1Bundler.use_system_gems?
0.13 0.00 0.134/4TSort.each_strongly_connected_component1/2Bundler.configured_bundle_path
0.13 0.00 0.134/8Enumerable#to_a1/2Bundler.use_system_gems?
0% 0.13 0.00 0.138Enumerator#each2Bundler.configured_bundle_path
0.110.020.101/218Bundler.settings
0%0% 0.130.000.134/8TSort.tsort_each0.010.123Gem::Specification.gemspec_stubs_in
0.130.10 0.000.134/4TSort.tsort0.103/287Array#select
0% 0%0.130.12 0.000.134Enumerable#to_a0.1210Bundler::SpecSet#sorted
0.130.12 0.000.134/8Enumerator#each0.124/4TSort.tsort
0.130.12 0.000.134/4TSort.tsort_each0.1237/37Kernel.require
0% 0%0.130.12 0.000.134TSort.each_strongly_connected_component0.1237Protobuf::Message::Fields::ClassMethods.repeated
0.130.12 0.000.134/122Method#call0.1237/153Protobuf::Message::Fields::ClassMethods.define_field
0.130.000.134/122TSort.each_strongly_connected_component0.110.020.101/218Bundler.configured_bundle_path
0% 0%0.130.000.13122Method#call0.120.020.10218Bundler.settings
0.130.12 0.000.130.12 4/4Bundler::SpecSet#tsort_each_nodeBundler::SpecSet#sorted
0%0%0.120.000.124TSort.tsort
0.110.12 0.000.11118/118Bundler::SpecSet#tsort_each_child0.124/4TSort.tsort
0.130.12 0.000.130.12 4/4Method#callTSort.tsort
0% 0%0.130.12 0.000.130.12 4Bundler::SpecSet#tsort_each_nodeTSort.tsort
0.130.12 0.000.134/395067Array#each0.124/4Enumerable#to_a
0.130.130.12 0.001179978/1180431Protobuf::Enum.enum_for_tag_integer0.124/8Enumerator#each
0% 0%0.130.130.12 0.001180431Array#first0.128TSort.tsort_each
0.120.010.00 0.12118/118Array#each4/4TSort.each_strongly_connected_component
0%0%
0.120.010.00 0.12118TSort.each_strongly_connected_component_from4/4TSort.tsort
0% 0% 0.120.010.00 0.12336Bundler::SpecSet#lookup4Enumerable#to_a
0.110.12 0.000.108/50Bundler::Index.sort_specs0.124/8Enumerator#each
0.12 0.00 0.121/1Bundler.configure_gem_home_and_path4/8Enumerable#to_a
0% 0.12 0.00 0.121Bundler.configure_gem_path8Enumerator#each
0.12 0.00 0.121/1Bundler.use_system_gems?4/8TSort.tsort_each
0.12 0.00 0.121/1Bundler.configure_gem_path4/4TSort.tsort_each
0% 0.12 0.00 0.121Bundler.use_system_gems?4TSort.each_strongly_connected_component
0.12 0.00 0.121/2Bundler.configured_bundle_path4/122Method#call
0.12 0.00 0.121/2Bundler.use_system_gems?4/122TSort.each_strongly_connected_component
0% 0.12 0.00 0.122Bundler.configured_bundle_path122Method#call
0.100.010.091/218Bundler.settings0.120.000.124/4Bundler::SpecSet#tsort_each_node
0.120.12 0.00393326/393326Class#new0.124/4Method#call
0% 0% 0.120.12 0.00393326StringIO#initialize0.124Bundler::SpecSet#tsort_each_node
0.110.01 0.110.00786653/787731Test::Resource#_protobuf_message_required_field_tags4/417509Array#each
0%0%
0.11 0.11 0.00787731Kernel.dup405768/415768Proc#call
0% 0% 0.110.080.03583Module#module_eval0.110.00415768Protobuf::Message#to_proto
0.10 0.010.091/218Bundler.configured_bundle_path0.1062/1079Gem::StubSpecification#valid?
0% 0% 0.11 0.020.09218Bundler.settings0.101079Gem::StubSpecification#data
0.100.100.110.11 0.00383326/393326Proc#call1247304/1247757Protobuf::Enum.enum_for_tag_integer
0% 0.11 0.11 0.00393326Protobuf::Message#to_proto1247757Array#first
0.110.000.1177/79Kernel.send
0% 0% 0.110.000.1179Bundler::LockfileParser#parse_source
0.100.02 0.0873/73Bundler::LockfileParser#parse_spec0.03583Module#module_eval
0.11 0.00 0.11118/118Method#call1/1Kernel.require
0% 0.11 0.00 0.11118Bundler::SpecSet#tsort_each_child1Concurrent::Utility::NativeExtensionLoader.load_native_extensions
0.110.000.01 0.108/50Bundler::SpecSet#lookup118/118Array#each
0% 0% 0.110.000.1150Bundler::Index.sort_specs
0.110.000.01 0.1050/193Enumerable#sort_by
0%0%0.110.110.00786652String#force_encoding118TSort.each_strongly_connected_component_from
0.100.020.0873/73Bundler::LockfileParser#parse_source0.100.00831537/831706Protobuf::Message#initialize
0% 0% 0.100.020.0873Bundler::LockfileParser#parse_spec0.100.00831706Kernel.block_given?
0.10 0.00 0.101/2Array#map62/62Array#select
0% 0.10 0.00 0.102Bundler.load_gemspec
0.100.000.101/1Bundler.load_gemspec_uncached62Gem::StubSpecification#valid?
0.100.000.01 0.101/1Bundler.load_gemspec62/1079Gem::StubSpecification#data
0% 0% 0.100.00 0.101Bundler.load_gemspec_uncached
0.0026Java::JavaPackage#method_missing
@@ -67,95 +67,95 @@

Total time: 69.40

- + - + - + - + - + - + - + - - + + - + - + - - + + - + - - - + + + - + - + - - - - + + + + - + - - - + + + - + - + - + - - - + + + - + - + - + - + - + @@ -164,526 +164,454 @@

Total time: 69.40

- + - - - - + + + + - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - + + + + - + - - + + - - - - + + + + - - - + + + - - - - + + + + - + - - - - - + + + + + - + - - - - + + + + - + - - - - + + + + - - - - - - - - - - - - - - - - - - - + - - + + - - + + - + - - - - - - - - - - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - - - - - - + + + + + + - + - - - - + + + + - + - - + + + + + + + + + + + - - + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + + + - - - - + + - + - + - + - + - + - + - + - + - - - - - + + + + + - + - - - - + + + + - - - - + + + + - - - - - - + + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - + + + + - + - - - - + + + + - - - - - - - - - - + - - + + - - + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - - + + + + + @@ -693,10 +621,10 @@

Total time: 69.40

- + - + @@ -704,1301 +632,1219 @@

Total time: 69.40

- + - - - - + + + + - - - - - + + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - - - - - - - - - + - - + + - + - + - - + + - - + + - - + - - - - - + + + + + - + - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - + - - - - + + + + - + - - - + + + - + - + - - + + - + - - - - + + + + - + - - + + - - + + - + - + - - - - - + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + - + - - - - + + + + - - - - - + + + + + + + + + + + + + + - - - - - - + + + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - + + - - + + - + - - + + - + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - + - - + + - - - - + + + + - - - - + + + + - - - - - - + + + + + + - + - - - - + + + + - + - - - + + + - + - - - + + + - + + - - - - - + + + + + - - - - - - - - + + + + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + + + + + + + + + + - - - - - + + + + + + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + + - + + - - - + + - + - + + - - - + + - + - + + - - - + + - + - - - - - + + + + + - + - + + - - - + + + + + + + + + + + - + + - - - - - + + + + + - - - - - - + + + + + - - - - - - - + + + + + + + - + - - - - - + + + + + - + + - - + + - - + + - - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - - - - - - + + + + + - - - - - - + + + + + + - + + - - - - - + + + + + - - - - - - + + + + + - - - - - - - - - - - - - - - + + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - - - - - - + + + + + + - + - - - - - + + + + + - - + - - - - - + + + + + - - - - - - - - + + + + + + + + - + - - + + - - + + - + - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + - - + - - + + - - + + + - - - - + + + + - + + + + + + + + + + - - - - - + + + + + - + - - + + - - - - - - - - - - - + + - + - + - - + + - + - - + + - + - - + + - + - + - - - - + + + + - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - - + - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - + + + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - + - - + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - + - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - + - - - - - - - - - - + - - - - - - - - - - - - + + + - - + - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + @@ -2007,3325 +1853,1719 @@

Total time: 69.40

- + - - + + - - + + - - + + - + - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + - + + - - - + + - + + - - - - - + + + + + - + + + + + + + + + + + + + + + + + + + - + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - + + - - + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + - + + + + + + + + + + - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + - - + - - + + - - + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + - - - - - - - - - - - - - - + + + + + - - - - - - + + + + + - - - + + + + + + + + + + + + - - + + - - - - - + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - + - - - - - + + + + + - + + + - - - - + + - + - - - - + + + + - - - - + + + + - - - - + + + + - + - - - - - + + + + + - + + - - + + + + + + + + + + + + + + + + + + + + - - + + - - - - - + + + + + - - - - - + + + + + - + - - - - + + + + - + - - + + - + - + - - - - - - - + + + + + + + - - - - - + + + + + - + - - - - - + + + + + - + + - - - - - + + + + + - - + + + + + + + + + + - - - - - + + + + + - + - - - - - + + + + + + - - - - - + + + + + - - - - - + + + + + - + - - + + - - + + - - - - - - - - - - - - - - + + + + + - - - - - + + + + + - + - + + - - - + + - + - + + - - - + + + + + + + + + + + - - - - - - + + + + + + - + - + + - - - + + - + - + + - - - + + - - - - - - - - - - - + + + - - - + + - + - + - + - + - + - + + + + + + + + + + - + - + - + - + - + - + + - - - + + - - + + + - - - + + - + + - + + - - - + + - - + + - - - + + - - - - - - - - - - - + + + - - - + + - + + - - - - - + + + + + - - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - - + + - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - + + + + + - + - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + - + - + + - - - + + - + + - - - + + - + + - - - - - + + + + + + + + + + + + + + - + - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + - + - + + - - - + + - - - - - - - - - - + + - - - + + - + - + - - - + + + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - - + - + - + - + + - + + - - - + + - + - - + + - - + + + + + + + + + + + - - + + - - + + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - + - + - - + - - - - - - - - - - - - - - - - - - - - + - - - + + + - + - - + - - + + + - - + - - + + + - - + - + - + - + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + - + - - + - - + + + - - + - - + + + - + + + + + + + + + + - + - + - + - + - + - + - + - - - - - + + + + + - + - + - + - + - + - + - + + + + + + + + + + - + - - + + - - + + - - + + - - + + - - - - - + + + + + - - - - - + + + + + - + - + + - - - + + - - - - - + + + + + + + + + + + + + + + - - - + + - + + - + + - - - + + - - - + + - - + + - - + + - - + + - + - - + - - + + + - - + + + + + + + + + + - - + + + - + - + - + - + - + - + - + - + - - - - - + + + + + - + - + - + - + - + - + - + - + - + - - - + + + - + - + + - - - + + - + + - - - + + - + + - - - - - + + + + + - - - - - - + + + + + - + + - - - - - + + + + + - + - - - - + + + - + + - + + - - - + + - - - - - + + + + + - - - + + + - + + - - - + + - + + - + + + + + + + + + + + - - - + + - - - - - + + + + + - - - - - + + + + + - + - + + - - - + + - - - - - - - - - - + + - - - + + - + - + + - - - + + - - - - - - - - - - + + - - - + + - + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - + - - - + + + - + - - - + + + - + - - - - - + + + + + - + - + + - - - + + - - - - - - - - - - + + - - - + + - + - - - - - + + + + + - - - - - + + + + + - - - - - - - - + + + + + + + + + - + - - - + + + - - - - - - - - - - - + + - + - - - + + + - - - - - - - - - - - - + + + - + - - + + @@ -5333,37 +3573,46 @@

Total time: 69.40

- - + + - - - - - + + + + + - - - - + + + + + + + + + + + + + - + - - + + @@ -5371,75 +3620,74 @@

Total time: 69.40

- - + + + - - - + + - + - + - + - + - + - + - - + - - - - - - - - - - + - - + + - + - - - + + + + + + + + + + + - - + + + @@ -5448,8 +3696,8 @@

Total time: 69.40

- - + + @@ -5457,17 +3705,17 @@

Total time: 69.40

- - + + - + - + - - + + @@ -5476,1190 +3724,1184 @@

Total time: 69.40

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + - - + - - + + + + + - + + + + + + + + - + + + + + - - - - - - + + - - + + + + + + + + + - - - + - - - - - + + + + + - - - - - - - - - + + + + + + + - + + + - - - - - - - - - - - - - - - - + + + + + + + - + + + + + + + + + + + - - - - - - - - - - - - + - - - + - + + - - - - - - - + + + + - - - - - - - - + - + - - - + + - - - - - - - + + - - - - - + + + + - - - - - - - - - - - + + + - - - - - - - - - - - - + + - + - - - + + + - - + + + - + + - - - + + + + - - - - - - - - - - - + - - + + + - - + + + + - - - - - - - - - - + + + + + - - - - - - - - - - - + - - + + + + + - - - - + + + - - - - - + + + + - - - + + + + + + + + + + - - - - - - + + + - - + + + + + + + + + + - - - + + + + + - - - - - - + + + + + + + + - + + + + + + + - - + + - - - - - - - + + - + + + - + - - - - + + + + + + - + + + - + + - - - - - + + + + + - - - - - - - - - - - - + + - - + + + + + - - - - + + + + + + - - + + + - - - - - - - - + - + + + + - - - - - - - - - - - - - + - - + + - - - + + + + + + + + + + - - - + - - - - - - - - + - - + + - - - - - - - + + + + + + + + + + - + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - + + + - - - + + + + + - - - - - - + + - - - - + + - - - - - - - - + + + + - + + + + + + + + - - - - - + + + + + - + + - + - - + + + - - - + + + + + + + + + + + - - - - + + + + - - - - + + + - - + - - - - - - + + - - - - + + + - + + + + + + + + - + + - - + + + + + + + - - + + + + + - + + + + + + + + + - + + + + + - + + + - - + + - - - - - + - - + + + + + + + - - - - - + + + + + + + + + + + + - + + + + + + + + + + + - - - - + - - + - - - + - + - + - - - - - - - - + + + - + + + + + + - - - - - - - + + - - - - + - - - + + - + - - + + + + + + + + - - + + - + + - - - + - + + + @@ -6669,71 +4911,82 @@

Total time: 69.40

- + + + - + + + + - - - - + + + + + + - - + + + + - - + + - + + - + - - + + + - + @@ -6746,27 +4999,28 @@

Total time: 69.40

- + + - + + + - - @@ -6775,7 +5029,6 @@

Total time: 69.40

- @@ -6784,13 +5037,12 @@

Total time: 69.40

- + - @@ -6799,6 +5051,7 @@

Total time: 69.40

+ @@ -6806,13 +5059,15 @@

Total time: 69.40

- + + + @@ -6829,20 +5084,22 @@

Total time: 69.40

+ - + + @@ -6857,6 +5114,7 @@

Total time: 69.40

+ From 83f8d21a23581b9737ae475475f9400d96f4face Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Wed, 26 Dec 2018 12:52:06 -0700 Subject: [PATCH 11/93] fix interpolation issues in method definitions and code generator relying on old code and false/true probs --- lib/protobuf/code_generator.rb | 29 +- .../field/base_field_method_definitions.rb | 8 +- lib/protobuf/message.rb | 14 +- profile.html | 5916 +++++++++-------- 4 files changed, 3171 insertions(+), 2796 deletions(-) diff --git a/lib/protobuf/code_generator.rb b/lib/protobuf/code_generator.rb index 73d7d271..230a7501 100644 --- a/lib/protobuf/code_generator.rb +++ b/lib/protobuf/code_generator.rb @@ -50,6 +50,32 @@ def response_bytes end Protobuf::Field::BaseField.module_eval do + def set_without_options(message_instance, bytes) + return message_instance[name] = decode(bytes) unless repeated? + + if map? + hash = message_instance[name] + entry = decode(bytes) + # decoded value could be nil for an + # enum value that is not recognized + hash[entry.key] = entry.value unless entry.value.nil? + return hash[entry.key] + end + + return message_instance[name] << decode(bytes) unless packed? + + array = message_instance[name] + stream = StringIO.new(bytes) + + if wire_type == ::Protobuf::WireType::VARINT + array << decode(Varint.decode(stream)) until stream.eof? + elsif wire_type == ::Protobuf::WireType::FIXED64 + array << decode(stream.read(8)) until stream.eof? + elsif wire_type == ::Protobuf::WireType::FIXED32 + array << decode(stream.read(4)) until stream.eof? + end + end + # Sets a MessageField that is known to be an option. # We must allow fields to be set one at a time, as option syntax allows us to # set each field within the option using a separate "option" line. @@ -85,9 +111,6 @@ def option_set(message_field, subfield, subvalue) message_field[subfield.tag] = subvalue end end - - alias_method :set_without_options, :set - alias_method :set, :set_with_options end end end diff --git a/lib/protobuf/field/base_field_method_definitions.rb b/lib/protobuf/field/base_field_method_definitions.rb index f4207b57..5b1864a1 100644 --- a/lib/protobuf/field/base_field_method_definitions.rb +++ b/lib/protobuf/field/base_field_method_definitions.rb @@ -14,7 +14,7 @@ def self.fully_qualified_name_string(selph) def self.define_to_hash_value_to_message_hash!(selph) selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 def to_message_hash(values, result) - result["#{selph.name}"] = value_from_values(values).to_hash_value + result[#{selph.name.inspect}] = value_from_values(values).to_hash_value end RUBY end @@ -22,7 +22,7 @@ def to_message_hash(values, result) def self.define_base_to_message_hash!(selph) selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 def to_message_hash(values, result) - result["#{selph.name}"] = value_from_values(values) + result[#{selph.name.inspect}] = value_from_values(values) end RUBY end @@ -131,7 +131,7 @@ def set_field(values, value, ignore_nil_for_repeated, message_instance) unless value.is_a?(Hash) fail TypeError, <<-TYPE_ERROR Expected map value - Got '#{value.class}' for map protobuf field #{selph.name} + Got '\#{value.class}' for map protobuf field #{selph.name} TYPE_ERROR end @@ -151,7 +151,7 @@ def set_field(values, value, ignore_nil_for_repeated, message_instance) unless value.is_a?(Hash) fail TypeError, <<-TYPE_ERROR Expected map value - Got '#{value.class}' for map protobuf field #{selph.name} + Got '\#{value.class}' for map protobuf field #{selph.name} TYPE_ERROR end diff --git a/lib/protobuf/message.rb b/lib/protobuf/message.rb index 89695507..54e8621d 100644 --- a/lib/protobuf/message.rb +++ b/lib/protobuf/message.rb @@ -107,7 +107,12 @@ def each_field_for_serialization def field?(name) field = _protobuf_message_field[name] - field && field.field?(@values) + + if field + field.field?(@values) + else + false + end end alias :respond_to_has? field? ::Protobuf.deprecator.define_deprecated_methods(self, :has_field? => :field?) @@ -122,7 +127,12 @@ def inspect def respond_to_has_and_present?(key) field = _protobuf_message_field[key] - field && field.field_and_present?(@values) + + if field + field.field_and_present?(@values) + else + false + end end # Return a hash-representation of the given fields for this message type. diff --git a/profile.html b/profile.html index 2e13a6ae..fd9f6fb2 100644 --- a/profile.html +++ b/profile.html @@ -52,7 +52,7 @@

Profile Report: main

-

Total time: 63.12

+

Total time: 63.30

%Total
100% 0%69.4063.12 0.0069.4063.12 0 (top)
60.0960.13 0.0060.0960.13 1/1 Benchmark::IPS.ips
2.650.90 0.002.652/1150.902/112 Kernel.require
2.430.89 0.002.425/19040.896/1880 Kernel.require
2.400.122.280.740.040.70 1/5Fixnum#times##times
1.800.191.6124/260.460.060.4017/19 Kernel.load
2.400.122.280.740.040.70 1/5 (top)
60.0860.12 0.0060.0860.12 2/5 Benchmark::IPS::Job#run
90%96% 0%62.570.1662.4060.880.0560.83 5Fixnum#times##times
40.0840.12 0.0040.0840.12 1/1 Benchmark::IPS::Job#run_benchmark
20.00 1/1 Benchmark::IPS::Job#run_warmup
1.080.011.0610000/4157680.340.000.3310000/1018106 Protobuf::Message::Serialization::ClassMethods.decode_from
0.760.030.7310000/415768Protobuf::Encoder.encode
0.310.020.2920000/1249742Class#new
0.110.030.0810000/415768Test::Resource#status=
0.110.22 0.010.114/417509Bundler::SpecSet#tsort_each_node
0.140.020.121/417509Bundler::LockfileParser#initialize
0.190.000.191/417509Bundler::Source::Path#load_spec_files0.2110000/1018106Protobuf::Encoder.encode
0.250.10 0.000.251/4175090.101/1019611 Gem::Specification.each_gemspec
0.660.020.6420/4175090.230.000.2319/1019611 Kernel.require
20.001.6818.321/4175091.6718.331/1019611 Benchmark::IPS::Job#run_warmup
40.080.0240.061/41750940.120.0140.121/1019611 Benchmark::IPS::Job#run_benchmark
89%96% 2%61.891.8460.05417509Array#each60.791.7159.091019611##each
57.531.9455.591412256/141225657.282.7154.563377944/3377944 Benchmark::IPS::Job::Entry#call_times
0.640.400.241412810/14128100.860.430.433378485/3378485 Benchmark::Timing.now
0.200.000.2012/13Gem::Specification.load
0.190.000.191/1Bundler::Source::Path#validate_spec
0.160.160.170.17 0.001412260/1412260Float#<3377948/3377948##<
0.130.00 0.13160/838Kernel.send
0.110.010.10118/118TSort.each_strongly_connected_component_from0.003377958/17079139##+
60.0960.13 0.0060.0960.13 1/1 (top)
86%95% 0%60.0960.13 0.0060.0960.13 1 Benchmark::IPS.ips
60.0860.13 0.0060.0860.13 1/1 Benchmark::IPS::Job#run
60.0860.13 0.0060.0860.13 1/1 Benchmark::IPS.ips
86%95% 0%60.0860.13 0.0060.0860.13 1 Benchmark::IPS::Job#run
60.0860.12 0.0060.0860.12 2/5Fixnum#times##times
57.531.9455.591412256/1412256Array#each57.282.7154.563377944/3377944##each
82%2%57.531.9455.59141225690%4%57.282.7154.563377944 Benchmark::IPS::Job::Entry#call_times
55.042.2752.775853424/585395553.312.0951.2213700098/13700643 Proc#call
0.550.550.680.680.0017078042/19114271##<
0.570.57 0.007265478/8096960Fixnum#<13700098/17079139##+
55.042.2752.775853424/585395553.312.0951.2213700098/13700643 Benchmark::IPS::Job::Entry#call_times
79%84% 3%55.092.2952.80585395553.342.1051.2513700643 Proc#call
24.252.1522.105447656/544765622.712.2220.4912691992/12691992 Protobuf::Message#to_hash
12.790.3012.49405768/41576813.530.2813.241008106/1018106 Protobuf::Message::Serialization::ClassMethods.decode_from
9.780.329.45405768/4157688.820.318.511008106/1018106 Protobuf::Encoder.encode
4.230.303.92811536/12497423.980.153.831008106/2037678 Class#new
1.550.251.30405768/4157681.780.261.521008106/1018106 Test::Resource#status=
0.240.13 0.110.110.00405768/415768Protobuf::Message#to_proto1008106/1018106StringIO.new
40.0840.12 0.0040.0840.12 1/1Fixnum#times##times
57%63% 0%40.0840.12 0.0040.0840.12 1 Benchmark::IPS::Job#run_benchmark
40.080.0240.061/417509Array#each40.120.0140.121/1019611##each
9.551.867.69415768/58634258.081.326.761018106/13710099 Protobuf::Message#each_field_for_serialization
22.109.2512.855447656/586342520.495.4315.0712691992/13710099 Protobuf::Message#to_hash
45%16%31.6511.1120.545863425Hash#each_key10%28.586.7521.8313710099##each_key
3.382.760.6210895312/10896957Kernel.respond_to?6.052.163.8912691992/12691992Protobuf::Field::Int64Field(singleton)#to_message_hash
2.691.920.775863424/6279192Protobuf::Field::StringField(singleton)#value_from_values5.942.233.7012691992/12691992Protobuf::Field::StringField(singleton)#to_message_hash
2.661.890.775863424/6279192Protobuf::Field::Int64Field(singleton)#value_from_values2.122.120.0028438302/37606151##[]
2.340.691.66415768/415768Protobuf::Field::StringField#encode_to_stream1.870.601.271018106/1018106Protobuf::Field::StringField(singleton)#encode_to_stream
1.980.311.68415768/4157681.850.251.601018106/1018106 Protobuf::Field::EnumField(singleton)#encode_to_stream
1.720.291.42415768/4157681.510.281.231018106/1018106 Protobuf::Field::Int64Field(singleton)#encode_to_stream
1.671.670.0012142616/15890196Hash#[]
1.411.411.381.38 0.0010895312/10895502Protobuf::Field::BaseField#name28438302/34546940Test::Resource#_protobuf_message_field
1.311.310.0012142616/14637226Test::Resource#_protobuf_message_field0.420.090.331018106/14728204Protobuf::Field::StringField(singleton)#value_from_values
0.990.990.0010895312/13395045Hash#[]=0.370.090.281018106/14728204Protobuf::Field::Int64Field(singleton)#value_from_values
0.380.080.29415768/8315360.320.090.241018106/2036212 Protobuf::Field::EnumField(singleton)#value_from_values
24.252.1522.105447656/544765622.712.2220.4912691992/12691992 Proc#call
34%35% 3%24.252.1522.10544765622.712.2220.4912691992 Protobuf::Message#to_hash
22.109.2512.855447656/5863425Hash#each_key20.495.4315.0712691992/13710099##each_key
0.00 20.00 1/1Fixnum#times##times
28%31% 0% 20.00 0.00 1 Benchmark::IPS::Job#run_warmup
20.001.6818.321/417509Array#each1.6718.331/1019611##each
1.080.011.0610000/415768Fixnum#times0.340.000.3310000/1018106##times
12.790.3012.49405768/41576813.530.2813.241008106/1018106 Proc#call
19%21% 0%13.870.3213.5641576813.860.2913.581018106 Protobuf::Message::Serialization::ClassMethods.decode_from
12.810.3112.50415768/41576812.890.2512.641018106/1018106 Protobuf::Message::Serialization.decode_from
0.750.180.57415768/12497420.680.170.521018106/2037678 Class#new
12.810.3112.50415768/41576812.890.2512.641018106/1018106 Protobuf::Message::Serialization::ClassMethods.decode_from
18%20% 0%12.810.3112.5041576812.890.2512.641018106 Protobuf::Message::Serialization.decode_from
12.501.4711.04415768/41576812.641.6810.961018106/1018106 Protobuf::Decoder.decode_each_field
12.501.4711.04415768/41576812.641.6810.961018106/1018106 Protobuf::Message::Serialization.decode_from
18%20% 2%12.501.4711.0441576812.641.6810.961018106 Protobuf::Decoder.decode_each_field
9.561.058.511247304/12473049.120.968.153054318/3054318 Protobuf::Message::Serialization.set_field_bytes
0.970.610.362494608/24946081.060.680.396108636/6108636 Protobuf::Varint.decode
0.210.210.00415768/415768StringIO#read
0.160.160.200.20 0.001663072/16630724072424/4072424 StringIO#eof
0.140.140.180.18 0.001662784/1665061Fixnum#==4072424/4075603##==
0.760.030.7310000/415768Fixnum#times0.150.150.003054318/3054318##>>
9.780.329.45405768/415768Proc#call
15%0%10.540.3510.18415768Protobuf::Encoder.encode0.120.120.001018106/1018106StringIO#read
10.180.479.72415768/415768Protobuf::Message#each_field_for_serialization0.120.120.003054318/7126742##&
10.180.479.72415768/415768Protobuf::Encoder.encode
14%0%10.180.479.72415768Protobuf::Message#each_field_for_serialization
9.551.867.69415768/5863425Hash#each_key
0.110.110.00415768/1247305Test::Resource#_protobuf_message_required_field_tags
9.561.058.511247304/12473049.120.968.153054318/3054318 Protobuf::Decoder.decode_each_field
13%14% 1%9.561.058.5112473049.120.968.153054318 Protobuf::Message::Serialization.set_field_bytes
3.290.263.03415768/4157680.233.061018106/1018106 Protobuf::Field::EnumField(singleton)#set
2.392.21 0.252.14415768/4157681.961018106/1018106 Protobuf::Field::Int64Field(singleton)#set
2.270.272.00415768/4157682.080.241.841018106/1018106 Protobuf::Field::StringField(singleton)#set
0.320.320.330.33 0.001247304/15890196Hash#[]3054318/37606151##[]
0.24 0.24 0.001247304/146372263054318/34546940 Test::Resource#_protobuf_message_field
1.150.170.98415768/2494610Protobuf::Field::EnumField(singleton)#set0.220.010.2110000/1018106##times
1.380.241.14415768/2494610Test::Resource#status=8.820.318.511008106/1018106Proc#call
14%0%9.040.328.721018106Protobuf::Encoder.encode
8.720.448.291018106/1018106Protobuf::Message#each_field_for_serialization
1.390.151.260.161.101018106/6108638Protobuf::Field::EnumField(singleton)#set
1.400.16 1.24415768/24946101018106/6108638 Protobuf::Field::Int64Field(singleton)#set
1.490.211.28415768/24946101.440.191.251018106/6108638 Protobuf::Field::StringField(singleton)#set
2.900.552.35831538/2494610Hash#each1.550.251.301018106/6108638Test::Resource#status=
3.100.502.602036214/6108638##each
11%1%8.311.326.99249461013%2%8.751.277.486108638 Protobuf::Message#set_field
2.370.761.61831537/8315372.400.751.652036213/2036213 Protobuf::Field::StringField(singleton)#set_field
2.190.501.69831537/8315372.370.511.872036213/2036213 Protobuf::Field::Int64Field(singleton)#set_field
2.000.491.51831536/8315362.250.471.792036212/2036212 Protobuf::Field::EnumField(singleton)#set_field
0.240.240.260.26 0.001247306/15890196Hash#[]3054320/37606151##[]
0.190.190.200.20 0.001247306/146372263054320/34546940 Test::Resource#_protobuf_message_field
0.120.060.0635/1249742Kernel.require8.720.448.291018106/1018106Protobuf::Encoder.encode
13%0%8.720.448.291018106Protobuf::Message#each_field_for_serialization
8.081.326.761018106/13710099##each_key
0.150.150.001018106/3054319Test::Resource#_protobuf_message_required_field_tags
0.240.050.1914/1249742Kernel.eval6.052.163.8912691992/12691992##each_key
9%3%6.052.163.8912691992Protobuf::Field::Int64Field(singleton)#to_message_hash
2.411.910.5012691992/14728204Protobuf::Field::Int64Field(singleton)#value_from_values
1.481.480.0012691992/31497159##[]=
0.310.020.2920000/1249742Fixnum#times5.942.233.7012691992/12691992##each_key
9%3%5.942.233.7012691992Protobuf::Field::StringField(singleton)#to_message_hash
2.551.960.5912691992/14728204Protobuf::Field::StringField(singleton)#value_from_values
1.151.150.0012691992/31497159##[]=
0.400.15 0.010.39153/12497420.14153/2037678 Protobuf::Field.build
0.590.21 0.010.571/12497420.201/2037678 Bundler::Dsl#to_definition
0.750.180.57415768/12497420.680.170.521018106/2037678 Protobuf::Message::Serialization::ClassMethods.decode_from
4.230.303.92811536/12497423.980.153.831008106/2037678 Proc#call
10%1%6.950.736.2212497428%0%5.440.425.022037678 Class#new
4.660.873.78831537/8315374.430.753.682036213/2036213 Protobuf::Message#initialize
0.570.010.570.200.000.20 1/1 Bundler::Definition#initialize
0.390.020.370.140.010.13 153/153 Protobuf::Field::BaseField#initialize
0.200.020.1817/17Gem::Specification#initialize4.430.753.682036213/2036213Class#new
0.150.000.151/1Bundler::LockfileParser#initialize
7%1%4.430.753.682036213Protobuf::Message#initialize
0.130.130.00415768/415768StringIO#initialize3.520.423.102036213/2036424##each
1.440.071.372/1904Kernel.load3.520.423.102036213/2036424Protobuf::Message#initialize
5%0%3.540.433.112036424##each
2.430.002.425/1904(top)3.100.502.602036214/6108638Protobuf::Message#set_field
2.640.002.64115/1904Kernel.require3.290.233.061018106/1018106Protobuf::Message::Serialization.set_field_bytes
9%5% 0%6.510.076.441904Kernel.require3.290.233.061018106Protobuf::Field::EnumField(singleton)#set
2.210.002.211/1Bundler.setup1.800.221.581018106/1018106Protobuf::Field::EnumField#decode
0.660.020.6420/417509Array#each1.260.161.101018106/6108638Protobuf::Message#set_field
0.320.170.17 0.000.31109/109Protobuf::Message::Fields::ClassMethods.optional2036213/31497159Protobuf::Field::Int64Field(singleton)#set_field
0.260.180.18 0.000.261/1Gem::Specification.load_defaults2036212/31497159Protobuf::Field::EnumField(singleton)#set_field
0.190.200.20 0.000.192/7IO.open2036213/31497159Protobuf::Field::StringField(singleton)#set_field
0.120.060.0635/1249742Class#new1.151.150.0012691992/31497159Protobuf::Field::StringField(singleton)#to_message_hash
0.121.481.48 0.000.1237/37Protobuf::Message::Fields::ClassMethods.repeated12691992/31497159Protobuf::Field::Int64Field(singleton)#to_message_hash
5%5%3.193.190.0131497159##[]=
0.110.000.111/1Concurrent::Utility::NativeExtensionLoader.load_native_extensions0.420.090.331018106/14728204##each_key
4.660.873.78831537/831537Class#new2.551.960.5912691992/14728204Protobuf::Field::StringField(singleton)#to_message_hash
6%1%4.660.873.78831537Protobuf::Message#initialize4%3%2.972.050.9214728204Protobuf::Field::StringField(singleton)#value_from_values
3.600.702.90831537/831748Hash#each0.690.690.0013710098/28439604##fetch
0.100.100.170.17 0.00831537/831706Kernel.block_given?3054318/37606151Protobuf::Enum.enum_for_tag_integer
3.600.702.90831537/831748Protobuf::Message#initialize
5%1%3.680.752.93831748Hash#each0.260.260.003054320/37606151Protobuf::Message#set_field
2.900.552.35831538/2494610Protobuf::Message#set_field0.330.330.003054318/37606151Protobuf::Message::Serialization.set_field_bytes
3.382.760.6210895312/10896957Hash#each_key2.122.120.0028438302/37606151##each_key
4%3%3.392.770.6310896957Kernel.respond_to?4%2.902.880.0337606151##[]
0.630.630.0010896824/10896826Kernel.respond_to_missing?0.370.090.281018106/14728204##each_key
3.290.263.03415768/415768Protobuf::Message::Serialization.set_field_bytes2.411.910.5012691992/14728204Protobuf::Field::Int64Field(singleton)#to_message_hash
4%0%3.290.263.03415768Protobuf::Field::EnumField(singleton)#set
1.880.241.64415768/415768Protobuf::Field::EnumField#decode3%2.781.990.7914728204Protobuf::Field::Int64Field(singleton)#value_from_values
1.150.170.98415768/2494610Protobuf::Message#set_field0.560.560.0013710098/28439604##fetch
2.691.920.775863424/6279192Hash#each_key2.400.751.652036213/2036213Protobuf::Message#set_field
3%2%2.691.920.776279192Protobuf::Field::StringField(singleton)#value_from_values1%2.400.751.652036213Protobuf::Field::StringField(singleton)#set_field
0.490.490.005863424/12143918Hash#fetch0.620.500.122036213/3054319Test::Resource#_protobuf_message_required_field_tags
2.661.890.775863424/6279192Hash#each_key0.570.400.172036213/2036213Protobuf::Field::StringField#coerce!
3%2%2.661.890.776279192Protobuf::Field::Int64Field(singleton)#value_from_values
0.200.200.002036213/31497159##[]=
0.460.460.180.18 0.005863424/12143918Hash#fetch2036213/2036396##delete
2.650.002.652/115(top)2.370.511.872036213/2036213Protobuf::Message#set_field
3% 0%2.650.002.65115Kernel.require2.370.511.872036213Protobuf::Field::Int64Field(singleton)#set_field
2.640.002.64115/1904Kernel.require1.620.591.032036213/2036213Protobuf::Field::IntegerField#coerce!
0.160.160.170.17 0.001247304/15890196Protobuf::Enum.enum_for_tag_integer2036213/31497159##[]=
0.240.240.001247306/158901962.250.471.792036212/2036212 Protobuf::Message#set_field
3%0%2.250.471.792036212Protobuf::Field::EnumField(singleton)#set_field
0.320.320.001247304/15890196Protobuf::Message::Serialization.set_field_bytes1.530.411.122036212/2036212Protobuf::Field::EnumField#coerce!
1.671.670.180.18 0.0012142616/15890196Hash#each_key
3%3%2.472.400.0715890196Hash#[]2036212/31497159##[]=
2.392.21 0.252.14415768/4157681.961018106/1018106 Protobuf::Message::Serialization.set_field_bytes
3% 0%2.392.21 0.252.144157681.961018106 Protobuf::Field::Int64Field(singleton)#set
1.390.151.400.16 1.24415768/24946101018106/6108638 Protobuf::Message#set_field
0.750.430.32415768/8315360.560.400.161018106/2036212 Protobuf::Field::IntegerField#decode
2.370.761.61831537/831537Protobuf::Message#set_field
3%1%2.370.761.61831537Protobuf::Field::StringField(singleton)#set_field0.360.030.342/1880Kernel.load
0.530.410.13831537/1247305Test::Resource#_protobuf_message_required_field_tags0.890.000.896/1880(top)
0.520.370.15831537/831537Protobuf::Field::StringField#coerce!
0.290.290.00831537/831720Array#delete
0.180.180.90 0.00831537/13395045Hash#[]=
2.340.691.66415768/415768Hash#each_key0.90112/1880Kernel.require
3% 0%2.340.691.66415768Protobuf::Field::StringField#encode_to_stream2.150.032.121880Kernel.require
0.590.240.351247304/2910376IO::GenericWritable.<<0.750.000.751/1Bundler.setup
0.360.240.11415768/416553BasicObject#!=0.230.000.2319/1019611##each
0.320.170.15415768/1247457Protobuf::Field::VarintField.encode0.110.000.11109/109Protobuf::Message::Fields::ClassMethods.optional
0.250.250.10 0.00415768/1247457Protobuf::Field::BaseField#tag_encoded0.101/1Gem::Specification.load_defaults
2.270.272.00415768/4157682.080.241.841018106/1018106 Protobuf::Message::Serialization.set_field_bytes
3% 0%2.270.272.004157682.080.241.841018106 Protobuf::Field::StringField(singleton)#set
1.490.211.28415768/24946101.440.191.251018106/6108638 Protobuf::Message#set_field
0.510.260.40 0.25415768/4157680.161018106/1018106 Protobuf::Field::StringField#decode
2.210.002.211/1Kernel.require
3%0%2.210.002.211Bundler.setup
1.170.001.171/1Bundler::Runtime#setup
1.020.021.001/2Bundler.definition
2.190.501.69831537/831537Protobuf::Message#set_field1.870.601.271018106/1018106##each_key
3%2% 0%2.190.501.69831537Protobuf::Field::Int64Field(singleton)#set_field
1.491.87 0.600.89831537/831537Protobuf::Field::IntegerField#coerce!
0.140.140.00831537/13395045Hash#[]=1.271018106Protobuf::Field::StringField(singleton)#encode_to_stream
2.000.491.51831536/831536Protobuf::Message#set_field
2%0%2.000.491.51831536Protobuf::Field::EnumField(singleton)#set_field0.610.300.323054318/7126742IO::GenericWritable.<<
1.340.360.98831536/831536Protobuf::Field::EnumField#coerce!0.260.160.101018106/3054471Protobuf::Field::VarintField.encode
0.110.110.00831536/13395045Hash#[]=0.180.120.061018106/1018887BasicObject#!=
1.980.311.68415768/415768Hash#each_key1.850.251.601018106/1018106##each_key
2% 0%1.980.311.684157681.850.251.601018106 Protobuf::Field::EnumField(singleton)#encode_to_stream
1.250.260.99415768/4157681.230.231.011018106/1018106 Protobuf::Field::EnumField#encode
0.300.160.13831536/29103760.370.190.182036212/7126742 IO::GenericWritable.<<
0.130.130.00415768/1247457Protobuf::Field::BaseField#tag_encoded
1.880.241.64415768/415768Protobuf::Field::EnumField(singleton)#set1.780.261.521008106/1018106Proc#call
2% 0%1.880.241.64415768Protobuf::Field::EnumField#decode
1.040.320.72415768/415768Protobuf::Field::EnumField#acceptable?1.820.281.551018106Test::Resource#status=
0.600.360.24415768/831536Protobuf::Field::IntegerField#decode1.550.251.301018106/6108638Protobuf::Message#set_field
1.800.191.6124/26(top)
2%0%1.800.191.6126Kernel.load
1.440.071.372/1904Kernel.require
0.190.190.200.20 0.001247306/146372263054320/34546940 Protobuf::Message#set_field
0.24 0.24 0.001247304/146372263054318/34546940 Protobuf::Message::Serialization.set_field_bytes
1.311.311.381.38 0.0012142616/14637226Hash#each_key28438302/34546940##each_key
2% 2%1.741.741.821.82 0.001463722634546940 Test::Resource#_protobuf_message_field
1.720.291.42415768/415768Hash#each_key1.800.221.581018106/1018106Protobuf::Field::EnumField(singleton)#set
2% 0%1.720.291.42415768Protobuf::Field::Int64Field(singleton)#encode_to_stream1.800.221.581018106Protobuf::Field::EnumField#decode
0.960.490.47415768/831536Protobuf::Field::IntegerField#encode1.060.310.751018106/1018106Protobuf::Field::EnumField#acceptable?
0.52 0.35 0.160.19831536/2910376IO::GenericWritable.<<1018106/2036212Protobuf::Field::IntegerField#decode
0.110.110.00415768/1247457Protobuf::Field::BaseField#tag_encoded1.620.591.032036213/2036213Protobuf::Field::Int64Field(singleton)#set_field
2%0%1.620.591.032036213Protobuf::Field::IntegerField#coerce!
0.850.550.292036213/2036213Protobuf::Field::IntegerField#acceptable?
0.750.400.41 0.34415768/8315361018106/2036212 Protobuf::Field::EnumField#encode
0.960.490.47415768/8315360.820.430.391018106/2036212 Protobuf::Field::Int64Field(singleton)#encode_to_stream
2% 1%1.710.900.818315361.570.850.732036212 Protobuf::Field::IntegerField#encode
0.470.240.23831536/12474570.430.250.182036212/3054471 Protobuf::Field::VarintField.encode
0.340.340.290.29 0.00831464/1662929Fixnum#&2036212/7126742##&
0.110.030.0810000/415768Fixnum#times0.560.190.371018106/3054327Protobuf::Field::EnumField#acceptable?
1.550.251.30405768/415768Proc#call0.980.330.652036212/3054327Protobuf::Field::EnumField#coerce!
2% 0%1.660.281.38415768Test::Resource#status=1.540.521.023054327Protobuf::Enum.fetch
1.380.241.14415768/2494610Protobuf::Message#set_field0.870.530.343054318/3054318Protobuf::Enum.enum_for_tag_integer
0.140.140.003054327/7128126Kernel.kind_of?
1.490.600.89831537/831537Protobuf::Field::Int64Field(singleton)#set_field1.530.411.122036212/2036212Protobuf::Field::EnumField(singleton)#set_field
2% 0%1.490.600.89831537Protobuf::Field::IntegerField#coerce!1.530.411.122036212Protobuf::Field::EnumField#coerce!
0.720.510.21831537/831537Protobuf::Field::IntegerField#acceptable?0.980.330.652036212/3054327Protobuf::Enum.fetch
0.110.110.140.14 0.00831536/13395045Protobuf::Field::EnumField(singleton)#set_field2036212/3054760Protobuf::Field::BaseField#type_class
0.140.140.00831537/13395045Protobuf::Field::Int64Field(singleton)#set_field1.510.281.231018106/1018106##each_key
2%0%1.510.281.231018106Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.820.430.391018106/2036212Protobuf::Field::IntegerField#encode
0.410.190.222036212/7126742IO::GenericWritable.<<
0.370.19 0.180.180.00831537/13395045Protobuf::Field::StringField(singleton)#set_field2036212/7126742Protobuf::Field::EnumField(singleton)#encode_to_stream
0.990.990.0010895312/13395045Hash#each_key
2%2%1.461.440.0213395045Hash#[]=0.410.190.222036212/7126742Protobuf::Field::Int64Field(singleton)#encode_to_stream
1.411.410.0010895312/10895502Hash#each_key0.610.300.323054318/7126742Protobuf::Field::StringField(singleton)#encode_to_stream
2%2%1.411.411%1.390.670.727126742IO::GenericWritable.<<
0.720.72 0.0010895502Protobuf::Field::BaseField#name7126742/7126742StringIO#write
0.530.190.34415768/1247313Protobuf::Field::EnumField#acceptable?0.560.560.0013710098/28439604Protobuf::Field::Int64Field(singleton)#value_from_values
0.850.300.55831536/1247313Protobuf::Field::EnumField#coerce!0.690.690.0013710098/28439604Protobuf::Field::StringField(singleton)#value_from_values
2%2%1.301.300.0028439604##fetch
1.230.231.011018106/1018106Protobuf::Field::EnumField(singleton)#encode_to_stream
1% 0%1.380.490.901247313Protobuf::Enum.fetch1.230.231.011018106Protobuf::Field::EnumField#encode
0.780.520.271247304/1247304Protobuf::Enum.enum_for_tag_integer0.750.410.341018106/2036212Protobuf::Field::IntegerField#encode
0.260.15 0.110.110.001247313/2912066Kernel.kind_of?1018106/1018374Protobuf::Enum#to_i
0.600.360.24415768/8315360.520.350.161018106/2036212 Protobuf::Field::EnumField#decode
0.750.430.32415768/8315360.560.400.161018106/2036212 Protobuf::Field::Int64Field(singleton)#set
1% 1%1.340.780.568315361.080.750.332036212 Protobuf::Field::IntegerField#decode
0.290.210.08831536/831799Numeric#nonzero?0.230.230.002036212/7126742##&
0.260.261.060.680.396108636/6108636Protobuf::Decoder.decode_each_field
1%1%1.060.680.396108636Protobuf::Varint.decode
0.390.39 0.00831465/1662929Fixnum#&6108636/6108636ProtobufJavaHelpers::Varinter.read_varint
1.340.360.98831536/831536Protobuf::Field::EnumField(singleton)#set_field1.060.310.751018106/1018106Protobuf::Field::EnumField#decode
1% 0%1.340.360.98831536Protobuf::Field::EnumField#coerce!1.060.310.751018106Protobuf::Field::EnumField#acceptable?
0.850.300.55831536/12473130.560.190.371018106/3054327 Protobuf::Enum.fetch
0.120.120.100.10 0.00831536/12475351018106/3054760 Protobuf::Field::BaseField#type_class
1.250.260.99415768/415768Protobuf::Field::EnumField(singleton)#encode_to_stream
0.900.000.902/112(top)
1% 0%1.250.260.99415768Protobuf::Field::EnumField#encode0.900.000.90112Kernel.require
0.750.400.34415768/831536Protobuf::Field::IntegerField#encode0.900.000.90112/1880Kernel.require
0.240.140.10415768/416036Protobuf::Enum#to_i0.870.530.343054318/3054318Protobuf::Enum.fetch
1%0%0.870.530.343054318Protobuf::Enum.enum_for_tag_integer
0.300.160.13831536/2910376Protobuf::Field::EnumField(singleton)#encode_to_stream0.170.170.003054318/37606151##[]
0.350.160.19831536/2910376Protobuf::Field::Int64Field(singleton)#encode_to_stream0.170.170.003054318/3054780##first
0.590.240.351247304/2910376Protobuf::Field::StringField#encode_to_stream0.860.430.433378485/3378485##each
1% 0%1.240.560.682910376IO::GenericWritable.<<0.860.430.433378485Benchmark::Timing.now
0.680.680.430.43 0.002910376/2910376StringIO#write3378485/3378486Process.clock_gettime
0.130.000.13160/838Array#each
1.100.001.101/838Bundler::Runtime#requested_specs0.850.550.292036213/2036213Protobuf::Field::IntegerField#coerce!
1% 0%1.240.001.23838Kernel.send0.850.550.292036213Protobuf::Field::IntegerField#acceptable?
1.100.100.10 0.001.101/1Bundler::Definition#requested_specs2036213/7128126Kernel.kind_of?
1.170.150.15 0.001.171/1Bundler.setup1018106/3054319Protobuf::Message#each_field_for_serialization
0.620.500.122036213/3054319Protobuf::Field::StringField(singleton)#set_field
1%0%1.170.001.171Bundler::Runtime#setup1%0.770.660.123054319Test::Resource#_protobuf_message_required_field_tags
1.100.120.12 0.001.101/1Bundler::Runtime#requested_specs2036213/2037179Kernel.dup
1.100.680.68 0.001.101/1Bundler::Runtime#setup17078042/19114271Benchmark::IPS::Job::Entry#call_times
1%0%1.100.001.101Bundler::Runtime#requested_specs
1.101%0.770.77 0.001.101/838Kernel.send19114271##<
1.100.75 0.001.100.75 1/1Kernel.sendKernel.require
1% 0%1.100.75 0.001.100.75 1Bundler::Definition#requested_specsBundler.setup
0.390.010.391/2Bundler.definition
1.090.35 0.001.090.35 1/1Bundler::Definition#specs_forBundler::Runtime#setup
1.090.720.72 0.001.091/1Bundler::Definition#requested_specs7126742/7126742IO::GenericWritable.<<
1%0%1.091%0.720.72 0.001.091Bundler::Definition#specs_for7126742StringIO#write
1.070.130.13 0.001.071/1Bundler::Definition#specs3377958/17079139##each
1.070.570.57 0.001.071/1Bundler::Definition#specs_for13700098/17079139Benchmark::IPS::Job::Entry#call_times
1%0%1.070.001.071Bundler::Definition#specs
0.541%0.710.71 0.000.541/1Bundler::Definition#resolve17079139##+
0.490.000.491/1Bundler::SpecSet#materialize0.260.160.101018106/3054471Protobuf::Field::StringField(singleton)#encode_to_stream
1.040.320.72415768/415768Protobuf::Field::EnumField#decode0.430.250.182036212/3054471Protobuf::Field::IntegerField#encode
1% 0%1.040.320.72415768Protobuf::Field::EnumField#acceptable?0.690.410.283054471Protobuf::Field::VarintField.encode
0.530.190.34415768/1247313Protobuf::Enum.fetch0.280.280.003054471/3054471ProtobufJavaHelpers::Varinter.to_varint
0.100.100.120.12 0.00415768/1247535Protobuf::Field::BaseField#type_class3054318/7126742Protobuf::Decoder.decode_each_field
0.460.460.005863424/12143918Protobuf::Field::Int64Field(singleton)#value_from_values
0.490.490.005863424/12143918Protobuf::Field::StringField(singleton)#value_from_values
1%1%1.021.000.0212143918Hash#fetch
1.020.021.001/2Bundler.setup
1%0%1.020.021.002Bundler.definition
0.810.020.801/1Bundler::Definition.build
0.140.000.141/1Bundler.configure
0.970.610.362494608/2494608Protobuf::Decoder.decode_each_field
1%0%0.970.610.362494608Protobuf::Varint.decode
0.360.360.002494608/2494608ProtobufJavaHelpers::Varinter.read_varint
0.810.020.801/1Bundler.definition
1%0%0.810.020.801Bundler::Definition.build
0.780.000.781/1Bundler::Dsl.evaluate
0.320.170.15415768/1247457Protobuf::Field::StringField#encode_to_stream
0.470.24 0.23831536/1247457Protobuf::Field::IntegerField#encode
1%0%0.790.410.381247457Protobuf::Field::VarintField.encode
0.380.380.001247457/1247457ProtobufJavaHelpers::Varinter.to_varint
0.780.520.271247304/1247304Protobuf::Enum.fetch
1%0%0.780.520.271247304Protobuf::Enum.enum_for_tag_integer
0.160.160.001247304/15890196Hash#[]
0.110.110.23 0.001247304/1247757Array#first2036212/7126742Protobuf::Field::IntegerField#decode
0.780.290.29 0.000.781/1Bundler::Definition.build2036212/7126742Protobuf::Field::IntegerField#encode
1%0%0.780.000.781Bundler::Dsl.evaluate
0.590.000.591/1Bundler::Dsl#to_definition
0.160.000.161/1Bundler::Dsl#eval_gemfile
0.720.510.21831537/831537Protobuf::Field::IntegerField#coerce!
1%0%0.720.510.21831537Protobuf::Field::IntegerField#acceptable?
0.120.120.00831537/2912066Kernel.kind_of?
0.680.680.002910376/2910376IO::GenericWritable.<<
0%0%0.680.680.650.65 0.002910376StringIO#write7126742##&
0.640.400.241412810/1412810Array#each
0%0%0.640.57 0.400.241412810Benchmark::Timing.now
0.240.240.001412810/1412811Process.clock_gettime
0.110.110.00415768/1247305Protobuf::Message#each_field_for_serialization
0.530.410.13831537/1247305Protobuf::Field::StringField(singleton)#set_field
0%0%0.640.520.131247305Test::Resource#_protobuf_message_required_field_tags
0.130.130.00831537/832615Kernel.dup
0.550.550.007265478/8096960Benchmark::IPS::Job::Entry#call_times
0%0%0.640.640.008096960Fixnum#<
0.630.630.0010896824/10896826Kernel.respond_to?
0%0%0.630.630.0010896826Kernel.respond_to_missing?
0.260.260.00831465/1662929Protobuf::Field::IntegerField#decode
0.340.340.00831464/1662929Protobuf::Field::IntegerField#encode
0%0%0.610.610.001662929Fixnum#&
0.590.000.591/1Bundler::Dsl.evaluate
0%0%0.590.000.591Bundler::Dsl#to_definition
0.590.010.571/1249742Class#new
0.570.010.571/1Class#new
0%0%0.570.010.571Bundler::Definition#initialize
0.230.000.231/1Bundler::Definition#converge_paths
0.540.000.541/1Bundler::Definition#specs
0%0%0.540.000.541Bundler::Definition#resolve
0.340.000.341/6Bundler::SpecSet#for
0.190.000.191/1Bundler::Definition#converge_locked_specs
0.340.000.341/6Bundler::Definition#resolve
0%0%0.530.000.536Bundler::SpecSet#for
0.530.020.516/6Kernel.loop
0.530.020.516/6Bundler::SpecSet#for
0%0%0.530.020.516Kernel.loop
0.460.010.46215/215Bundler::SpecSet#spec_for_dependency
0.110.110.00415768/1247457Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.130.130.00415768/1247457Protobuf::Field::EnumField(singleton)#encode_to_stream
0.250.250.00415768/1247457Protobuf::Field::StringField#encode_to_stream
0%0%0.520.510.011247457Protobuf::Field::BaseField#tag_encoded
0.520.370.15831537/831537Protobuf::Field::StringField(singleton)#set_field
0%0%0.520.370.15831537Protobuf::Field::StringField#coerce!
0.510.260.25415768/415768Protobuf::Field::StringField(singleton)#set
0%0%0.510.260.25415768Protobuf::Field::StringField#decode
0.180.180.00415768/415906String#+
0.490.000.491/1Bundler::Definition#specs
0%0%0.490.000.491Bundler::SpecSet#materialize
0.370.000.371/223Array#map!
0.460.010.46215/215Kernel.loop
0%0%0.460.010.46215Bundler::SpecSet#spec_for_dependency
0.350.000.34215/336Bundler::SpecSet#lookup
0.120.000.1237/153Protobuf::Message::Fields::ClassMethods.repeated
0.310.010.30109/153Protobuf::Message::Fields::ClassMethods.optional
0%0%0.440.010.43153Protobuf::Message::Fields::ClassMethods.define_field
0.410.000.41153/153Protobuf::Field.build
0.350.000.34215/336Bundler::SpecSet#spec_for_dependency
0%0%0.420.010.41336Bundler::SpecSet#lookup
0.390.000.398/50Bundler::Index.sort_specs
0.370.000.371/223Bundler::SpecSet#materialize
0%0%0.420.010.41223Array#map!
0.370.000.3739/39Bundler::LazySpecification#__materialize__
0.410.000.41153/153Protobuf::Message::Fields::ClassMethods.define_field
0%0%0.410.000.41153Protobuf::Field.build
0.400.010.39153/1249742Class#new
0.390.000.3950/193Bundler::Index.sort_specs
0%0%0.410.010.40193Enumerable#sort_by
0.380.010.371378/1520Array#<=>
0.390.000.398/50Bundler::SpecSet#lookup
0%0%0.390.000.3950Bundler::Index.sort_specs
0.390.000.3950/193Enumerable#sort_by
0.390.020.37153/153Class#new
0%0%0.390.020.37153Protobuf::Field::BaseField#initialize
0.370.040.331378/1439Array#<=>
0%0%0.390.050.341439Gem::Version#<=>
0.300.300.001224/1224Fixnum#>
0.360.240.11415768/416553Protobuf::Field::StringField#encode_to_stream
0%0%0.380.250.13416553BasicObject#!=
0.380.380.001247457/1247457Protobuf::Field::VarintField.encode
0%0%0.380.380.001247457ProtobufJavaHelpers::Varinter.to_varint
0.380.010.371378/1520Enumerable#sort_by
0%0%0.380.010.371520Array#<=>
0.370.040.331378/1439Gem::Version#<=>
0.380.080.29415768/831536Hash#each_key
0%0%0.380.080.29831536Protobuf::Field::EnumField(singleton)#value_from_values
0.370.000.3739/39Array#map!
0%0%0.370.000.3739Bundler::LazySpecification#__materialize__
0.240.000.2438/38Bundler::Source::Rubygems#specs
0.360.360.002494608/2494608Protobuf::Varint.decode
0%0%0.360.360.002494608ProtobufJavaHelpers::Varinter.read_varint
0.160.000.161/933Bundler::Dsl#eval_gemfile
0%0%0.330.140.19933BasicObject#instance_eval
0.150.000.141/1Bundler::Dsl#gemspec
0.110.110.001247313/2912066Protobuf::Enum.fetch
0.120.120.00831537/2912066Protobuf::Field::IntegerField#acceptable?
0%0%0.320.320.002912066Kernel.kind_of?
0.320.000.31109/109Kernel.require
0%0%0.320.000.31109Protobuf::Message::Fields::ClassMethods.optional
0.310.010.30109/153Protobuf::Message::Fields::ClassMethods.define_field
0%0%0.300.300.003743574Kernel.nil?
0.300.300.001224/1224Gem::Version#<=>
0%0%0.300.300.001224Fixnum#>
0.290.210.08831536/831799Protobuf::Field::IntegerField#decode
0%0%0.300.210.08831799Numeric#nonzero?
0.290.290.00831537/831720Protobuf::Field::StringField(singleton)#set_field
0%0%0.290.290.00831720Array#delete
0.190.040.1513/14Gem::Specification.load
0%0%0.280.050.2414Kernel.eval
0.240.050.1914/1249742Class#new
0.230.000.231/2Bundler::Source::Rubygems#installed_specs
0%0%0.260.000.262Bundler::Index.build
0.200.000.201/1Bundler::RubygemsIntegration::MoreFuture#all_specs
0.260.000.261/1Kernel.require
0%0%0.260.000.261Gem::Specification.load_defaults
0.260.000.251/1Gem::Specification.each_spec
0.260.000.251/1Gem::Specification.load_defaults
0%0%0.260.000.251Gem::Specification.each_spec
0.250.000.251/1Gem::Specification.each_gemspec
0.250.000.251/1Gem::Specification.each_spec
0%0%0.250.000.251Gem::Specification.each_gemspec
0.250.000.251/417509Array#each
0.100.000.103/287Gem::Specification.gemspec_stubs_in
0%0%0.250.050.20287Array#select
0.100.000.1062/62Gem::StubSpecification#valid?
0%0%0.240.050.20630Array#map
0.240.140.10415768/416036Protobuf::Field::EnumField#encode
0%0%0.240.140.10416036Protobuf::Enum#to_i
0.240.000.2438/38Bundler::LazySpecification#__materialize__
0%0%0.240.000.2438Bundler::Source::Rubygems#specs
0.230.000.231/1Bundler::Source::Rubygems#installed_specs
0.240.240.001412810/1412811Benchmark::Timing.now
0%0%0.240.240.001412811Process.clock_gettime
0.230.000.231/142Bundler::Definition#converge_paths
0%0%0.240.000.24142Array#any?
0.230.000.231/1Bundler::Definition#specs_changed?
0.230.000.231/1Bundler::Definition#initialize
0%0%0.230.000.231Bundler::Definition#converge_paths
0.230.000.231/142Array#any?
0.230.000.231/1Array#any?
0%0%0.230.000.231Bundler::Definition#specs_changed?
0.210.000.211/1Bundler::Definition#specs_for_source_changed?
0.100.100.00415768/1247535Protobuf::Field::EnumField#acceptable?
0.120.120.00831536/1247535Protobuf::Field::EnumField#coerce!
0%0%0.230.230.001247535Protobuf::Field::BaseField#type_class
0.230.000.231/1Bundler::Source::Rubygems#specs
0%0%0.230.000.231Bundler::Source::Rubygems#installed_specs
0.230.000.231/2Bundler::Index.build
0.210.210.00415768/415768Protobuf::Decoder.decode_each_field
0%0%0.210.210.00415768StringIO#read
0.210.000.211/1Bundler::Definition#specs_changed?
0%0%0.210.000.211Bundler::Definition#specs_for_source_changed?
0.200.000.201/2Bundler::Source::Path#specs
0.200.000.2012/13Array#each
0%0%0.210.000.2113Gem::Specification.load
0.190.040.1513/14Kernel.eval
0.200.000.201/1Bundler::Index.build
0%0%0.200.000.201Bundler::RubygemsIntegration::MoreFuture#all_specs
0.190.000.191/1Gem::Specification.stubs
0.200.000.201/2Bundler::Definition#specs_for_source_changed?
0%0%0.200.000.202Bundler::Source::Path#specs
0.200.000.202/2Bundler::Source::Path#local_specs
0.200.020.1817/17Class#new0.172036213/2036213Protobuf::Field::StringField(singleton)#set_field
0% 0%0.200.020.1817Gem::Specification#initialize0.570.400.172036213Protobuf::Field::StringField#coerce!
0.200.000.202/2Bundler::Source::Path#specs0.460.060.4017/19(top)
0% 0%0.200.000.202Bundler::Source::Path#local_specs0.460.060.4019Kernel.load
0.200.000.201/1Bundler::Source::Path#load_spec_files0.360.030.342/1880Kernel.require
0.200.430.43 0.000.201/1Bundler::Source::Path#local_specs3378485/3378486Benchmark::Timing.now
0% 0%0.200.430.43 0.000.201Bundler::Source::Path#load_spec_files3378486Process.clock_gettime
0.190.000.191/417509Array#each0.400.250.161018106/1018106Protobuf::Field::StringField(singleton)#set
0%0%0.400.250.161018106Protobuf::Field::StringField#decode
0.190.000.192/7Kernel.require0.390.010.391/2Bundler.setup
0% 0%0.190.000.197IO.open0.390.010.392Bundler.definition
0.180.080.102/2IO#each_line0.300.000.301/1Bundler::Definition.build
0.190.390.39 0.000.191/1Array#each6108636/6108636Protobuf::Varint.decode
0% 0%0.190.000.191Bundler::Source::Path#validate_spec
0.190.390.39 0.000.191/1Bundler::RubygemsIntegration#validate6108636ProtobufJavaHelpers::Varinter.read_varint
0.190.32 0.000.191/1Bundler::Source::Path#validate_spec0.321/838Bundler::Runtime#requested_specs
0% 0%0.190.39 0.000.191Bundler::RubygemsIntegration#validate0.38838Kernel.send
0.180.32 0.000.180.32 1/1Bundler::UI::Silent#silenceBundler::Definition#requested_specs
0.190.35 0.000.190.35 1/1Bundler::Definition#resolveBundler.setup
0% 0%0.190.35 0.000.190.35 1Bundler::Definition#converge_locked_specsBundler::Runtime#setup
0.190.32 0.000.190.32 1/1Bundler::RubygemsIntegration::MoreFuture#all_specsBundler::Runtime#requested_specs
0% 0%0.190.340.34 0.000.191Gem::Specification.stubs9163848Kernel.nil?
0.180.180.100.10 0.00415768/415906Protobuf::Field::StringField#decode2036213/7128126Protobuf::Field::IntegerField#acceptable?
0.140.140.003054327/7128126Protobuf::Enum.fetch
0% 0%0.180.180.340.34 0.00415906String#+7128126Kernel.kind_of?
0.180.32 0.000.180.32 1/1Bundler::RubygemsIntegration#validateBundler::Runtime#setup
0% 0%0.180.32 0.000.180.32 1Bundler::UI::Silent#silenceBundler::Runtime#requested_specs
0.180.32 0.000.181/1Gem::Specification#validate0.321/838Kernel.send
0.180.32 0.000.180.32 1/1Bundler::UI::Silent#silenceKernel.send
0% 0%0.180.32 0.000.180.32 1Gem::Specification#validateBundler::Definition#requested_specs
0.180.080.102/2IO.open
0%0%0.180.080.102IO#each_line
0%0%0.170.32 0.000.179Bundler::SpecSet#each0.321/1Bundler::Definition#specs_for
0.160.160.32 0.001412260/1412260Array#each0.321/1Bundler::Definition#requested_specs
0% 0%0.160.160.32 0.001412260Float#<0.321Bundler::Definition#specs_for
0.160.31 0.000.160.31 1/1Bundler::Dsl.evaluateBundler::Definition#specs
0.320.090.241018106/2036212##each_key
0% 0%0.160.000.161Bundler::Dsl#eval_gemfile
0.160.000.161/933BasicObject#instance_eval0.320.090.242036212Protobuf::Field::EnumField(singleton)#value_from_values
0.160.160.31 0.001663072/1663072Protobuf::Decoder.decode_each_field0.311/1Bundler::Definition#specs_for
0% 0%0.160.160.31 0.001663072StringIO#eof0.311Bundler::Definition#specs
0.210.000.211/1Bundler::SpecSet#materialize
0.150.30 0.000.150.30 1/1Class#newBundler.definition
0% 0%0.150.30 0.000.150.30 1Bundler::LockfileParser#initializeBundler::Definition.build
0.140.020.121/417509Array#each0.290.000.291/1Bundler::Dsl.evaluate
0.150.29 0.000.140.29 1/1BasicObject#instance_evalBundler::Definition.build
0% 0%0.150.29 0.000.140.29 1Bundler::Dsl#gemspecBundler::Dsl.evaluate
0.210.000.211/1Bundler::Dsl#to_definition
0.140.140.280.28 0.001662784/1665061Protobuf::Decoder.decode_each_field3054471/3054471Protobuf::Field::VarintField.encode
0% 0%0.140.140.280.28 0.001665061Fixnum#==3054471ProtobufJavaHelpers::Varinter.to_varint
0.140.000.141/1Bundler.definition0.260.150.111018106/1018374Protobuf::Field::EnumField#encode
0% 0%0.140.000.141Bundler.configure0.260.150.111018374Protobuf::Enum#to_i
0.140.110.11 0.000.141/1Bundler.configure_gem_home_and_path1018374/1018374Protobuf::Enum#tag
0.140.000.141/1Bundler.configure0.240.130.111008106/1018106Proc#call
0% 0%0.25 0.140.111018106StringIO.new
0.110.11 0.000.141Bundler.configure_gem_home_and_path1018106/1018106StringIO#initialize
0.130.100.10 0.000.131/1Bundler.configure_gem_path1018106/3054760Protobuf::Field::EnumField#acceptable?
0.130.130.140.14 0.00831537/832615Test::Resource#_protobuf_message_required_field_tags2036212/3054760Protobuf::Field::EnumField#coerce!
0% 0%0.130.130.240.24 0.00832615Kernel.dup3054760Protobuf::Field::BaseField#type_class
0.130.130.18 0.00415768/415768Class#new0.181/400Bundler::SpecSet#materialize
0% 0%0.130.130.220.020.20400##map!
0.18 0.00415768StringIO#initialize0.1839/39Bundler::LazySpecification#__materialize__
0.130.21 0.000.130.21 1/1Bundler.configure_gem_home_and_pathBundler::Dsl.evaluate
0% 0%0.130.21 0.000.130.21 1Bundler.configure_gem_pathBundler::Dsl#to_definition
0.130.000.131/1Bundler.use_system_gems?0.210.010.201/2037678Class#new
0.130.21 0.000.130.21 1/1Bundler.configure_gem_pathBundler::Definition#specs
0% 0%0.130.21 0.000.130.21 1Bundler.use_system_gems?Bundler::SpecSet#materialize
0.130.18 0.000.131/2Bundler.configured_bundle_path0.181/400##map!
0.130.200.20 0.000.131/2Bundler.use_system_gems?4072424/4072424Protobuf::Decoder.decode_each_field
0% 0%0.130.200.20 0.000.132Bundler.configured_bundle_path4072424StringIO#eof
0.110.020.101/218Bundler.settings0.200.000.201/1Class#new
0% 0%0.130.010.123Gem::Specification.gemspec_stubs_in0.200.000.201Bundler::Definition#initialize
0.100.000.103/287Array#select0.180.120.061018106/1018887Protobuf::Field::StringField(singleton)#encode_to_stream
0% 0%0.19 0.120.000.1210Bundler::SpecSet#sorted0.061018887BasicObject#!=
0.120.180.18 0.000.124/4TSort.tsort4072424/4075603Protobuf::Decoder.decode_each_field
0.12
0%0%0.180.18 0.000.1237/37Kernel.require4075603##==
0% 0%0.120.180.18 0.000.1237Protobuf::Message::Fields::ClassMethods.repeated2036350##+
0.120.180.180.002036213/2036396Protobuf::Field::StringField(singleton)#set_field
0%0%0.180.18 0.000.1237/153Protobuf::Message::Fields::ClassMethods.define_field2036396##delete
0.110.020.101/218Bundler.configured_bundle_path0.180.000.1839/39##map!
0% 0%0.120.020.10218Bundler.settings0.180.000.1839Bundler::LazySpecification#__materialize__
0.120.170.17 0.000.124/4Bundler::SpecSet#sorted3054318/3054780Protobuf::Enum.enum_for_tag_integer
0% 0%0.120.000.124TSort.tsort
0.120.170.17 0.000.124/4TSort.tsort3054780##first
0.120.170.17 0.000.124/4TSort.tsort3377948/3377948##each
0% 0%0.120.000.124TSort.tsort
0.120.170.17 0.000.124/4Enumerable#to_a3377948##<
0.120.11 0.000.124/8Enumerator#each0.11109/153Protobuf::Message::Fields::ClassMethods.optional
0% 0%0.120.16 0.000.128TSort.tsort_each0.16153Protobuf::Message::Fields::ClassMethods.define_field
0.120.15 0.000.124/4TSort.each_strongly_connected_component0.15153/153Protobuf::Field.build
0.120.15 0.000.124/4TSort.tsort0.15153/153Protobuf::Message::Fields::ClassMethods.define_field
0% 0%0.120.15 0.000.124Enumerable#to_a0.15153Protobuf::Field.build
0.120.000.124/8Enumerator#each0.150.010.14153/2037678Class#new
0.120.150.15 0.000.124/8Enumerable#to_a3054318/3054318Protobuf::Decoder.decode_each_field
0% 0%0.120.000.128Enumerator#each
0.120.150.15 0.000.124/8TSort.tsort_each3054318##>>
0.120.000.124/4TSort.tsort_each0.140.010.13153/153Class#new
0% 0%0.120.000.124TSort.each_strongly_connected_component0.140.010.13153Protobuf::Field::BaseField#initialize
0.120.000.124/122Method#call
0%0%0.130.060.071137BasicObject#instance_eval
0.120.00 0.124/122TSort.each_strongly_connected_component0.001018106/1018106Protobuf::Decoder.decode_each_field
0% 0% 0.120.000.12122Method#call
0.12 0.000.124/4Bundler::SpecSet#tsort_each_node1018106StringIO#read
0.120.00 0.124/4Method#call0.002036213/2037179Test::Resource#_protobuf_message_required_field_tags
0% 0% 0.120.00 0.124Bundler::SpecSet#tsort_each_node
0.110.010.114/417509Array#each0.002037179Kernel.dup
0.11 0.11 0.00405768/415768Proc#call1018106/1018106StringIO.new
0% 0.11 0.11 0.00415768Protobuf::Message#to_proto1018106StringIO#initialize
0.100.010.1062/1079Gem::StubSpecification#valid?0.110.000.11109/109Kernel.require
0% 0% 0.110.020.101079Gem::StubSpecification#data0.000.11109Protobuf::Message::Fields::ClassMethods.optional
0.110.000.11109/153Protobuf::Message::Fields::ClassMethods.define_field
0.11 0.11 0.001247304/1247757Protobuf::Enum.enum_for_tag_integer1018374/1018374Protobuf::Enum#to_i
0% 0.11 0.11 0.001247757Array#first1018374Protobuf::Enum#tag
0% 0% 0.110.02 0.080.03583Module#module_eval60Kernel.eval
0.110.10 0.000.110.10 1/1 Kernel.require
0% 0%0.110.10 0.000.110.10 1Concurrent::Utility::NativeExtensionLoader.load_native_extensionsGem::Specification.load_defaults
0.110.01 0.10118/118Array#each
0%0%0.110.010.00 0.10118TSort.each_strongly_connected_component_from1/1Gem::Specification.each_spec
0.100.10 0.00831537/831706Protobuf::Message#initialize0.101/1Gem::Specification.load_defaults
0% 0% 0.100.000.101Gem::Specification.each_spec
0.10 0.00831706Kernel.block_given?0.101/1Gem::Specification.each_gemspec
0.10 0.00 0.1062/62Array#select1/1Gem::Specification.each_spec
0% 0.10 0.00 0.1062Gem::StubSpecification#valid?1Gem::Specification.each_gemspec
0.100.010.00 0.1062/1079Gem::StubSpecification#data1/1019611##each
0.10 0.10 0.0026Java::JavaPackage#method_missing
2037360##to_s
@@ -67,551 +67,569 @@

Total time: 63.12

- + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - + - - - - - - - - - - - - + + + - + - + - - - + + + - + - - - + + + - + - - - - - + + + + + + + + + + + + + + - + - - - - - + + + + + - - + - + + + + + + + + + + + - - - + + - + - + + - - - + + + + + + + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - + + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - + - - + + + - + - - - - - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - - - - + + + + - + - - - - + + + + - + - - + + - - + + - + - - + + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - + - - + + - + - - - - + + + + - + - - - - + + + + - + - + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - - - + + + - + - - - + + + - - - - + + + + - - - - - + + + + + - + - - - - + + + + - + - - - - + + + + - + - - + + - - + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - + + - + - + - + - - + + - + - + - - + + - + - + - - + + - + - - - - + + + + - - - - + + + + - + - - - - - + + + + + @@ -621,7 +639,7 @@

Total time: 63.12

- + @@ -632,270 +650,270 @@

Total time: 63.12

- + - - - - + + + + - + - - - + + + - + - - + + - + - - + + - + - - - - + + + + - + - - + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - + + - + - + - - + + - - + + - + - - + + - - + + - + - - + + - + - - + + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - + + - - + + - + - - + + - + - + - - - + + + - - - - + + + + - - - - + + + + - + - - - - + + + + @@ -905,1642 +923,1642 @@

Total time: 63.12

- + - - - - - + + + + + - - - - - + + + + + - - + + - + - - - - - + + + + + - - - - + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - + + + - + - - + + - - + + - + - - + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - - + + + + + - - - - + + + + - + - - + + - + - + - - + + - - + + - - - - - + + + + + - - - - + + + + - + - - - - + + + + - + - - + + - - + + - + - - + + - + - - + + - - + + - + - - - - + + + + - - - - + + + + - + - - - + + + - + - + - + - + - + - + - + - - - + + + - + - - - + + + - + - - - - - + + + + + - + - - - - + + + + - - - - - + + + + + - + - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - + - - - - - - - - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - + + - - + + - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - + + + + + - + - + - - - + + + - - - - - + + + + + - - - - - + + + + + - + - - + + - - + + - - - - - - - - - - - - - - + + + + + - + - + + - - - - - - - - - - - - + + - - - - - - - - + + + + + + + + - + - - + + - - + + - + - - - - + + + + - - - - + + + + - + - + - - + + - + - - + + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + + + + + + + + + + - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + - + - - - - + + + + - - - - - + + + + + - + - - - - + + + + - + - - + + - - + + - - - - - + + + + + - + - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - + - - - - + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - - - - - + + + + + - - - + + + + + + + + + + + + - - - + + + - + - - - - - + + + + + - + + + + + + + + + + - - + + - + - - + + - + - - + + - - + + - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - - - - + + + + + - - - - - - - - - - - - - - + + + + + - - + - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - - - - - - - - - - - - - - + + + + + - - - - - + + + + + - + - - + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + - + - + - + - - - - + + + + - - - - + + + + - + - - + + - + - + - - + + - + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - + - + + - - - - + + + + - - - - + + + + - - + + - + - + - + - - + + - + - - + + - + - - + + - - + + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - - - - + + + + - + - - + + - - + + - + - - - - + + + + - - - - + + + + - + - - + + - + - - - - - + + + + + - - - - - - - - - - - - - - + + + + + - + - - + - - + + + - + - - - - - + + + + + - - - - - + + + + + - + - + + - - - + + - + - - - + + + - - - + + + - + - - + + - - + + - + - - + + - - + + - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - + + + - - - - - + + + + + - + - - - - - + + + + + - - + - - + - - + + + + - - - - - + + + + + - - - - - - + + + + + + - + - - + + - - + + - - + + - - + + - - + + - - + + - + + - - - + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + - + - + + - - - + + - + - - + + - - + + @@ -2548,8 +2566,8 @@

Total time: 63.12

- - + + @@ -2558,8 +2576,8 @@

Total time: 63.12

- - + + @@ -2567,53 +2585,53 @@

Total time: 63.12

- + - - + + - - + + - - - - + + + + - + - - + + - - - + + + - + - - + + - + @@ -2623,242 +2641,242 @@

Total time: 63.12

- + - - + + - + - - + + - + - - - - + + + + - - + + - - - - + + + + - - - - + + + + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + - - + + - + + + + + + + + + + + - - + + - + @@ -2867,43 +2885,43 @@

Total time: 63.12

- + - - + + - + - + - + - + - + - + - + - + @@ -2911,694 +2929,1039 @@

Total time: 63.12

- + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - - - - - + + + + + - + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + - + + + + + + + + + + - - + - - + + + - - + - - + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + - - + + - - - - - + + + + + - - - - - - - - - - - + - - + + + - - + - - - - - + + + + + + - - + + - - + + - - + + - - + + - + - + - - - + + + - - - - - + + + + + - + - + - - - + + + - + - + - - - + + + - + - - - + + + - + - - - - - + + + + + - + - + - + - + - + - + - + - + - + - - - + + + - + - - - - - + + + + + - - - - - + + + + + - + - + + - - - + + - + + - - - + + - + - - - - - + + + + + - - - - - + + + + + - - + - - + - - + + + - - - - - + + + + + + - - + + - - - + + - - + + - - + - - + + + - - + - - + + + - - + - + - - - + + + + - - - - - + + + + + - + - - + - - + + + - - + - - + + + - + + + + + + + + + + - - + + - - + + - - + + - - + + + + + + + + + + + + - + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - + - - - + + + - + - - - + + + - + - - - - - + + + + + - + - - + - - + + + - - + - - + + + - - + - - - - - - - - - - + - - + + + + + + + + + + + + - - - - - - + + + + + - + - - - + + + + + + + + + + + - - + + + - + - - - + + + + + + + + + + + - - + + + - + - - + - - + + + - - + - - + + + + + + + + + + + + - + - + - + - + - + - + @@ -3608,1301 +3971,1280 @@

Total time: 63.12

- - + + - - + + - - + + - - + + - - - - - - - - - - - + + - - - + + - + + - - - + + - + + - + - + - + - - - - - + + + + - - - + + + + - - + + - + - - - - + + + + - + - - - + + + - - - + + + - + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + - - - - - - + + - - - - - - - - + + + + - - - - + + - + + - - + - - - - - - - - - + + + - + + + - - - - - + + + + + - - - - - - - + + + - - - + + + + + + + + + + + + - - - - - - - + + + + - - + - - - - - - - - - - + + + + - + - - + + + + + + + + + - - - - - + + + + - + + + + + + + + + - - + + + + + + + - - + - - - - + + + + + - - - + + + + + + + + + + - - + - + - - - + - - - - - - - - - + + + + + - - - - - - - - + + - - - - - + + + - + + - - - - - - - - - - - - + + - - - - - - + + + + + + + + + - - - - + + + + + + + + + - - - + - - - - - - - - - - + + + + + - - + + + + + + + - - - + + + + + + + - - - - - - - + + + - + - - - - - - - + + - - + + + - - - - - - + - - - - - - + + + - - - + + - - + + + + + + + + + + - - - - + + + + + + + - + + + + + + + + + + + + + + + - - + + + - - - - - + + + + - - - - - - - + - - + - + + - - - - + + + + + + + + + + + + - - - + + + + + - - - - - - - - - - + + + - + + + - + - - + - - - - - - + + + + + + - - - - + - - - - + + + + + + + - - - - - - + + + + - - - + - - - - - - - + + + + - - + + - - - - + - - - - - + + + + - - - + + + - - - + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + - - - + - - - - - - - - - - - + + + + + + + - - - - + + + + + - - - + + + + - + + + + - - + + + + + - - + + - - + - + - - - - - - + - - - - - - - - + + - - + + + + + + + - + + + + - - - - - - - - - - - - + - - - - - + + - + + + - - - - + + + + + + + + + + + + + + + - + + - - - - + + - - - - - + + + + + - - - - - - - - - + + + - + + - - - - - - - - - - - + + + + + + + - - + + + + + + + + + + + + + - + + - - + + + + + + + + + - - - - - - - - - + + + + + + + + + + - - + + - - - + - - + + - - - - - - - + + + - - - - + - + + + - + - - + @@ -4912,84 +5254,81 @@

Total time: 63.12

+ + + - - - - + + - - - + - - - - - + + - + - - + - - + + - - + - - - + + + + + + + - - - + - + + @@ -4999,21 +5338,24 @@

Total time: 63.12

+ + + - - + + + + + - - - @@ -5037,11 +5379,12 @@

Total time: 63.12

+ + - @@ -5051,8 +5394,8 @@

Total time: 63.12

- + @@ -5063,14 +5406,13 @@

Total time: 63.12

- + - - + @@ -5084,26 +5426,26 @@

Total time: 63.12

- + - + - + @@ -5114,7 +5456,6 @@

Total time: 63.12

- @@ -5123,6 +5464,7 @@

Total time: 63.12

+ From 07e5c92074d485ab197896e0fd8354b957f03999 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Wed, 26 Dec 2018 16:30:37 -0700 Subject: [PATCH 12/93] fix issue with hash generation --- lib/protobuf/field/base_field.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/protobuf/field/base_field.rb b/lib/protobuf/field/base_field.rb index 7cb668b7..1fdc56a9 100644 --- a/lib/protobuf/field/base_field.rb +++ b/lib/protobuf/field/base_field.rb @@ -255,6 +255,17 @@ def wire_type def fully_qualified_name_only! @name = @fully_qualified_name + + ## + # Recreate all of the meta methods as they may have used the original `name` value + # + define_hash_accessor_for_message! + define_field_p! + define_field_and_present_p! + define_set_field! + define_set_method! + define_to_message_hash! + define_encode_to_stream! end private From 8a6a87d668224adfdb5514e71ebdd93cd34e61e6 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Wed, 26 Dec 2018 17:19:15 -0700 Subject: [PATCH 13/93] use local helpers to troubleshoot encoding differences --- Gemfile | 2 ++ lib/protobuf/field/bool_field.rb | 11 +++++++---- protobuf.gemspec | 2 +- spec/encoding/extreme_values_spec.rb | Bin 1358 -> 1381 bytes 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index fa75df15..d5b5bd21 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ source 'https://rubygems.org/' +gem 'protobuf_java_helpers', :path => "~/code/protobuf_java_helpers" + gemspec diff --git a/lib/protobuf/field/bool_field.rb b/lib/protobuf/field/bool_field.rb index 530cfed8..b325acfd 100644 --- a/lib/protobuf/field/bool_field.rb +++ b/lib/protobuf/field/bool_field.rb @@ -29,10 +29,13 @@ def acceptable?(val) end def coerce!(val) - return true if TRUE_VALUES.include?(val) - return false if FALSE_VALUES.include?(val) - - fail TypeError, "Expected value of type '#{type_class}' for field #{name}, but got '#{val.class}'" + if TRUE_VALUES.include?(val) + true + elsif FALSE_VALUES.include?(val) + false + else + fail TypeError, "Expected value of type '#{type_class}' for field #{name}, but got '#{val.class}'" + end end def decode(value) diff --git a/protobuf.gemspec b/protobuf.gemspec index 4e20358a..2d9330ef 100644 --- a/protobuf.gemspec +++ b/protobuf.gemspec @@ -51,7 +51,7 @@ require "protobuf/version" s.add_development_dependency 'varint' s.add_development_dependency 'ruby-prof' elsif RUBY_PLATFORM =~ /java/i - s.add_development_dependency 'protobuf_java_helpers' + #s.add_development_dependency 'protobuf_java_helpers' s.add_development_dependency 'fast_blank_java' s.add_development_dependency 'pry' end diff --git a/spec/encoding/extreme_values_spec.rb b/spec/encoding/extreme_values_spec.rb index 477e695aa37676462eb7cbcd5cc355e2f7fc387d..6678f991028fce2a8ad5b948a1dfd6ee62a458c3 100644 GIT binary patch delta 188 zcmX@d^^|MESw`iFXJZ+aCu=d*0Lf*H3R21nU|?01T9hB3mXn`YqF`&MV4%aLJoz4@ zxGYS%I5#mT2O)2$X9`jwz@!K?#*j%KNCq&;0?Aw^bs#x~NexKuV$ueZPr+)~m{oyn uZDuVX8Op2xBukkMfaG~*@yUCbg~2RiAj!l6Qm4+M0wldzG=XFZ%Pjz6yDt6! delta 167 zcmaFLb&hMo*@@?3C+jfQOkT;TpsxT1R#mA*`SEEv`H3Y8wsr~zI$Tik{Jd0zu%Qmu z$Q+KNy;d5L-PDfy*IIjJDC+(3p}S@}8o u0d Date: Thu, 27 Dec 2018 11:49:21 -0700 Subject: [PATCH 14/93] create exception for boolean fetch/hash access but use the faster --- lib/protobuf/field/base_field.rb | 2 + .../field/base_field_method_definitions.rb | 11 +- profile.html | 5963 +++++++++-------- 3 files changed, 3058 insertions(+), 2918 deletions(-) diff --git a/lib/protobuf/field/base_field.rb b/lib/protobuf/field/base_field.rb index 1fdc56a9..7a63ece1 100644 --- a/lib/protobuf/field/base_field.rb +++ b/lib/protobuf/field/base_field.rb @@ -143,6 +143,8 @@ def define_hash_accessor_for_message! ::Protobuf::Field::BaseFieldMethodDefinitions.define_map_value_from_values!(self) elsif repeated? ::Protobuf::Field::BaseFieldMethodDefinitions.define_repeated_value_from_values!(self) + elsif type_class == ::Protobuf::Field::BoolField # boolean present check + ::Protobuf::Field::BaseFieldMethodDefinitions.define_bool_field_value_from_values!(self) else ::Protobuf::Field::BaseFieldMethodDefinitions.define_field_value_from_values!(self) end diff --git a/lib/protobuf/field/base_field_method_definitions.rb b/lib/protobuf/field/base_field_method_definitions.rb index 5b1864a1..7076f5cd 100644 --- a/lib/protobuf/field/base_field_method_definitions.rb +++ b/lib/protobuf/field/base_field_method_definitions.rb @@ -282,10 +282,19 @@ def field?(values) RUBY end + def self.define_bool_field_value_from_values!(selph) + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def value_from_values(values) + values.fetch(#{fully_qualified_name_string(selph)}) { default_value } + end + alias :value_from_values_for_serialization value_from_values + RUBY + end + def self.define_field_value_from_values!(selph) selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 def value_from_values(values) - values.fetch(#{fully_qualified_name_string(selph)}) { default_value } + values[#{fully_qualified_name_string(selph)}] || default_value end alias :value_from_values_for_serialization value_from_values RUBY diff --git a/profile.html b/profile.html index fd9f6fb2..1d3eed61 100644 --- a/profile.html +++ b/profile.html @@ -52,7 +52,7 @@

Profile Report: main

-

Total time: 63.30

+

Total time: 63.27

%Total
100% 0%63.1263.30 0.0063.1263.30 0 (top)
60.1360.08 0.0060.1360.08 1/1 Benchmark::IPS.ips
0.900.99 0.000.900.99 2/112 Kernel.require
0.890.94 0.000.890.94 6/1880 Kernel.require
0.740.77 0.040.700.72 1/5##times##times
0.460.52 0.060.400.45 17/19 Kernel.load
0.740.040.701/5(top)0.120.000.121/992490Gem::Specification.each_gemspec
60.120.13 0.0060.122/5Benchmark::IPS::Job#run
96%0%60.880.0560.835##times0.131/992490##flat_map
40.120.25 0.0040.121/1Benchmark::IPS::Job#run_benchmark0.2519/992490Kernel.require
20.000.0020.001/11.7618.251/992490 Benchmark::IPS::Job#run_warmup
0.340.000.3310000/1018106Protobuf::Message::Serialization::ClassMethods.decode_from40.080.0140.071/992490Benchmark::IPS::Job#run_benchmark
96%2%60.921.8059.12992490##each
0.220.010.2110000/1018106Protobuf::Encoder.encode57.172.6954.483301171/3301171Benchmark::IPS::Job::Entry#call_times
0.100.840.420.423301704/3301704Benchmark::Timing.now
0.150.15 0.000.101/1019611Gem::Specification.each_gemspec3301175/3301175##<
0.230.130.13 0.000.2319/1019611Kernel.require3301185/16556215##+
0.130.000.132/3Gem::Specification.gemspec_stubs_in
20.001.6718.331/1019611Benchmark::IPS::Job#run_warmup0.770.040.721/5(top)
40.120.0140.121/1019611Benchmark::IPS::Job#run_benchmark60.080.0060.082/5Benchmark::IPS::Job#run
96%2%60.791.7159.091019611##each0%60.870.0660.815##times
57.282.7154.563377944/3377944Benchmark::IPS::Job::Entry#call_times40.080.0040.081/1Benchmark::IPS::Job#run_benchmark
0.860.430.433378485/3378485Benchmark::Timing.now20.000.0020.001/1Benchmark::IPS::Job#run_warmup
0.170.170.35 0.003377948/3377948##<0.3510000/990985Protobuf::Message::Serialization::ClassMethods.decode_from
0.130.130.003377958/17079139##+0.230.010.2210000/990985Protobuf::Encoder.encode
60.1360.08 0.0060.1360.08 1/1 (top)
95%94% 0%60.1360.08 0.0060.1360.08 1 Benchmark::IPS.ips
60.1360.08 0.0060.1360.08 1/1 Benchmark::IPS::Job#run
60.1360.08 0.0060.1360.08 1/1 Benchmark::IPS.ips
95%94% 0%60.1360.08 0.0060.1360.08 1 Benchmark::IPS::Job#run
60.1260.08 0.0060.1260.08 2/5##times##times
57.282.7154.563377944/3377944##each57.172.6954.483301171/3301171##each
90% 4%57.282.7154.56337794457.172.6954.483301171 Benchmark::IPS::Job::Entry#call_times
53.312.0951.2213700098/1370064353.282.2051.0813253947/13254492 Proc#call
0.680.680.630.63 0.0017078042/19114271##<16555118/18537105##<
0.57 0.57 0.0013700098/17079139##+13253947/16556215##+
53.312.0951.2213700098/1370064353.282.2051.0813253947/13254492 Benchmark::IPS::Job::Entry#call_times
84% 3%53.342.1051.251370064353.312.2151.1013254492 Proc#call
22.712.2220.4912691992/1269199222.652.1720.4812272962/12272962 Protobuf::Message#to_hash
13.5313.54 0.2813.241008106/101810613.26980985/990985 Protobuf::Message::Serialization::ClassMethods.decode_from
8.820.318.511008106/10181068.740.308.44980985/990985 Protobuf::Encoder.encode
3.980.153.831008106/20376783.960.143.82980985/1983436 Class#new
1.781.79 0.261.521008106/10181061.53980985/990985 Test::Resource#status=
0.240.130.260.15 0.111008106/1018106980985/990985 StringIO.new
40.1240.08 0.0040.1240.08 1/1##times##times
63% 0%40.1240.08 0.0040.1240.08 1 Benchmark::IPS::Job#run_benchmark
40.1240.08 0.0140.121/1019611##each40.071/992490##each
8.081.326.761018106/137100991.336.75990985/13263948 Protobuf::Message#each_field_for_serialization
20.495.4315.0712691992/1371009920.485.3315.1412272962/13263948 Protobuf::Message#to_hash
45% 10%28.586.7521.8313710099##each_key28.566.6621.8913263948##each_key
6.052.163.8912691992/126919925.982.173.8012272962/12272962 Protobuf::Field::Int64Field(singleton)#to_message_hash
5.942.233.7012691992/126919925.722.183.5412272962/12272962 Protobuf::Field::StringField(singleton)#to_message_hash
2.122.122.452.45 0.0028438302/37606151##[]27518879/36442639##[]
1.870.601.271018106/10181061.920.631.29990985/990985 Protobuf::Field::StringField(singleton)#encode_to_stream
1.850.251.601018106/10181061.760.271.49990985/990985 Protobuf::Field::EnumField(singleton)#encode_to_stream
1.510.281.231018106/10181061.470.261.22990985/990985 Protobuf::Field::Int64Field(singleton)#encode_to_stream
1.381.381.451.45 0.0028438302/3454694027518879/33464791 Test::Resource#_protobuf_message_field
0.420.41 0.090.331018106/147282040.32990985/14254932 Protobuf::Field::StringField(singleton)#value_from_values
0.370.39 0.090.281018106/147282040.30990985/14254932 Protobuf::Field::Int64Field(singleton)#value_from_values
0.320.34 0.090.241018106/20362120.25990985/1981970 Protobuf::Field::EnumField(singleton)#value_from_values
22.712.2220.4912691992/1269199222.652.1720.4812272962/12272962 Proc#call
35% 3%22.712.2220.491269199222.652.1720.4812272962 Protobuf::Message#to_hash
20.495.4315.0712691992/13710099##each_key20.485.3315.1412272962/13263948##each_key
0.00 20.00 1/1##times##times
31% 1 Benchmark::IPS::Job#run_warmup
20.001.6718.331/1019611##each1.7618.251/992490##each
0.340.35 0.000.3310000/1018106##times0.3510000/990985##times
13.5313.54 0.2813.241008106/101810613.26980985/990985 Proc#call
21% 0%13.8613.89 0.2913.58101810613.61990985 Protobuf::Message::Serialization::ClassMethods.decode_from
12.890.2512.641018106/101810612.960.2312.73990985/990985 Protobuf::Message::Serialization.decode_from
0.680.170.650.13 0.521018106/2037678990985/1983436 Class#new
12.890.2512.641018106/101810612.960.2312.73990985/990985 Protobuf::Message::Serialization::ClassMethods.decode_from
20% 0%12.890.2512.64101810612.960.2312.73990985 Protobuf::Message::Serialization.decode_from
12.641.6810.961018106/101810612.731.7510.98990985/990985 Protobuf::Decoder.decode_each_field
12.641.6810.961018106/101810612.731.7510.98990985/990985 Protobuf::Message::Serialization.decode_from
20% 2%12.641.6810.96101810612.731.7510.98990985 Protobuf::Decoder.decode_each_field
9.120.968.153054318/30543189.211.058.172972955/2972955 Protobuf::Message::Serialization.set_field_bytes
1.060.680.396108636/61086361.040.670.375945910/5945910 Protobuf::Varint.decode
0.200.200.190.19 0.004072424/40724243963940/3963940 StringIO#eof
0.180.180.170.17 0.004072424/4075603##==3963940/3966993##==
0.150.150.140.14 0.003054318/3054318##>>2972955/2972955##>>
0.12 0.12 0.001018106/1018106StringIO#read2972955/6936895##&
0.12 0.12 0.003054318/7126742##&990985/990985StringIO#read
9.120.968.153054318/30543189.211.058.172972955/2972955 Protobuf::Decoder.decode_each_field
14% 1%9.120.968.1530543189.211.058.172972955 Protobuf::Message::Serialization.set_field_bytes
3.290.233.061018106/10181063.380.253.13990985/990985 Protobuf::Field::EnumField(singleton)#set
2.210.251.961018106/10181062.260.271.99990985/990985 Protobuf::Field::Int64Field(singleton)#set
2.080.241.841018106/10181062.020.221.80990985/990985 Protobuf::Field::StringField(singleton)#set
0.330.330.260.26 0.003054318/37606151##[]2972955/36442639##[]
0.240.240.250.25 0.003054318/345469402972955/33464791 Test::Resource#_protobuf_message_field
0.220.23 0.010.2110000/1018106##times0.2210000/990985##times
8.820.318.511008106/10181068.740.308.44980985/990985 Proc#call
14% 0%9.040.328.7210181068.970.318.66990985 Protobuf::Encoder.encode
8.720.448.291018106/10181068.660.408.26990985/990985 Protobuf::Message#each_field_for_serialization
1.26 0.16 1.101018106/6108638990985/5945912 Protobuf::Field::EnumField(singleton)#set
1.400.161.241018106/6108638Protobuf::Field::Int64Field(singleton)#set1.380.201.18990985/5945912Protobuf::Field::StringField(singleton)#set
1.440.191.251018106/6108638Protobuf::Field::StringField(singleton)#set1.410.151.26990985/5945912Protobuf::Field::Int64Field(singleton)#set
1.550.251.560.26 1.301018106/6108638990985/5945912 Test::Resource#status=
3.100.502.602036214/6108638##each3.090.542.551981972/5945912##each
13% 2%8.751.277.4861086388.701.317.395945912 Protobuf::Message#set_field
2.400.751.652036213/2036213Protobuf::Field::StringField(singleton)#set_field2.380.491.891981971/1981971Protobuf::Field::Int64Field(singleton)#set_field
2.370.511.872036213/2036213Protobuf::Field::Int64Field(singleton)#set_field2.260.731.521981971/1981971Protobuf::Field::StringField(singleton)#set_field
2.250.471.792036212/20362120.481.771981970/1981970 Protobuf::Field::EnumField(singleton)#set_field
0.260.260.290.29 0.003054320/37606151##[]2972957/36442639##[]
0.200.200.210.21 0.003054320/345469402972957/33464791 Test::Resource#_protobuf_message_field
8.720.448.291018106/10181068.660.408.26990985/990985 Protobuf::Encoder.encode
13% 0%8.720.448.2910181068.660.408.26990985 Protobuf::Message#each_field_for_serialization
8.081.326.761018106/13710099##each_key1.336.75990985/13263948##each_key
0.150.150.001018106/30543190.140.140.00990985/2972956 Test::Resource#_protobuf_message_required_field_tags
6.052.163.8912691992/12691992##each_key5.982.173.8012272962/12272962##each_key
9% 3%6.052.163.89126919925.982.173.8012272962 Protobuf::Field::Int64Field(singleton)#to_message_hash
2.411.912.341.84 0.5012691992/1472820412272962/14254932 Protobuf::Field::Int64Field(singleton)#value_from_values
1.481.481.471.47 0.0012691992/31497159##[]=12272962/30496373##[]=
5.942.233.7012691992/12691992##each_key5.722.183.5412272962/12272962##each_key
9% 3%5.942.233.70126919925.722.183.5412272962 Protobuf::Field::StringField(singleton)#to_message_hash
2.551.960.5912691992/147282042.511.930.5812272962/14254932 Protobuf::Field::StringField(singleton)#value_from_values
1.151.151.031.03 0.0012691992/31497159##[]=12272962/30496373##[]=
0.150.16 0.010.14153/20376780.15153/1983436 Protobuf::Field.build
0.210.24 0.010.201/20376780.241/1983436 Bundler::Dsl#to_definition
0.680.170.650.13 0.521018106/2037678990985/1983436 Protobuf::Message::Serialization::ClassMethods.decode_from
3.980.153.831008106/20376783.960.143.82980985/1983436 Proc#call
8% 0%5.440.425.0220376785.380.375.001983436 Class#new
4.430.753.682036213/20362130.823.611981971/1981971 Protobuf::Message#initialize
0.200.24 0.000.200.23 1/1 Bundler::Definition#initialize
0.140.15 0.010.130.15 153/153 Protobuf::Field::BaseField#initialize
4.430.753.682036213/20362130.823.611981971/1981971 Class#new
7%6% 1% 4.430.753.6820362130.823.611981971 Protobuf::Message#initialize
3.520.423.102036213/2036424##each3.440.353.091981971/1982182##each
3.520.423.102036213/20364243.440.353.091981971/1982182 Protobuf::Message#initialize
5% 0%3.540.433.112036424##each3.470.373.101982182##each
3.100.502.602036214/61086383.090.542.551981972/5945912 Protobuf::Message#set_field
3.290.233.061018106/10181063.380.253.13990985/990985 Protobuf::Message::Serialization.set_field_bytes
5% 0%3.290.233.0610181063.380.253.13990985 Protobuf::Field::EnumField(singleton)#set
1.800.221.581018106/10181061.870.251.63990985/990985 Protobuf::Field::EnumField#decode
1.26 0.16 1.101018106/6108638990985/5945912 Protobuf::Message#set_field
0.170.170.002036213/31497159Protobuf::Field::Int64Field(singleton)#set_field
0.18 0.18 0.002036212/31497159Protobuf::Field::EnumField(singleton)#set_field2972955/36442639Protobuf::Enum.enum_for_tag_integer
0.200.200.260.26 0.002036213/31497159Protobuf::Field::StringField(singleton)#set_field2972955/36442639Protobuf::Message::Serialization.set_field_bytes
1.151.150.290.29 0.0012691992/31497159Protobuf::Field::StringField(singleton)#to_message_hash2972957/36442639Protobuf::Message#set_field
1.481.482.452.45 0.0012691992/31497159Protobuf::Field::Int64Field(singleton)#to_message_hash27518879/36442639##each_key
5% 5%3.193.190.0131497159##[]=
0.420.090.331018106/14728204##each_key3.213.180.0336442639##[]
2.551.960.5912691992/14728204Protobuf::Field::StringField(singleton)#to_message_hash
4%3%2.972.050.9214728204Protobuf::Field::StringField(singleton)#value_from_values
0.690.690.150.15 0.0013710098/28439604##fetch1981971/30496373Protobuf::Field::StringField(singleton)#set_field
0.170.170.150.15 0.003054318/37606151Protobuf::Enum.enum_for_tag_integer1981971/30496373Protobuf::Field::Int64Field(singleton)#set_field
0.260.260.180.18 0.003054320/37606151Protobuf::Message#set_field1981970/30496373Protobuf::Field::EnumField(singleton)#set_field
0.330.331.031.03 0.003054318/37606151Protobuf::Message::Serialization.set_field_bytes12272962/30496373Protobuf::Field::StringField(singleton)#to_message_hash
2.122.121.471.47 0.0028438302/37606151##each_key12272962/30496373Protobuf::Field::Int64Field(singleton)#to_message_hash
4% 4%2.902.880.0337606151##[]2.992.980.0130496373##[]=
0.370.41 0.090.281018106/14728204##each_key0.32990985/14254932##each_key
2.411.910.5012691992/14728204Protobuf::Field::Int64Field(singleton)#to_message_hash2.511.930.5812272962/14254932Protobuf::Field::StringField(singleton)#to_message_hash
4% 3%2.781.990.7914728204Protobuf::Field::Int64Field(singleton)#value_from_values2.932.020.9014254932Protobuf::Field::StringField(singleton)#value_from_values
0.560.560.670.67 0.0013710098/28439604##fetch13263947/27520181##fetch
2.400.751.652036213/2036213Protobuf::Message#set_field
3%1%2.400.751.652036213Protobuf::Field::StringField(singleton)#set_field0.390.090.30990985/14254932##each_key
0.622.341.84 0.500.122036213/3054319Test::Resource#_protobuf_message_required_field_tags
0.570.400.172036213/2036213Protobuf::Field::StringField#coerce!12272962/14254932Protobuf::Field::Int64Field(singleton)#to_message_hash
0.200.200.002036213/31497159##[]=
4%3%2.721.930.8014254932Protobuf::Field::Int64Field(singleton)#value_from_values
0.180.180.550.55 0.002036213/2036396##delete13263947/27520181##fetch
2.370.511.872036213/20362132.380.491.891981971/1981971 Protobuf::Message#set_field
3% 0%2.370.511.8720362132.380.491.891981971 Protobuf::Field::Int64Field(singleton)#set_field
1.621.65 0.591.032036213/20362131.061981971/1981971 Protobuf::Field::IntegerField#coerce!
0.170.170.150.15 0.002036213/31497159##[]=1981971/30496373##[]=
2.250.471.792036212/2036212Protobuf::Message#set_field
3%0%2.250.471.792036212Protobuf::Field::EnumField(singleton)#set_field
1.53 0.411.122036212/2036212Protobuf::Field::EnumField#coerce!
0.180.180.002036212/31497159##[]=
2.210.251.961018106/1018106Protobuf::Message::Serialization.set_field_bytes
3%0%2.210.251.961018106Protobuf::Field::Int64Field(singleton)#set
1.400.161.241018106/6108638Protobuf::Message#set_field
0.560.400.161018106/2036212Protobuf::Field::IntegerField#decode
0.36 0.030.340.39 2/1880 Kernel.load
0.890.94 0.000.890.94 6/1880 (top)
0.900.99 0.000.900.99 112/1880 Kernel.require
3% 0%2.152.34 0.032.122.31 1880 Kernel.require
0.750.84 0.000.750.84 1/1 Bundler.setup
0.230.25 0.000.2319/1019611##each0.2519/992490##each
0.110.12 0.000.110.121/1Gem::Specification.load_defaults
0.120.000.12 109/109 Protobuf::Message::Fields::ClassMethods.optional
0.102.260.731.521981971/1981971Protobuf::Message#set_field
3%1%2.260.731.521981971Protobuf::Field::StringField(singleton)#set_field
0.580.460.121981971/2972956Test::Resource#_protobuf_message_required_field_tags
0.530.360.161981971/1981971Protobuf::Field::StringField#coerce!
0.170.17 0.000.101/1Gem::Specification.load_defaults1981971/1982154##delete
0.150.150.001981971/30496373##[]=
2.080.241.841018106/10181062.260.271.99990985/990985 Protobuf::Message::Serialization.set_field_bytes
3% 0%2.080.241.841018106Protobuf::Field::StringField(singleton)#set2.260.271.99990985Protobuf::Field::Int64Field(singleton)#set
1.440.191.251018106/61086381.410.151.26990985/5945912 Protobuf::Message#set_field
0.400.250.580.43 0.161018106/1018106Protobuf::Field::StringField#decode990985/1981970Protobuf::Field::IntegerField#decode
1.870.601.271018106/1018106##each_key2.250.481.771981970/1981970Protobuf::Message#set_field
2%3% 0%1.870.601.271018106Protobuf::Field::StringField(singleton)#encode_to_stream
0.610.300.323054318/7126742IO::GenericWritable.<<2.250.481.771981970Protobuf::Field::EnumField(singleton)#set_field
0.260.160.101018106/3054471Protobuf::Field::VarintField.encode1.520.371.151981970/1981970Protobuf::Field::EnumField#coerce!
0.180.120.061018106/1018887BasicObject#!=0.180.001981970/30496373##[]=
1.850.251.601018106/1018106##each_key2.020.221.80990985/990985Protobuf::Message::Serialization.set_field_bytes
2%3% 0%1.850.251.601018106Protobuf::Field::EnumField(singleton)#encode_to_stream2.020.221.80990985Protobuf::Field::StringField(singleton)#set
1.230.231.011018106/1018106Protobuf::Field::EnumField#encode1.380.201.18990985/5945912Protobuf::Message#set_field
0.370.190.182036212/7126742IO::GenericWritable.<<0.420.260.15990985/990985Protobuf::Field::StringField#decode
1.780.261.521008106/1018106Proc#call1.920.631.29990985/990985##each_key
2%0%1.823%1%1.920.631.29990985Protobuf::Field::StringField(singleton)#encode_to_stream
0.62 0.281.551018106Test::Resource#status=0.342972955/6936895IO::GenericWritable.<<
1.550.251.301018106/6108638Protobuf::Message#set_field0.270.180.09990985/2973108Protobuf::Field::VarintField.encode
0.180.120.06990985/991766BasicObject#!=
0.200.200.210.21 0.003054320/345469402972957/33464791 Protobuf::Message#set_field
0.240.240.250.25 0.003054318/345469402972955/33464791 Protobuf::Message::Serialization.set_field_bytes
1.381.381.451.45 0.0028438302/34546940##each_key27518879/33464791##each_key
2%2%1.821.823%3%1.911.91 0.003454694033464791 Test::Resource#_protobuf_message_field
1.800.221.581018106/10181061.870.251.63990985/990985 Protobuf::Field::EnumField(singleton)#set
2% 0%1.800.221.5810181061.870.251.63990985 Protobuf::Field::EnumField#decode
1.060.310.751018106/10181061.120.350.78990985/990985 Protobuf::Field::EnumField#acceptable?
0.520.350.161018106/20362120.500.360.14990985/1981970 Protobuf::Field::IntegerField#decode
1.620.591.032036213/2036213Protobuf::Field::Int64Field(singleton)#set_field1.790.261.53980985/990985Proc#call
2% 0%1.620.591.032036213Protobuf::Field::IntegerField#coerce!
0.850.550.292036213/2036213Protobuf::Field::IntegerField#acceptable?1.830.271.56990985Test::Resource#status=
0.750.410.341018106/2036212Protobuf::Field::EnumField#encode1.560.261.30990985/5945912Protobuf::Message#set_field
0.820.430.391018106/2036212Protobuf::Field::Int64Field(singleton)#encode_to_stream1.760.271.49990985/990985##each_key
2%1%1.570.850.732036212Protobuf::Field::IntegerField#encode0%1.760.271.49990985Protobuf::Field::EnumField(singleton)#encode_to_stream
0.430.250.182036212/3054471Protobuf::Field::VarintField.encode1.140.210.93990985/990985Protobuf::Field::EnumField#encode
0.290.290.002036212/7126742##&0.350.180.171981970/6936895IO::GenericWritable.<<
0.560.190.371018106/3054327Protobuf::Field::EnumField#acceptable?
0.980.330.652036212/3054327Protobuf::Field::EnumField#coerce!1.650.591.061981971/1981971Protobuf::Field::Int64Field(singleton)#set_field
2% 0%1.540.521.023054327Protobuf::Enum.fetch1.650.591.061981971Protobuf::Field::IntegerField#coerce!
0.870.530.890.600.291981971/1981971Protobuf::Field::IntegerField#acceptable?
0.570.210.37990985/2972964Protobuf::Field::EnumField#acceptable?
0.99 0.343054318/30543180.651981970/2972964Protobuf::Field::EnumField#coerce!
2%0%1.570.551.022972964Protobuf::Enum.fetch
0.870.550.322972955/2972955 Protobuf::Enum.enum_for_tag_integer
0.14 0.14 0.003054327/71281262972964/6938279 Kernel.kind_of?
1.530.411.122036212/20362121.520.371.151981970/1981970 Protobuf::Field::EnumField(singleton)#set_field
2% 0%1.530.411.1220362121.520.371.151981970 Protobuf::Field::EnumField#coerce!
0.980.330.990.34 0.652036212/30543271981970/2972964 Protobuf::Enum.fetch
0.140.140.150.15 0.002036212/30547601981970/2973397 Protobuf::Field::BaseField#type_class
0.690.380.31990985/1981970Protobuf::Field::EnumField#encode
0.830.480.35990985/1981970Protobuf::Field::Int64Field(singleton)#encode_to_stream
2%1% 1.510.281.231018106/1018106##each_key0.850.661981970Protobuf::Field::IntegerField#encode
0.410.250.161981970/2973108Protobuf::Field::VarintField.encode
0.250.250.001981970/6936895##&
1.470.261.22990985/990985##each_key
2% 0%1.510.281.2310181061.470.261.22990985 Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.820.430.391018106/20362120.830.480.35990985/1981970 Protobuf::Field::IntegerField#encode
0.410.190.222036212/71267420.390.180.211981970/6936895 IO::GenericWritable.<<
0.370.190.35 0.182036212/71267420.171981970/6936895 Protobuf::Field::EnumField(singleton)#encode_to_stream
0.410.190.222036212/71267420.390.180.211981970/6936895 Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.610.300.323054318/71267420.620.280.342972955/6936895 Protobuf::Field::StringField(singleton)#encode_to_stream
2% 1%1.390.671.370.64 0.7271267426936895 IO::GenericWritable.<<
0.72 0.72 0.007126742/71267426936895/6936895 StringIO#write
0.560.560.550.55 0.0013710098/2843960413263947/27520181 Protobuf::Field::Int64Field(singleton)#value_from_values
0.690.690.670.67 0.0013710098/2843960413263947/27520181 Protobuf::Field::StringField(singleton)#value_from_values
2% 2%1.301.301.281.27 0.0028439604##fetch27520181##fetch
1.230.231.011018106/10181061.140.210.93990985/990985 Protobuf::Field::EnumField(singleton)#encode_to_stream
1% 0%1.230.231.0110181061.140.210.93990985 Protobuf::Field::EnumField#encode
0.750.410.341018106/20362120.690.380.31990985/1981970 Protobuf::Field::IntegerField#encode
0.260.150.111018106/10183740.250.140.10990985/991253 Protobuf::Enum#to_i
0.521.12 0.350.161018106/20362120.78990985/990985Protobuf::Field::EnumField#decode
1%0%1.120.350.78990985Protobuf::Field::EnumField#acceptable?
0.570.210.37990985/2972964Protobuf::Enum.fetch
0.110.110.00990985/2973397Protobuf::Field::BaseField#type_class
0.500.360.14990985/1981970 Protobuf::Field::EnumField#decode
0.560.400.580.43 0.161018106/2036212990985/1981970 Protobuf::Field::Int64Field(singleton)#set
1% 1%1.080.750.3320362121.090.790.301981970 Protobuf::Field::IntegerField#decode
0.230.230.200.20 0.002036212/7126742##&1981970/6936895##&
1.060.680.396108636/61086361.040.670.375945910/5945910 Protobuf::Decoder.decode_each_field
1% 1%1.060.680.3961086361.040.670.375945910 Protobuf::Varint.decode
0.390.390.370.37 0.006108636/61086365945910/5945910 ProtobufJavaHelpers::Varinter.read_varint
1.060.310.751018106/1018106Protobuf::Field::EnumField#decode0.990.000.992/112(top)
1% 0%1.060.310.751018106Protobuf::Field::EnumField#acceptable?
0.560.190.371018106/3054327Protobuf::Enum.fetch0.990.000.99112Kernel.require
0.100.100.99 0.001018106/3054760Protobuf::Field::BaseField#type_class0.99112/1880Kernel.require
0.900.000.902/112(top)0.890.600.291981971/1981971Protobuf::Field::IntegerField#coerce!
1% 0%0.900.000.90112Kernel.require0.890.600.291981971Protobuf::Field::IntegerField#acceptable?
0.900.120.12 0.000.90112/1880Kernel.require1981971/6938279Kernel.kind_of?
0.870.530.343054318/30543180.550.322972955/2972955 Protobuf::Enum.fetch
1% 0% 0.870.530.3430543180.550.322972955 Protobuf::Enum.enum_for_tag_integer
0.170.170.180.18 0.003054318/37606151##[]2972955/36442639##[]
0.170.170.150.15 0.003054318/3054780##first2972955/2973417##first
0.860.430.433378485/3378485##each
1%0%0.860.430.433378485Benchmark::Timing.now
0.430.430.84 0.003378485/3378486Process.clock_gettime
0.850.550.292036213/2036213Protobuf::Field::IntegerField#coerce!0.841/1Kernel.require
1% 0%0.850.550.292036213Protobuf::Field::IntegerField#acceptable?0.840.000.841Bundler.setup
0.100.100.002036213/7128126Kernel.kind_of?0.440.010.441/2Bundler.definition
0.150.150.38 0.001018106/3054319Protobuf::Message#each_field_for_serialization0.381/1Bundler::Runtime#setup
0.620.500.122036213/3054319Protobuf::Field::StringField(singleton)#set_field0.840.420.423301704/3301704##each
1%1%0.770.660.123054319Test::Resource#_protobuf_message_required_field_tags0%0.840.420.423301704Benchmark::Timing.now
0.120.120.420.42 0.002036213/2037179Kernel.dup3301704/3301705Process.clock_gettime
0.680.680.720.72 0.0017078042/19114271Benchmark::IPS::Job::Entry#call_times6936895/6936895IO::GenericWritable.<<
1% 1%0.770.770.720.72 0.0019114271##<6936895StringIO#write
0.750.140.14 0.000.751/1Kernel.require990985/2972956Protobuf::Message#each_field_for_serialization
0.580.460.121981971/2972956Protobuf::Field::StringField(singleton)#set_field
1% 0%0.750.000.751Bundler.setup
0.390.010.391/2Bundler.definition0.720.600.122972956Test::Resource#_protobuf_message_required_field_tags
0.350.120.12 0.000.351/1Bundler::Runtime#setup1981971/1982937Kernel.dup
0.720.720.630.63 0.007126742/7126742IO::GenericWritable.<<16555118/18537105Benchmark::IPS::Job::Entry#call_times
1% 0.72 0.72 0.007126742StringIO#write18537105##<
0.13 0.13 0.003377958/17079139##each3301185/16556215##each
0.57 0.57 0.0013700098/1707913913253947/16556215 Benchmark::IPS::Job::Entry#call_times
1% 1%0.710.710.700.70 0.0017079139##+16556215##+
0.260.160.101018106/30544710.270.180.09990985/2973108 Protobuf::Field::StringField(singleton)#encode_to_stream
0.430.41 0.250.182036212/30544710.161981970/2973108 Protobuf::Field::IntegerField#encode
1% 0% 0.690.410.2830544710.430.262973108 Protobuf::Field::VarintField.encode
0.280.280.260.26 0.003054471/30544712973108/2973108 ProtobufJavaHelpers::Varinter.to_varint
0.12 0.12 0.003054318/71267422972955/6936895 Protobuf::Decoder.decode_each_field
0.230.230.200.20 0.002036212/71267421981970/6936895 Protobuf::Field::IntegerField#decode
0.290.290.250.25 0.002036212/71267421981970/6936895 Protobuf::Field::IntegerField#encode
1%1%0.650.650%0%0.570.57 0.007126742##&6936895##&
0.570.400.172036213/20362130.530.360.161981971/1981971 Protobuf::Field::StringField(singleton)#set_field
0% 0%0.570.400.1720362130.530.360.161981971 Protobuf::Field::StringField#coerce!
0.460.52 0.060.400.45 17/19 (top)
0% 0%0.460.52 0.060.400.45 19 Kernel.load
0.360.41 0.030.340.39 2/1880 Kernel.require
0.430.430.003378485/3378486Benchmark::Timing.now
0%0%0.430.430.003378486Process.clock_gettime
0.400.250.161018106/1018106Protobuf::Field::StringField(singleton)#set
0%0%0.400.250.161018106Protobuf::Field::StringField#decode
0.390.44 0.010.390.44 1/2 Bundler.setup
0% 0%0.390.44 0.010.390.44 2 Bundler.definition
0.300.35 0.000.300.35 1/1 Bundler::Definition.build
0.390.390.006108636/6108636Protobuf::Varint.decode
0%0%0.390.390.006108636ProtobufJavaHelpers::Varinter.read_varint
0.320.36 0.000.320.36 1/838 Bundler::Runtime#requested_specs
0% 0%0.390.42 0.000.380.42 838 Kernel.send
0.320.36 0.000.320.36 1/1 Bundler::Definition#requested_specs
0.350.420.42 0.000.353301704/3301705Benchmark::Timing.now
0%0%0.420.420.003301705Process.clock_gettime
0.420.260.15990985/990985Protobuf::Field::StringField(singleton)#set
0%0%0.420.260.15990985Protobuf::Field::StringField#decode
0.380.000.38 1/1 Bundler.setup
0% 0%0.350.38 0.000.350.38 1 Bundler::Runtime#setup
0.320.36 0.000.320.36 1/1 Bundler::Runtime#requested_specs
0.370.370.005945910/5945910Protobuf::Varint.decode
0% 0%0.340.340.370.37 0.0091638485945910ProtobufJavaHelpers::Varinter.read_varint
0%0%0.360.360.008919759 Kernel.nil?
0.100.100.120.12 0.002036213/71281261981971/6938279 Protobuf::Field::IntegerField#acceptable?
0.14 0.14 0.003054327/71281262972964/6938279 Protobuf::Enum.fetch
0% 0%0.340.340.360.36 0.0071281266938279 Kernel.kind_of?
0.320.36 0.000.320.36 1/1 Bundler::Runtime#setup
0% 0%0.320.36 0.000.320.36 1 Bundler::Runtime#requested_specs
0.320.36 0.000.320.36 1/838 Kernel.send
0.320.36 0.000.320.36 1/1 Kernel.send
0% 0%0.320.36 0.000.320.36 1 Bundler::Definition#requested_specs
0.320.36 0.000.320.36 1/1 Bundler::Definition#specs_for
0.320.36 0.000.320.36 1/1 Bundler::Definition#requested_specs
0% 0%0.320.36 0.000.320.36 1 Bundler::Definition#specs_for
0.310.35 0.000.310.35 1/1 Bundler::Definition#specs
0.320.090.241018106/2036212##each_key0.350.000.351/1Bundler.definition
0% 0%0.320.090.242036212Protobuf::Field::EnumField(singleton)#value_from_values0.350.000.351Bundler::Definition.build
0.340.000.341/1Bundler::Dsl.evaluate
0.310.35 0.000.310.35 1/1 Bundler::Definition#specs_for
0% 0%0.310.35 0.000.310.35 1 Bundler::Definition#specs
0.210.22 0.000.210.22 1/1 Bundler::SpecSet#materialize
0.110.000.111/1Bundler::Definition#resolve
0.300.34 0.000.300.34 1/1Bundler.definitionBundler::Definition.build
0% 0%0.300.34 0.000.300.34 1Bundler::Definition.buildBundler::Dsl.evaluate
0.290.24 0.000.290.241/1Bundler::Dsl#to_definition
0.340.090.25990985/1981970##each_key
0%0%0.340.090.251981970Protobuf::Field::EnumField(singleton)#value_from_values
0.260.150.11980985/990985Proc#call
0%0%0.270.150.12990985StringIO.new
0.120.120.00990985/990985StringIO#initialize
0.110.110.00990985/2973397Protobuf::Field::EnumField#acceptable?
0.150.150.001981970/2973397Protobuf::Field::EnumField#coerce!
0%0%0.270.270.002973397Protobuf::Field::BaseField#type_class
0.260.260.002973108/2973108Protobuf::Field::VarintField.encode
0%0%0.260.260.002973108ProtobufJavaHelpers::Varinter.to_varint
0.250.140.10990985/991253Protobuf::Field::EnumField#encode
0%0%0.250.140.10991253Protobuf::Enum#to_i
0.100.100.00991253/991253Protobuf::Enum#tag
0.240.000.24 1/1 Bundler::Dsl.evaluate
0%0%0.240.000.241Bundler::Dsl#to_definition
0.240.010.241/1983436Class#new
0.290.24 0.000.290.23 1/1Bundler::Definition.buildClass#new
0% 0%0.290.24 0.000.290.23 1Bundler::Dsl.evaluateBundler::Definition#initialize
0.210.19 0.000.210.191/400Bundler::SpecSet#materialize
0%0%0.230.020.22400##map!
0.190.000.1939/39Bundler::LazySpecification#__materialize__
0.220.000.22 1/1Bundler::Dsl#to_definitionBundler::Definition#specs
0%0%0.220.000.221Bundler::SpecSet#materialize
0.190.000.191/400##map!
0.280.280.19 0.003054471/3054471Protobuf::Field::VarintField.encode0.1939/39##map!
0% 0%0.280.280.19 0.003054471ProtobufJavaHelpers::Varinter.to_varint0.1939Bundler::LazySpecification#__materialize__
0.160.000.1638/38Bundler::Source::Rubygems#specs
0%0%0.190.190.001982108##+
0.260.150.190.190.003963940/3963940Protobuf::Decoder.decode_each_field
0%0%0.190.190.003963940StringIO#eof
0.100.100.003/642Gem::Specification.gemspec_stubs_in
0%0%0.19 0.111018106/1018374Protobuf::Field::EnumField#encode0.07642##map
0.180.120.06990985/991766Protobuf::Field::StringField(singleton)#encode_to_stream
0%0%0.180.120.06991766BasicObject#!=
0.120.000.11109/153Protobuf::Message::Fields::ClassMethods.optional
0%0%0.180.000.17153Protobuf::Message::Fields::ClassMethods.define_field
0.170.000.17153/153Protobuf::Field.build
0.170.170.001981971/1982154Protobuf::Field::StringField(singleton)#set_field
0% 0%0.260.150.111018374Protobuf::Enum#to_i
0.110.110.170.17 0.001018374/1018374Protobuf::Enum#tag1982154##delete
0.240.130.111008106/1018106Proc#call0.170.000.17153/153Protobuf::Message::Fields::ClassMethods.define_field
0% 0%0.250.140.111018106StringIO.new
0.110.110.17 0.001018106/1018106StringIO#initialize0.17153Protobuf::Field.build
0.100.100.001018106/3054760Protobuf::Field::EnumField#acceptable?0.160.010.15153/1983436Class#new
0.140.140.170.17 0.002036212/3054760Protobuf::Field::EnumField#coerce!3963940/3966993Protobuf::Decoder.decode_each_field
0% 0%0.240.240.170.17 0.003054760Protobuf::Field::BaseField#type_class3966993##==
0.180.16 0.000.181/400Bundler::SpecSet#materialize0.161/2Bundler::Source::Rubygems#installed_specs
0% 0%0.220.020.20400##map!0.170.000.162Bundler::Index.build
0.180.15 0.000.1839/39Bundler::LazySpecification#__materialize__0.151/1Bundler::RubygemsIntegration::MoreFuture#all_specs
0.210.16 0.000.211/1Bundler::Dsl.evaluate0.1638/38Bundler::LazySpecification#__materialize__
0% 0%0.210.16 0.000.211Bundler::Dsl#to_definition0.1638Bundler::Source::Rubygems#specs
0.210.010.201/2037678Class#new0.160.000.161/1Bundler::Source::Rubygems#installed_specs
0.210.16 0.000.210.16 1/1Bundler::Definition#specsBundler::Source::Rubygems#specs
0% 0%0.210.16 0.000.210.16 1Bundler::SpecSet#materializeBundler::Source::Rubygems#installed_specs
0.180.16 0.000.181/400##map!0.161/2Bundler::Index.build
0.200.200.004072424/4072424Protobuf::Decoder.decode_each_field0.150.010.15153/153Class#new
0% 0%0.200.200.004072424StringIO#eof0.150.010.15153Protobuf::Field::BaseField#initialize
0.200.150.15 0.000.201/1Class#new3301175/3301175##each
0% 0%0.200.150.15 0.000.201Bundler::Definition#initialize3301175##<
0.180.120.061018106/1018887Protobuf::Field::StringField(singleton)#encode_to_stream0.150.000.151/1Bundler::Index.build
0% 0%0.190.120.061018887BasicObject#!=0.150.000.151Bundler::RubygemsIntegration::MoreFuture#all_specs
0.180.180.15 0.004072424/4075603Protobuf::Decoder.decode_each_field0.151/1Gem::Specification.stubs
0%0%0.180.18
0.150.15 0.004075603##==2972955/2973417Protobuf::Enum.enum_for_tag_integer
0% 0%0.180.180.150.15 0.002036350##+2973417##first
0.180.180.15 0.002036213/2036396Protobuf::Field::StringField(singleton)#set_field0.151/1Bundler::RubygemsIntegration::MoreFuture#all_specs
0% 0%0.180.180.15 0.002036396##delete0.151Gem::Specification.stubs
0.180.13 0.000.1839/39##map!0.131/1Gem::Specification.installed_stubs
0% 0%0.180.000.1839Bundler::LazySpecification#__materialize__0.140.060.081137BasicObject#instance_eval
0.170.170.13 0.003054318/3054780Protobuf::Enum.enum_for_tag_integer0.132/3##each
0% 0%0.170.170.14 0.003054780##first0.143Gem::Specification.gemspec_stubs_in
0.100.100.003/642##map
0.170.170.140.14 0.003377948/3377948##each2972955/2972955Protobuf::Decoder.decode_each_field
0% 0%0.170.170.140.14 0.003377948##<2972955##>>
0%0%0.130.030.1060Kernel.eval
0.110.13 0.000.11109/153Protobuf::Message::Fields::ClassMethods.optional0.131/1Gem::Specification.stubs
0% 0%0.160.13 0.000.16153Protobuf::Message::Fields::ClassMethods.define_field0.131Gem::Specification.installed_stubs
0.150.13 0.000.15153/153Protobuf::Field.build0.131/1Gem::Specification.map_stubs
0.150.13 0.000.15153/153Protobuf::Message::Fields::ClassMethods.define_field0.131/1Gem::Specification.installed_stubs
0% 0%0.150.13 0.000.15153Protobuf::Field.build0.131Gem::Specification.map_stubs
0.150.010.14153/2037678Class#new0.130.000.131/1##flat_map
0.150.150.13 0.003054318/3054318Protobuf::Decoder.decode_each_field0.131/1Gem::Specification.map_stubs
0% 0%0.150.150.13 0.003054318##>>0.131##flat_map
0.140.01 0.13153/153Class#new
0%0%0.140.010.00 0.13153Protobuf::Field::BaseField#initialize1/992490##each
0.120.120.001981971/1982937Test::Resource#_protobuf_message_required_field_tags
0% 0%0.130.060.071137BasicObject#instance_eval0.120.120.001982937Kernel.dup
0.120.12 0.001018106/1018106Protobuf::Decoder.decode_each_field0.121/1Kernel.require
0% 0% 0.120.000.121Gem::Specification.load_defaults
0.12 0.001018106StringIO#read0.121/1Gem::Specification.each_spec
0.120.12 0.002036213/2037179Test::Resource#_protobuf_message_required_field_tags0.121/1Gem::Specification.load_defaults
0% 0% 0.120.000.121Gem::Specification.each_spec
0.12 0.002037179Kernel.dup0.121/1Gem::Specification.each_gemspec
0.110.110.12 0.001018106/1018106StringIO.new0.121/1Gem::Specification.each_spec
0% 0%0.110.110.12 0.001018106StringIO#initialize0.121Gem::Specification.each_gemspec
0.120.000.121/992490##each
0.110.12 0.000.110.12 109/109 Kernel.require
0% 0%0.110.12 0.000.110.12 109 Protobuf::Message::Fields::ClassMethods.optional
0.110.12 0.00 0.11 109/153
0.110.110.120.12 0.001018374/1018374Protobuf::Enum#to_i990985/990985Protobuf::Decoder.decode_each_field
0% 0%0.110.110.120.12 0.001018374Protobuf::Enum#tag990985StringIO#read
0%0%0.110.020.0860Kernel.eval
0.100.120.12 0.000.101/1Kernel.require990985/990985StringIO.new
0% 0%0.100.120.12 0.000.101Gem::Specification.load_defaults990985StringIO#initialize
0.100.11 0.000.100.11 1/1Gem::Specification.each_specBundler::Definition#specs
0.10
0%0%0.11 0.000.101/1Gem::Specification.load_defaults0.111Bundler::Definition#resolve
0% 0% 0.10 0.00 0.101Gem::Specification.each_spec6Bundler::SpecSet#for
0.100.000.101/1Gem::Specification.each_gemspec0.010.096/6Kernel.loop
0.100.00 0.101/1Gem::Specification.each_spec0.00991253/991253Protobuf::Enum#to_i
0% 0% 0.100.00 0.101Gem::Specification.each_gemspec0.00991253Protobuf::Enum#tag
0.100.000.101/1019611##each0.010.096/6Bundler::SpecSet#for
0% 0% 0.100.100.002037360##to_s
0.010.096Kernel.loop
@@ -67,195 +67,195 @@

Total time: 63.30

- + - + - + - + - + - + - + - - + + - + - + - - + + - + - + - + - + - + - + - + - + - + - - - + + + - + - - - + + + - + - - + + - - - + + + - + - - + + - - - - - + + + + + - + - - - - + + + + - + - - - - + + + + - + - - + + - - + + - + - - + + - - + + - + - + - - - + + + - + - + - + - + - + - - - + + + - + - + - + - + - + @@ -264,372 +264,381 @@

Total time: 63.30

- + - + - - + + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - - - - + + + + - + - + - - + + - + - - + + - - + + - + - - + + - - + + - + - - + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - + - - + + - + - - + + - + - + - - + + - + - + + + + + + + + + + - + - + - + - + - + - + - + - - - + + + - + - - - - + + + + - - - - + + + + - - - - - - - + + + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - + + - - + + - + - - + + - + - + - + - - + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - + + + + - + - - - + + + - + - + - - + + - + - - - - + + + + - - - - + + + + - + - - - - - + + + + + @@ -639,7 +648,7 @@

Total time: 63.30

- + @@ -650,482 +659,445 @@

Total time: 63.30

- + - - - - + + + + - + - - - + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - + - - + + - - - - + + + + - - - - + + + + - + - + - - + + - + - - + + - + - - + + - + - - - - + + + + - + - - - - + + + + - + - - + + - + - + - - + + - + - - + + - - + + - + - - + + - - + + - + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - + + + - + - + - + - - + + - - + + - + - - + + - + - + - - - + + + - - - - + + + + - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - + + - - - + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - + - + - - + + - + - - - - + + + + - + - - - - + + + + - + - - + + - - + + - + - + - - - - + + + + - - - - + + + + - + - - - - - + + + + + - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - + + + + + - + - - - - + + + + - + - - - - + + + + - + - - + + - - + + @@ -1134,403 +1106,458 @@

Total time: 63.30

- + - + - - + + - + - - + + - + - - + + - - - - + + + + - + - - - - + + + + - + - + - + - + - + - + - - - - - + + + + + - - - - - - - - - - - - - - - - + + + + + + + - - + - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - - - - - - - - - - - - - - - - + + + + + + + - + - - - - - + + + + + - + - + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - + + - - - + + - - + + - - + + - - + + + + + + + + + + + + - - - - - + + + + + - + + + + + + + + + + - - - - - + + + + + + - - - - - + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - + + + + + - - - - + + + + - - - - - + + + + + - + - - + + - - + + - - - - + + + + - - - - + + + + - - - - - + + + + + - + - - + + - - + + - + - - + + - + - - + + - + - - + + - + - + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - - + + - + - - + + @@ -1539,182 +1566,182 @@

Total time: 63.30

- + - + - + - + - + - + - - - + + + - + - - + + - + - + - - - + + + - + - - - - + + + + - - - - - - - - - - - - - - - + + + + + + - + - - - - - + + + + + - + - - - - - - - - - - - + + - + - - - + + + - - - + + + - + - - - + + + - + - - - - - - + + + + + + - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + @@ -1723,795 +1750,785 @@

Total time: 63.30

- + - + - + - - + + - + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - + - - + + - - + + - - + + - + - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + - + - - + + + + + + + + + + - - + + + - + - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + + + + + + + + + + - + - - - + + + - + - - + + - + - - - - + + + + - + - + + - - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - + - + - - - - + + + + - + + + + + + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - + - - - - + + + + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - + + - - - - - + + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + + - - + - - - - + + + + - - - - + + + + - - - - + + + + - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - - - - + + + + + - - - - - - - - - - - - - - - + + + + + + - + - - + + - - + + - + - - - - + + + + - - - - + + + + - - - - + + + + - + - - + + - - - - - - - - - - - - - - - - - - - - - + + - + - - + + - - + + - - - - - + + + + + - - - - - + + + + + + + + + + + + + + - + - + + - - - + + - + - - - - - + + + + + - - - - - + + + + + - + - - + - - + + + - + - - - - + + + + - - - - + + + + - + - - + + - + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - - - - + + + + - + - - + + - + - - + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + - - + + - - + + @@ -2520,137 +2537,137 @@

Total time: 63.30

- - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - - + + - - + + - - + + - - + + - - + + - + - - - - + + + + - - - - + + + + - + - - + + - + - - + + - + - - + + - + @@ -2659,101 +2676,139 @@

Total time: 63.30

- + - - + + - - + + - - + + - + - - + + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - - + + - + - - - - - + + + + + - - - - - + + + + + - + + - + + - - - + + + + + + + + + + + - + - + - - + + @@ -2762,130 +2817,147 @@

Total time: 63.30

- + - + - + - + - + - - + - - + + + - - + - - + + + - - + - - - - - - - - - - - - - - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - + + + + + + + + + + - - + + + - - - + - - + + + - + + + + + + + + + + - - + + - + + + + + + + + + + - + - + @@ -2894,241 +2966,261 @@

Total time: 63.30

- + + + + + + + + + + + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - + - + - - - - - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - - - - - + + + + + - + - - + + - - + + - - - - - + + + + + - + - - + + - - + + + + + + + + + + + + + + + + + + + + + - + @@ -3137,2198 +3229,2237 @@

Total time: 63.30

- + - - + + - + - - - - - + + + + + - + + + + + + + + + + - - + + - - - - - + + + + + - - - - - - - - - - - + + - - + + - + - + - + - + - + - + - + - - - - - + + + + + - + - - - - - + + + + + - + + + + + + + + + + + + - - - + + - + - + + - - - + + - - - - - + + + + + - + + - + - - - - - - - - - - - - - + + + - + - - - + + + - + - + - - - + + + - + - + + - - - + + - + + - - - + + - + + - + + - - - + + - - - + + - - + + - - + - - + + + - - + - - + + + - + + + + + + + + + + - - + + - - + + - - - - - + + + + + - + - - - - - + + + + + - - - - - + + + + + - + - + - - + + - - - - - + + + + + - + - + - - - + + + - + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + - + - - + + - - + + - - + + - - + + - + + + + + + + + + + + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - + + - - - + + - + + - - - + + - + + - + + - - - + + - + + + + + + + + + + - + - + - + - + - + - + - + - + - - - + + + - + - - - - - + + + + + - - - - - + + + + + - - + - - - - - - - - - - - + - - + + + - + - + - + - + - + - + - + - + - - - + + + - + - - + + - - + + - - + + - - + + - - - - - - - - - - + - - - + + + - + - + - - - - - - - - - - - - - + + + - + - + - - - + + + - + - - - + + + - + - - - + + + - + - - + - - + + + - - + + + + + + + + + + - - - - - - - - - - - - + + + - + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - - + - - + + + - - + - - + + + + + + + + + + + + - + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - + - - - + + + - + - - - + + + - + - + - - - + + + + + + + + + + + + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - + + - - - + + - + + - - - + + - + + - + + + + + + + + - - + + + + - + - - + - - + + + - - + - - + + + - + - - + + - - + + - - + + - - + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + - - - + + - + - - - - + + + + - + - - - + + + + + + + + + + + + - - + + + - + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + - - - + + + + + + + + + - - - + + + + + - - - - - + - - - - - - - - - - + - - - - - + + - - - - + + + - + - - - - + + - + + + + + + + - - - + + - - - - - - + + - - - - + + - - - - + + + + + + + + + + + + - - - - - + - - - - - + - - - - - - - + - - - - - - - - + + + - + - + + - + + + - + + + + - + + - + + + + + + + + + + + + + + - - - + + + - - + + + + + - - + + - - - - - + + + + + + + + + + + + + + + - - + + + + + + - - - - - - - - - + - - - - - - - - - - + + + + - + + + - - - - - - - - - - - + - - - - - - - - - - + + - + + + + - - + + - - + + + - + + + + + - + - - - + + + + + - - - - - - - - - - + + - + + + + + + + + + + - + + + + - - - - - - - - - + + - - - - - - + + - - - - - - + - + + - - - + + + + + + + - - - + + + - - + + + - - + + - - - + + + - - + + + - - - - - + + + - - + + - - - - - + + + - - - + + - - - + + + + + - + + + - + + + + - - - - - - - + - - - - - - - + + + + - - - + + + + - + - + + + + + + + + + + + - - + + + + - - + - - + + + + + - - - - - + + - - - + + - - - - - - - + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - + + + - - + + + + + - - - - - - - - + + - - - - - - - + - + + + + + + - - - - + + - - - - - + + + + + + - - + + + + - + + + + + + + + + + + + - + + - + - - + + + - - - - - - - + + + - - - - + + - + + + + + - - + - - - + + + + + + - - + - - - - + - - + - - + - - - - - + + + - - - - + + + + + - - - - - + + + - - - - - + + + + + + - - - - - - + + - + + + + + + + + - - - - + - - + - - - - + - - - + - - + + + - + - - - - - - + + - + - - - - - + - - - - - + + - + + - - + + - + + + + + + + - - - - - + + + + - + + - + - + - + - + + + + + - + + + + + + + + + - - - + - - - - - - + - + - + + - - + + - + + - + + - + + + - - - - + - + + - - @@ -5338,32 +5469,30 @@

Total time: 63.30

- - - - - - + + + + @@ -5375,14 +5504,14 @@

Total time: 63.30

+ - - + @@ -5395,24 +5524,24 @@

Total time: 63.30

- + + - + - @@ -5425,16 +5554,15 @@

Total time: 63.30

+ - - @@ -5445,9 +5573,9 @@

Total time: 63.30

- + @@ -5458,13 +5586,13 @@

Total time: 63.30

+ - @@ -5473,6 +5601,7 @@

Total time: 63.30

+ From 5147ab270ca4e51c1c392312b7cbe668217534cf Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Thu, 27 Dec 2018 17:31:52 -0700 Subject: [PATCH 15/93] add some of the java methods to integers and create a custom set_field for string values --- lib/protobuf/field/base_field.rb | 2 + .../field/base_field_method_definitions.rb | 26 + lib/protobuf/field/enum_field.rb | 32 +- lib/protobuf/field/int64_field.rb | 23 +- profile.html | 6180 ++++++++--------- 5 files changed, 3135 insertions(+), 3128 deletions(-) diff --git a/lib/protobuf/field/base_field.rb b/lib/protobuf/field/base_field.rb index 7a63ece1..689b23ca 100644 --- a/lib/protobuf/field/base_field.rb +++ b/lib/protobuf/field/base_field.rb @@ -155,6 +155,8 @@ def define_set_field! ::Protobuf::Field::BaseFieldMethodDefinitions.define_map_set_field!(self) elsif repeated? ::Protobuf::Field::BaseFieldMethodDefinitions.define_repeated_set_field!(self) + elsif type_class == ::Protobuf::Field::StringField + ::Protobuf::Field::BaseFieldMethodDefinitions.define_string_set_field!(self) else ::Protobuf::Field::BaseFieldMethodDefinitions.define_base_set_field!(self) end diff --git a/lib/protobuf/field/base_field_method_definitions.rb b/lib/protobuf/field/base_field_method_definitions.rb index 7076f5cd..2ff4786c 100644 --- a/lib/protobuf/field/base_field_method_definitions.rb +++ b/lib/protobuf/field/base_field_method_definitions.rb @@ -222,6 +222,32 @@ def set_field(values, value, ignore_nil_for_repeated, message_instance) end end + def self.define_string_set_field!(selph) + if selph.required? + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def set_field(values, value, ignore_nil_for_repeated, message_instance) + if value.nil? + values.delete(#{fully_qualified_name_string(selph)}) + message_instance._protobuf_message_required_field_tags << #{selph.tag} + else + message_instance._protobuf_message_required_field_tags.delete(#{selph.tag}) + values[#{fully_qualified_name_string(selph)}] = value.to_s + end + end + RUBY + else + selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + def set_field(values, value, ignore_nil_for_repeated, message_instance) + if value.nil? + values.delete(#{fully_qualified_name_string(selph)}) + else + values[#{fully_qualified_name_string(selph)}] = value.to_s + end + end + RUBY + end + end + def self.define_base_set_field!(selph) if selph.required? selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 diff --git a/lib/protobuf/field/enum_field.rb b/lib/protobuf/field/enum_field.rb index e2c8c311..4c7f6653 100644 --- a/lib/protobuf/field/enum_field.rb +++ b/lib/protobuf/field/enum_field.rb @@ -15,18 +15,31 @@ def self.default ## # Public Instance Methods # + if defined?(::ProtobufJavaHelpers) + include ::ProtobufJavaHelpers::Varinter + include ::ProtobufJavaHelpers::IntegerProtobufField - def acceptable?(val) - !type_class.fetch(val).nil? - end + def encode(value) + to_varint_64(value.to_i) # Calling `to_i` because it is a delegator and the java side doesn't follow + end + + def decode(value) + decode_varint_64(value) + end + else + def encode(value) + # original Google's library uses 64bits integer for negative value + ::Protobuf::Field::VarintField.encode(value & 0xffff_ffff_ffff_ffff) + end - def encode(value) - super(value.to_i) + def decode(value) + value -= 0x1_0000_0000_0000_0000 if (value & 0x8000_0000_0000_0000).nonzero? + value if acceptable?(value) + end end - def decode(value) - decoded = super(value) - decoded if acceptable?(decoded) + def acceptable?(val) + !type_class.fetch(val).nil? end def enum? @@ -35,8 +48,7 @@ def enum? def coerce!(value) enum_value = type_class.fetch(value) - fail TypeError, "Invalid Enum value: #{value.inspect} for #{name}" unless enum_value - enum_value + enum_value || fail(TypeError, "Invalid Enum value: #{value.inspect} for #{name}") end private diff --git a/lib/protobuf/field/int64_field.rb b/lib/protobuf/field/int64_field.rb index 18538f4b..493f6ab2 100644 --- a/lib/protobuf/field/int64_field.rb +++ b/lib/protobuf/field/int64_field.rb @@ -7,13 +7,26 @@ class Int64Field < IntegerField ## # Class Methods # + if defined?(::ProtobufJavaHelpers) + include ::ProtobufJavaHelpers::Varinter + include ::ProtobufJavaHelpers::IntegerProtobufField + include ::ProtobufJavaHelpers::Int64ProtobufField - def self.max - INT64_MAX - end + def encode(value) + to_varint_64(value) + end + + def decode(value) + decode_varint_64(value) + end + else + def self.max + INT64_MAX + end - def self.min - INT64_MIN + def self.min + INT64_MIN + end end end diff --git a/profile.html b/profile.html index 1d3eed61..b4e04e95 100644 --- a/profile.html +++ b/profile.html @@ -52,7 +52,7 @@

Profile Report: main

-

Total time: 63.27

+

Total time: 63.20

%Total
100% 0%63.3063.27 0.0063.3063.27 0 (top)
60.0860.10 0.0060.0860.10 1/1 Benchmark::IPS.ips
0.991.04 0.000.992/1121.032/115 Kernel.require
0.940.92 0.000.946/18800.926/1886 Kernel.require
0.770.73 0.040.720.69 1/5##times##times
0.520.48 0.060.450.42 17/19 Kernel.load
0.120.11 0.000.121/992490Gem::Specification.each_gemspec0.114/1037819Bundler::SpecSet#tsort_each_node
0.130.11 0.000.131/992490##flat_map0.111/1037819Gem::Specification.each_gemspec
0.250.23 0.000.2519/9924900.2319/1037819 Kernel.require
20.001.7618.251/9924901.8318.171/1037819 Benchmark::IPS::Job#run_warmup
40.0840.09 0.0140.071/99249040.091/1037819 Benchmark::IPS::Job#run_benchmark
96% 2%60.921.8059.12992490##each60.951.8759.081037819##each
57.172.6954.483301171/330117157.052.7754.283593390/3593390 Benchmark::IPS::Job::Entry#call_times
0.840.420.423301704/33017040.870.440.433593944/3593944 Benchmark::Timing.now
0.150.150.180.18 0.003301175/3301175##<3593394/3593394##<
0.130.130.140.14 0.003301185/16556215##+3593404/18522606##+
0.130.11 0.000.132/3Gem::Specification.gemspec_stubs_in0.10118/118TSort.each_strongly_connected_component_from
0.770.73 0.040.720.69 1/5 (top)
60.0860.10 0.0060.0860.10 2/5 Benchmark::IPS::Job#run
96% 0%60.870.0660.8160.850.0560.80 5##times##times
40.0840.09 0.0040.0840.09 1/1 Benchmark::IPS::Job#run_benchmark
20.00 1/1 Benchmark::IPS::Job#run_warmup
0.350.34 0.000.3510000/9909850.3310000/1036260 Protobuf::Message::Serialization::ClassMethods.decode_from
0.230.21 0.010.2210000/9909850.2110000/1036260 Protobuf::Encoder.encode
60.0860.10 0.0060.0860.10 1/1 (top)
94% 0%60.0860.10 0.0060.0860.10 1 Benchmark::IPS.ips
60.0860.10 0.0060.0860.10 1/1 Benchmark::IPS::Job#run
60.0860.10 0.0060.0860.10 1/1 Benchmark::IPS.ips
94% 0%60.0860.10 0.0060.0860.10 1 Benchmark::IPS::Job#run
60.0860.10 0.0060.0860.10 2/5##times##times
57.172.6954.483301171/3301171##each57.052.7754.283593390/3593390##each
90% 4%57.172.6954.48330117157.052.7754.283593390 Benchmark::IPS::Job::Entry#call_times
53.2852.94 2.2051.0813253947/1325449250.7414928119/14928667 Proc#call
0.630.630.710.71 0.0016555118/18537105##<18521509/20594046##<
0.570.570.630.63 0.0013253947/16556215##+14928119/18522606##+
53.2852.94 2.2051.0813253947/1325449250.7414928119/14928667 Benchmark::IPS::Job::Entry#call_times
84%83% 3%53.312.2151.101325449252.972.2050.7714928667 Proc#call
22.652.1720.4812272962/1227296222.242.5019.7413901859/13901859 Protobuf::Message#to_hash
13.540.2813.26980985/99098513.710.2513.461026260/1036260 Protobuf::Message::Serialization::ClassMethods.decode_from
8.740.308.44980985/9909858.670.278.401026260/1036260 Protobuf::Encoder.encode
3.963.94 0.143.82980985/19834363.801026260/2074044 Class#new
1.790.261.770.25 1.53980985/9909851026260/1036260 Test::Resource#status=
0.260.150.250.14 0.11980985/9909851026260/1036260 StringIO.new
0.100.100.001026260/1036260Protobuf::Message#to_proto
40.0840.09 0.0040.0840.09 1/1##times##times
63% 0%40.0840.09 0.0040.0840.09 1 Benchmark::IPS::Job#run_benchmark
40.0840.09 0.0140.071/992490##each40.091/1037819##each
8.081.336.75990985/132639488.011.406.611036260/14938120 Protobuf::Message#each_field_for_serialization
20.485.3315.1412272962/1326394819.745.9413.8013901859/14938120 Protobuf::Message#to_hash
45%10%28.566.6621.8913263948##each_key43%11%27.757.3420.4114938120##each_key
5.982.173.8012272962/12272962Protobuf::Field::Int64Field(singleton)#to_message_hash5.452.363.0913901859/13901859Protobuf::Field::StringField(singleton)#to_message_hash
5.722.183.5412272962/12272962Protobuf::Field::StringField(singleton)#to_message_hash5.262.263.0013901859/13901859Protobuf::Field::Int64Field(singleton)#to_message_hash
2.452.451.941.94 0.0027518879/36442639##[]30912498/71156329##[]
1.920.631.900.61 1.29990985/9909851036260/1036260 Protobuf::Field::StringField(singleton)#encode_to_stream
1.761.89 0.271.49990985/9909851.621036260/1036260 Protobuf::Field::EnumField(singleton)#encode_to_stream
1.470.261.22990985/990985Protobuf::Field::Int64Field(singleton)#encode_to_stream1.551.550.0030912498/37130060Test::Resource#_protobuf_message_field
1.451.450.0027518879/33464791Test::Resource#_protobuf_message_field1.500.271.231036260/1036260Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.410.090.32990985/142549320.340.100.251036260/15974379 Protobuf::Field::StringField(singleton)#value_from_values
0.390.09 0.30990985/142549320.080.221036260/15974379 Protobuf::Field::Int64Field(singleton)#value_from_values
0.340.28 0.090.25990985/19819700.191036260/2072520 Protobuf::Field::EnumField(singleton)#value_from_values
22.652.1720.4812272962/1227296222.242.5019.7413901859/13901859 Proc#call
35% 3%22.652.1720.481227296222.242.5019.7413901859 Protobuf::Message#to_hash
20.485.3315.1412272962/13263948##each_key19.745.9413.8013901859/14938120##each_key
0.00 20.00 1/1##times##times
31% 1 Benchmark::IPS::Job#run_warmup
20.001.7618.251/992490##each1.8318.171/1037819##each
0.350.34 0.000.3510000/990985##times0.3310000/1036260##times
13.540.2813.26980985/99098513.710.2513.461026260/1036260 Proc#call
21%22% 0%13.890.2913.6199098514.050.2613.791036260 Protobuf::Message::Serialization::ClassMethods.decode_from
12.960.2312.73990985/99098513.160.2412.921036260/1036260 Protobuf::Message::Serialization.decode_from
0.650.63 0.130.52990985/19834360.501036260/2074044 Class#new
12.960.2312.73990985/99098513.160.2412.921036260/1036260 Protobuf::Message::Serialization::ClassMethods.decode_from
20% 0%12.960.2312.7399098513.160.2412.921036260 Protobuf::Message::Serialization.decode_from
12.7312.92 1.7510.98990985/99098511.171036260/1036260 Protobuf::Decoder.decode_each_field
12.7312.92 1.7510.98990985/99098511.171036260/1036260 Protobuf::Message::Serialization.decode_from
20% 2%12.7312.92 1.7510.9899098511.171036260 Protobuf::Decoder.decode_each_field
9.211.058.172972955/29729559.221.008.223108780/3108780 Protobuf::Message::Serialization.set_field_bytes
1.040.670.375945910/59459101.170.710.466217560/6217560 Protobuf::Varint.decode
0.190.190.210.21 0.003963940/39639404145040/4145040 StringIO#eof
0.17 0.17 0.003963940/3966993##==4145040/4148208##==
0.140.140.150.15 0.002972955/2972955##>>3108780/3108780##>>
0.120.120.130.13 0.002972955/6936895##&3108780/7253820##&
0.12 0.12 0.00990985/9909851036260/1036260 StringIO#read
9.211.058.172972955/29729559.221.008.223108780/3108780 Protobuf::Decoder.decode_each_field
14% 1%9.211.058.1729729559.221.008.223108780 Protobuf::Message::Serialization.set_field_bytes
3.380.253.13990985/9909853.430.263.181036260/1036260 Protobuf::Field::EnumField(singleton)#set
2.260.271.99990985/9909850.252.011036260/1036260 Protobuf::Field::Int64Field(singleton)#set
2.02 0.22 1.80990985/9909851036260/1036260 Protobuf::Field::StringField(singleton)#set
0.260.260.270.27 0.002972955/36442639##[]3108780/71156329##[]
0.250.250.240.24 0.002972955/334647913108780/37130060 Test::Resource#_protobuf_message_field
0.230.21 0.010.2210000/990985##times0.2110000/1036260##times
8.740.308.44980985/9909858.670.278.401026260/1036260 Proc#call
14% 0%8.970.318.669909858.890.288.601036260 Protobuf::Encoder.encode
8.660.408.26990985/9909858.600.398.211036260/1036260 Protobuf::Message#each_field_for_serialization
1.260.161.10990985/59459121.280.171.121036260/6217562 Protobuf::Field::EnumField(singleton)#set
1.381.41 0.201.18990985/59459121.211036260/6217562 Protobuf::Field::StringField(singleton)#set
1.410.151.26990985/59459120.171.241036260/6217562 Protobuf::Field::Int64Field(singleton)#set
1.560.261.30990985/59459121.550.281.281036260/6217562 Test::Resource#status=
3.090.542.551981972/5945912##each3.110.522.582072522/6217562##each
13% 2%8.701.317.3959459128.751.337.426217562 Protobuf::Message#set_field
2.382.37 0.491.891981971/19819711.882072521/2072521 Protobuf::Field::Int64Field(singleton)#set_field
2.260.731.521981971/19819712.350.761.592072521/2072521 Protobuf::Field::StringField(singleton)#set_field
2.250.481.771981970/19819702.270.471.802072520/2072520 Protobuf::Field::EnumField(singleton)#set_field
0.290.290.230.23 0.002972957/36442639##[]3108782/71156329##[]
0.21 0.21 0.002972957/334647913108782/37130060 Test::Resource#_protobuf_message_field
8.660.408.26990985/9909858.600.398.211036260/1036260 Protobuf::Encoder.encode
13% 0%8.660.408.269909858.600.398.211036260 Protobuf::Message#each_field_for_serialization
8.081.336.75990985/13263948##each_key8.011.406.611036260/14938120##each_key
0.140.140.150.15 0.00990985/29729561036260/3108781 Test::Resource#_protobuf_message_required_field_tags
5.982.173.8012272962/12272962##each_key
9%3%5.982.173.8012272962Protobuf::Field::Int64Field(singleton)#to_message_hash
2.341.840.5012272962/14254932Protobuf::Field::Int64Field(singleton)#value_from_values
1.471.470.0012272962/30496373##[]=
5.722.183.5412272962/12272962##each_key5.452.363.0913901859/13901859##each_key
9%8% 3%5.722.183.54122729625.452.363.0913901859 Protobuf::Field::StringField(singleton)#to_message_hash
2.511.930.5812272962/142549322.261.590.6813901859/15974379 Protobuf::Field::StringField(singleton)#value_from_values
1.031.030.830.83 0.0012272962/30496373##[]=13901859/34025837##[]=
0.16 0.01 0.15153/1983436153/2074044 Protobuf::Field.build
0.240.30 0.010.241/19834360.301/2074044 Bundler::Dsl#to_definition
0.650.63 0.130.52990985/19834360.501036260/2074044 Protobuf::Message::Serialization::ClassMethods.decode_from
3.963.94 0.143.82980985/19834363.801026260/2074044 Proc#call
8% 0%5.380.375.0019834365.390.385.012074044 Class#new
4.430.823.611981971/19819714.390.713.672072521/2072521 Protobuf::Message#initialize
0.240.30 0.000.230.29 1/1 Bundler::Definition#initialize
0.15 0.010.150.14 153/153 Protobuf::Field::BaseField#initialize
4.430.823.611981971/1981971Class#new5.262.263.0013901859/13901859##each_key
6%1%4.430.823.611981971Protobuf::Message#initialize
3.440.353.091981971/1982182##each8%3%5.262.263.0013901859Protobuf::Field::Int64Field(singleton)#to_message_hash
3.440.353.091981971/1982182Protobuf::Message#initialize
5%0%3.470.373.101982182##each2.201.550.6413901859/15974379Protobuf::Field::Int64Field(singleton)#value_from_values
3.090.542.551981972/5945912Protobuf::Message#set_field0.800.800.0013901859/34025837##[]=
3.380.253.13990985/990985Protobuf::Message::Serialization.set_field_bytes4.390.713.672072521/2072521Class#new
5%0%3.380.253.13990985Protobuf::Field::EnumField(singleton)#set
1.870.251.63990985/990985Protobuf::Field::EnumField#decode6%1%4.390.713.672072521Protobuf::Message#initialize
1.260.161.10990985/5945912Protobuf::Message#set_field3.490.383.112072521/2072735##each
0.18 0.18 0.002972955/364426393108780/71156329 Protobuf::Enum.enum_for_tag_integer
0.260.260.230.23 0.002972955/36442639Protobuf::Message::Serialization.set_field_bytes3108782/71156329Protobuf::Message#set_field
0.290.290.270.27 0.002972957/36442639Protobuf::Message#set_field3108780/71156329Protobuf::Message::Serialization.set_field_bytes
2.452.450.710.71 0.0027518879/36442639##each_key
5%5%3.213.180.0336442639##[]14938119/71156329Protobuf::Field::Int64Field(singleton)#value_from_values
0.150.150.750.75 0.001981971/30496373Protobuf::Field::StringField(singleton)#set_field14938119/71156329Protobuf::Field::StringField(singleton)#value_from_values
0.150.151.941.94 0.001981971/30496373Protobuf::Field::Int64Field(singleton)#set_field30912498/71156329##each_key
6%6%4.164.130.0371156329##[]
0.180.180.001981970/30496373Protobuf::Field::EnumField(singleton)#set_field3.490.383.112072521/2072735Protobuf::Message#initialize
5%0%3.510.403.112072735##each
1.031.030.0012272962/30496373Protobuf::Field::StringField(singleton)#to_message_hash3.110.522.582072522/6217562Protobuf::Message#set_field
1.471.470.0012272962/30496373Protobuf::Field::Int64Field(singleton)#to_message_hash3.430.263.181036260/1036260Protobuf::Message::Serialization.set_field_bytes
4%4%2.992.980.0130496373##[]=5%0%3.430.263.181036260Protobuf::Field::EnumField(singleton)#set
1.890.251.651036260/1036260Protobuf::Field::EnumField#decode
1.280.171.121036260/6217562Protobuf::Message#set_field
0.410.090.32990985/14254932##each_key0.340.100.251036260/15974379##each_key
2.511.930.5812272962/142549322.261.590.6813901859/15974379 Protobuf::Field::StringField(singleton)#to_message_hash
4%3%2.932.020.90142549322%2.601.680.9215974379 Protobuf::Field::StringField(singleton)#value_from_values
0.670.670.750.75 0.0013263947/27520181##fetch14938119/71156329##[]
0.390.09 0.30990985/14254932##each_key0.080.221036260/15974379##each_key
2.341.840.5012272962/142549322.201.550.6413901859/15974379 Protobuf::Field::Int64Field(singleton)#to_message_hash
4% 3%2.721.930.80142549322%2.501.640.8615974379 Protobuf::Field::Int64Field(singleton)#value_from_values
0.550.550.710.71 0.0013263947/27520181##fetch14938119/71156329##[]
2.382.37 0.491.891981971/19819711.882072521/2072521 Protobuf::Message#set_field
3% 0%2.382.37 0.491.8919819711.882072521 Protobuf::Field::Int64Field(singleton)#set_field
1.650.591.660.60 1.061981971/19819712072521/2072521 Protobuf::Field::IntegerField#coerce!
0.150.150.140.14 0.001981971/30496373##[]=2072521/34025837##[]=
2.350.761.592072521/2072521Protobuf::Message#set_field
3%1%2.350.761.592072521Protobuf::Field::StringField(singleton)#set_field
0.600.470.132072521/3108781Test::Resource#_protobuf_message_required_field_tags
0.57 0.410.162072521/2072521Protobuf::Field::StringField#coerce!
0.180.180.002072521/34025837##[]=
0.160.160.002072521/2072705##delete
0.38 0.030.392/18800.362/1886 Kernel.load
0.940.92 0.000.946/18800.926/1886 (top)
0.991.03 0.000.99112/18801.03115/1886 Kernel.require
2.34 0.03 2.3118801886 Kernel.require
0.840.89 0.000.840.89 1/1 Bundler.setup
0.250.23 0.000.2519/992490##each0.2319/1037819##each
0.12 0.00 0.121/1Gem::Specification.load_defaults109/109Protobuf::Message::Fields::ClassMethods.optional
0.120.11 0.000.12109/109Protobuf::Message::Fields::ClassMethods.optional0.111/1Gem::Specification.load_defaults
2.260.731.521981971/19819712.270.471.802072520/2072520 Protobuf::Message#set_field
3%1%2.260.731.521981971Protobuf::Field::StringField(singleton)#set_field
0.580.460.121981971/2972956Test::Resource#_protobuf_message_required_field_tags0%2.270.471.802072520Protobuf::Field::EnumField(singleton)#set_field
0.530.360.161981971/1981971Protobuf::Field::StringField#coerce!1.560.391.172072520/2072520Protobuf::Field::EnumField#coerce!
0.17 0.17 0.001981971/1982154##delete
0.150.150.001981971/30496373##[]=2072520/34025837##[]=
2.260.271.99990985/9909850.252.011036260/1036260 Protobuf::Message::Serialization.set_field_bytes
3% 0% 2.260.271.999909850.252.011036260 Protobuf::Field::Int64Field(singleton)#set
1.410.151.26990985/59459120.171.241036260/6217562 Protobuf::Message#set_field
0.580.430.16990985/1981970Protobuf::Field::IntegerField#decode
0.600.420.181036260/2072520Protobuf::Field::IntegerField#decode
2.250.481.771981970/1981970Protobuf::Message#set_field
3%0%2.250.481.771981970Protobuf::Field::EnumField(singleton)#set_field0.140.140.002072521/34025837Protobuf::Field::Int64Field(singleton)#set_field
1.520.371.151981970/1981970Protobuf::Field::EnumField#coerce!0.170.170.002072520/34025837Protobuf::Field::EnumField(singleton)#set_field
0.18 0.18 0.001981970/30496373##[]=2072521/34025837Protobuf::Field::StringField(singleton)#set_field
0.800.800.0013901859/34025837Protobuf::Field::Int64Field(singleton)#to_message_hash
0.830.830.0013901859/34025837Protobuf::Field::StringField(singleton)#to_message_hash
3%3%2.122.110.0134025837##[]=
2.02 0.22 1.80990985/9909851036260/1036260 Protobuf::Message::Serialization.set_field_bytes
2.02 0.22 1.809909851036260 Protobuf::Field::StringField(singleton)#set
1.381.41 0.201.18990985/59459121.211036260/6217562 Protobuf::Message#set_field
0.420.260.15990985/9909850.400.240.161036260/1036260 Protobuf::Field::StringField#decode
1.920.631.29990985/990985##each_key
3%1%1.920.631.29990985Protobuf::Field::StringField(singleton)#encode_to_stream
0.620.280.342972955/6936895IO::GenericWritable.<<
0.270.180.09990985/2973108Protobuf::Field::VarintField.encode
0.180.120.06990985/991766BasicObject#!=
0.21 0.21 0.002972957/334647913108782/37130060 Protobuf::Message#set_field
0.250.250.240.24 0.002972955/334647913108780/37130060 Protobuf::Message::Serialization.set_field_bytes
1.451.451.551.55 0.0027518879/33464791##each_key30912498/37130060##each_key
3% 3%1.911.912.002.00 0.003346479137130060 Test::Resource#_protobuf_message_field
1.870.251.63990985/990985Protobuf::Field::EnumField(singleton)#set1.900.611.291036260/1036260##each_key
2% 0%1.870.251.63990985Protobuf::Field::EnumField#decode1.900.611.291036260Protobuf::Field::StringField(singleton)#encode_to_stream
1.120.350.78990985/990985Protobuf::Field::EnumField#acceptable?0.630.310.323108780/7253820IO::GenericWritable.<<
0.500.360.250.160.091036260/3108933Protobuf::Field::VarintField.encode
0.19 0.14990985/1981970Protobuf::Field::IntegerField#decode0.061036260/1037071BasicObject#!=
1.790.261.53980985/990985Proc#call1.890.251.651036260/1036260Protobuf::Field::EnumField(singleton)#set
2% 0%1.830.271.56990985Test::Resource#status=1.890.251.651036260Protobuf::Field::EnumField#decode
1.560.261.30990985/5945912Protobuf::Message#set_field1.120.330.791036260/1036260Protobuf::Field::EnumField#acceptable?
0.530.380.151036260/2072520Protobuf::Field::IntegerField#decode
1.761.89 0.271.49990985/990985##each_key1.621036260/1036260##each_key
2% 0%1.761.89 0.271.499909851.621036260 Protobuf::Field::EnumField(singleton)#encode_to_stream
1.140.210.93990985/9909851.250.241.001036260/1036260 Protobuf::Field::EnumField#encode
0.350.380.19 0.180.171981970/69368952072520/7253820 IO::GenericWritable.<<
1.650.591.770.251.531026260/1036260Proc#call
2%0%1.810.261.551036260Test::Resource#status=
1.550.281.281036260/6217562Protobuf::Message#set_field
1.660.60 1.061981971/19819712072521/2072521 Protobuf::Field::Int64Field(singleton)#set_field
2% 0%1.650.591.660.60 1.0619819712072521 Protobuf::Field::IntegerField#coerce!
0.890.600.291981971/19819710.870.580.282072521/2072521 Protobuf::Field::IntegerField#acceptable?
0.110.110.002072521/7255321Kernel.kind_of?
0.570.210.37990985/29729640.590.200.381036260/3108789 Protobuf::Field::EnumField#acceptable?
0.990.340.651981970/29729641.020.350.672072520/3108789 Protobuf::Field::EnumField#coerce!
2% 0%1.570.551.0229729641.610.561.053108789 Protobuf::Enum.fetch
0.870.550.322972955/29729550.910.570.343108780/3108780 Protobuf::Enum.enum_for_tag_integer
0.14 0.14 0.002972964/69382793108789/7255321 Kernel.kind_of?
1.520.371.151981970/19819701.560.391.172072520/2072520 Protobuf::Field::EnumField(singleton)#set_field
2% 0%1.520.371.1519819701.560.391.172072520 Protobuf::Field::EnumField#coerce!
0.990.340.651981970/29729641.020.350.672072520/3108789 Protobuf::Enum.fetch
0.15 0.15 0.001981970/29733972072520/3109338 Protobuf::Field::BaseField#type_class
0.690.380.31990985/19819700.720.400.321036260/2072520 Protobuf::Field::EnumField#encode
0.830.480.35990985/19819700.820.430.391036260/2072520 Protobuf::Field::Int64Field(singleton)#encode_to_stream
2% 1%1.510.850.6619819701.540.830.712072520 Protobuf::Field::IntegerField#encode
0.410.250.161981970/29731080.460.260.202072520/3108933 Protobuf::Field::VarintField.encode
0.25 0.25 0.001981970/6936895##&2072520/7253820##&
1.470.261.22990985/990985##each_key1.500.271.231036260/1036260##each_key
2% 0%1.470.261.229909851.500.271.231036260 Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.830.480.35990985/19819700.820.430.391036260/2072520 Protobuf::Field::IntegerField#encode
0.390.180.211981970/69368950.410.190.222072520/7253820 IO::GenericWritable.<<
0.350.380.19 0.180.171981970/69368952072520/7253820 Protobuf::Field::EnumField(singleton)#encode_to_stream
0.390.180.211981970/69368950.410.190.222072520/7253820 Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.620.280.342972955/69368950.630.310.323108780/7253820 Protobuf::Field::StringField(singleton)#encode_to_stream
2% 1%1.370.640.7269368951.410.690.737253820 IO::GenericWritable.<<
0.720.720.730.73 0.006936895/69368957253820/7253820 StringIO#write
0.550.550.0013263947/27520181Protobuf::Field::Int64Field(singleton)#value_from_values
0.670.670.0013263947/27520181Protobuf::Field::StringField(singleton)#value_from_values
2%2%1.281.270.0027520181##fetch
1.140.210.93990985/9909851.250.241.001036260/1036260 Protobuf::Field::EnumField(singleton)#encode_to_stream
1% 0%1.140.210.939909851.250.241.001036260 Protobuf::Field::EnumField#encode
0.690.380.31990985/19819700.720.400.321036260/2072520 Protobuf::Field::IntegerField#encode
0.250.140.10990985/9912530.280.170.111036260/1036528 Protobuf::Enum#to_i
1.120.350.78990985/990985Protobuf::Field::EnumField#decode1.170.710.466217560/6217560Protobuf::Decoder.decode_each_field
1%0%1.120.350.78990985Protobuf::Field::EnumField#acceptable?
0.570.210.37990985/2972964Protobuf::Enum.fetch1%1.170.710.466217560Protobuf::Varint.decode
0.110.110.460.46 0.00990985/2973397Protobuf::Field::BaseField#type_class6217560/6217560ProtobufJavaHelpers::Varinter.read_varint
0.500.360.14990985/19819700.530.380.151036260/2072520 Protobuf::Field::EnumField#decode
0.580.430.16990985/19819700.600.420.181036260/2072520 Protobuf::Field::Int64Field(singleton)#set
1% 1%1.090.790.3019819701.130.800.332072520 Protobuf::Field::IntegerField#decode
0.200.200.220.22 0.001981970/6936895##&
1.040.670.375945910/5945910Protobuf::Decoder.decode_each_field
1%1%1.040.670.375945910Protobuf::Varint.decode2072520/7253820##&
0.370.370.110.11 0.005945910/5945910ProtobufJavaHelpers::Varinter.read_varint2072520/2072845Numeric#nonzero?
0.990.000.992/112(top)1.120.330.791036260/1036260Protobuf::Field::EnumField#decode
1% 0%0.990.000.99112Kernel.require1.120.330.791036260Protobuf::Field::EnumField#acceptable?
0.590.200.381036260/3108789Protobuf::Enum.fetch
0.990.110.11 0.000.99112/1880Kernel.require1036260/3109338Protobuf::Field::BaseField#type_class
0.890.600.291981971/1981971Protobuf::Field::IntegerField#coerce!1.040.001.032/115(top)
1% 0%0.890.600.291981971Protobuf::Field::IntegerField#acceptable?1.040.001.03115Kernel.require
0.120.121.03 0.001981971/6938279Kernel.kind_of?1.03115/1886Kernel.require
0.870.550.322972955/29729550.910.570.343108780/3108780 Protobuf::Enum.fetch
1% 0%0.870.550.3229729550.910.570.343108780 Protobuf::Enum.enum_for_tag_integer
0.18 0.18 0.002972955/36442639##[]3108780/71156329##[]
0.150.150.170.17 0.002972955/2973417##first3108780/3109269##first
0.840.89 0.000.840.89 1/1 Kernel.require
1% 0%0.840.89 0.000.840.89 1 Bundler.setup
0.440.51 0.010.440.50 1/2 Bundler.definition
0.380.37 0.000.380.37 1/1 Bundler::Runtime#setup
0.840.420.423301704/3301704##each0.870.440.433593944/3593944##each
1% 0%0.840.420.4233017040.870.440.433593944 Benchmark::Timing.now
0.420.420.430.43 0.003301704/33017053593944/3593945 Process.clock_gettime
0.720.720.870.580.282072521/2072521Protobuf::Field::IntegerField#coerce!
1%0%0.870.580.282072521Protobuf::Field::IntegerField#acceptable?
0.110.11 0.006936895/6936895IO::GenericWritable.<<2072521/7255321Kernel.kind_of?
0.710.710.0018521509/20594046Benchmark::IPS::Job::Entry#call_times
1% 1%0.720.720.790.79 0.006936895StringIO#write20594046##<
0.14 0.14 0.00990985/2972956Protobuf::Message#each_field_for_serialization3593404/18522606##each
0.580.460.121981971/2972956Protobuf::Field::StringField(singleton)#set_field
1%0%0.720.600.122972956Test::Resource#_protobuf_message_required_field_tags
0.120.120.001981971/1982937Kernel.dup
0.63 0.63 0.0016555118/1853710514928119/18522606 Benchmark::IPS::Job::Entry#call_times
1% 1%0.720.720.780.78 0.0018537105##<18522606##+
0.150.150.001036260/3108781Protobuf::Message#each_field_for_serialization
0.600.470.132072521/3108781Protobuf::Field::StringField(singleton)#set_field
1%0%0.750.620.133108781Test::Resource#_protobuf_message_required_field_tags
0.13 0.13 0.003301185/16556215##each2072521/2073553Kernel.dup
0.570.570.730.73 0.0013253947/16556215Benchmark::IPS::Job::Entry#call_times7253820/7253820IO::GenericWritable.<<
1% 1%0.700.700.730.73 0.0016556215##+7253820StringIO#write
0.270.180.250.16 0.09990985/29731081036260/3108933 Protobuf::Field::StringField(singleton)#encode_to_stream
0.410.250.161981970/29731080.460.260.202072520/3108933 Protobuf::Field::IntegerField#encode
1% 0%0.690.430.2629731080.710.420.293108933 Protobuf::Field::VarintField.encode
0.260.260.290.29 0.002973108/29731083108933/3108933 ProtobufJavaHelpers::Varinter.to_varint
0.120.120.130.13 0.002972955/69368953108780/7253820 Protobuf::Decoder.decode_each_field
0.200.200.220.22 0.001981970/69368952072520/7253820 Protobuf::Field::IntegerField#decode
0.25 0.25 0.001981970/69368952072520/7253820 Protobuf::Field::IntegerField#encode
0% 0%0.570.570.610.61 0.006936895##&7253820##&
0.530.360.570.41 0.161981971/19819712072521/2072521 Protobuf::Field::StringField(singleton)#set_field
0% 0%0.530.360.570.41 0.1619819712072521 Protobuf::Field::StringField#coerce!
0.520.510.010.501/2Bundler.setup
0%0%0.510.010.502Bundler.definition
0.410.000.411/1Bundler::Definition.build
0.48 0.060.450.42 17/19 (top)
0% 0%0.520.48 0.060.450.42 19 Kernel.load
0.410.38 0.030.392/18800.362/1886 Kernel.require
0.440.010.441/2Bundler.setup0.460.460.006217560/6217560Protobuf::Varint.decode
0% 0%0.440.010.442Bundler.definition0.460.460.006217560ProtobufJavaHelpers::Varinter.read_varint
0.350.430.43 0.000.351/1Bundler::Definition.build3593944/3593945Benchmark::Timing.now
0%0%0.430.430.003593945Process.clock_gettime
0.360.33 0.000.361/8380.331/873 Bundler::Runtime#requested_specs
0.42 0.00 0.42838873 Kernel.send
0.360.33 0.000.360.33 1/1 Bundler::Definition#requested_specs
0.420.420.41 0.003301704/3301705Benchmark::Timing.now0.411/1Bundler.definition
0% 0%0.420.420.41 0.003301705Process.clock_gettime0.411Bundler::Definition.build
0.420.260.15990985/990985Protobuf::Field::StringField(singleton)#set
0%0%0.420.260.15990985Protobuf::Field::StringField#decode0.400.000.401/1Bundler::Dsl.evaluate
0.380.40 0.000.380.40 1/1Bundler.setupBundler::Definition.build
0% 0%0.380.40 0.000.380.40 1Bundler::Runtime#setupBundler::Dsl.evaluate
0.360.30 0.000.360.30 1/1Bundler::Runtime#requested_specsBundler::Dsl#to_definition
0.370.370.005945910/5945910Protobuf::Varint.decode0.400.240.161036260/1036260Protobuf::Field::StringField(singleton)#set
0% 0%0.370.400.240.161036260Protobuf::Field::StringField#decode
0.37 0.005945910ProtobufJavaHelpers::Varinter.read_varint0.371/1Bundler.setup
0% 0%0.360.360.37 0.008919759Kernel.nil?0.371Bundler::Runtime#setup
0.330.000.331/1Bundler::Runtime#requested_specs
0.120.120.110.11 0.001981971/69382792072521/7255321 Protobuf::Field::IntegerField#acceptable?
0.110.110.002072521/7255321Protobuf::Field::IntegerField#coerce!
0.140.140.14 0.002972964/69382793108789/7255321 Protobuf::Enum.fetch
0.36 0.36 0.0069382797255321 Kernel.kind_of?
0%0%0.350.350.009327308Kernel.nil?
0.360.33 0.000.360.33 1/1 Bundler::Runtime#setup
0% 0%0.360.33 0.000.360.33 1 Bundler::Runtime#requested_specs
0.360.33 0.000.361/8380.331/873 Kernel.send
0.360.33 0.000.360.33 1/1 Kernel.send
0% 0%0.360.33 0.000.360.33 1 Bundler::Definition#requested_specs
0.360.33 0.000.360.33 1/1 Bundler::Definition#specs_for
0.360.33 0.000.360.33 1/1 Bundler::Definition#requested_specs
0% 0%0.360.33 0.000.360.33 1 Bundler::Definition#specs_for
0.350.32 0.000.350.32 1/1 Bundler::Definition#specs
0.350.32 0.000.350.32 1/1Bundler.definitionBundler::Definition#specs_for
0% 0%0.350.32 0.000.350.32 1Bundler::Definition.buildBundler::Definition#specs
0.340.21 0.000.340.21 1/1Bundler::Dsl.evaluateBundler::SpecSet#materialize
0.350.30 0.000.350.30 1/1Bundler::Definition#specs_forBundler::Dsl.evaluate
0% 0%0.350.30 0.000.350.30 1Bundler::Definition#specs
0.220.000.221/1Bundler::SpecSet#materializeBundler::Dsl#to_definition
0.110.000.111/1Bundler::Definition#resolve0.300.010.301/2074044Class#new
0.340.30 0.000.340.29 1/1Bundler::Definition.buildClass#new
0% 0%0.340.30 0.000.340.29 1Bundler::Dsl.evaluateBundler::Definition#initialize
0.240.10 0.000.240.10 1/1Bundler::Dsl#to_definitionBundler::Definition#converge_paths
0.340.090.25990985/1981970##each_key0.290.290.003108933/3108933Protobuf::Field::VarintField.encode
0% 0%0.340.090.251981970Protobuf::Field::EnumField(singleton)#value_from_values0.290.290.003108933ProtobufJavaHelpers::Varinter.to_varint
0.260.150.280.17 0.11980985/990985Proc#call1036260/1036528Protobuf::Field::EnumField#encode
0% 0%0.270.150.12990985StringIO.new0.280.170.111036528Protobuf::Enum#to_i
0.120.120.110.11 0.00990985/990985StringIO#initialize1036528/1036528Protobuf::Enum#tag
0.280.090.191036260/2072520##each_key
0%0%0.280.090.192072520Protobuf::Field::EnumField(singleton)#value_from_values
0.11 0.11 0.00990985/29733971036260/3109338 Protobuf::Field::EnumField#acceptable?
0.15 0.15 0.001981970/29733972072520/3109338 Protobuf::Field::EnumField#coerce!
0% 0%0.270.270.260.26 0.0029733973109338 Protobuf::Field::BaseField#type_class
0.260.260.002973108/2973108Protobuf::Field::VarintField.encode0.250.140.111026260/1036260Proc#call
0% 0% 0.260.260.140.121036260StringIO.new
0.120.12 0.002973108ProtobufJavaHelpers::Varinter.to_varint1036260/1036260StringIO#initialize
0.250.140.10990985/991253Protobuf::Field::EnumField#encode0.210.210.004145040/4145040Protobuf::Decoder.decode_each_field
0% 0%0.250.140.10991253Protobuf::Enum#to_i
0.100.100.210.21 0.00991253/991253Protobuf::Enum#tag4145040StringIO#eof
0.240.21 0.000.240.21 1/1Bundler::Dsl.evaluateBundler::Definition#specs
0% 0%0.240.21 0.000.240.21 1Bundler::Dsl#to_definitionBundler::SpecSet#materialize
0.240.010.241/1983436Class#new0.110.000.111/412##map!
0.240.000.231/1Class#new0.190.140.061036260/1037071Protobuf::Field::StringField(singleton)#encode_to_stream
0% 0%0.240.200.140.061037071BasicObject#!=
0%0%0.200.20 0.000.231Bundler::Definition#initialize2072662##+
0.190.180.18 0.000.191/400Bundler::SpecSet#materialize3593394/3593394##each
0% 0%0.230.020.22400##map!0.180.180.003593394##<
0.190.12 0.000.1939/39Bundler::LazySpecification#__materialize__
0.220.000.221/1Bundler::Definition#specs0.12109/153Protobuf::Message::Fields::ClassMethods.optional
0% 0%0.220.17 0.000.221Bundler::SpecSet#materialize0.17153Protobuf::Message::Fields::ClassMethods.define_field
0.190.16 0.000.191/400##map!0.16153/153Protobuf::Field.build
0.190.170.17 0.000.1939/39##map!4145040/4148208Protobuf::Decoder.decode_each_field
0% 0%0.190.170.17 0.000.1939Bundler::LazySpecification#__materialize__4148208##==
0.160.170.17 0.000.1638/38Bundler::Source::Rubygems#specs3108780/3109269Protobuf::Enum.enum_for_tag_integer
0% 0%0.190.190.170.17 0.001982108##+3109269##first
0.190.190.16 0.003963940/3963940Protobuf::Decoder.decode_each_field0.16153/153Protobuf::Message::Fields::ClassMethods.define_field
0% 0%0.190.190.16 0.003963940StringIO#eof0.16153Protobuf::Field.build
0.160.010.15153/2074044Class#new
0.100.100.160.16 0.003/642Gem::Specification.gemspec_stubs_in2072521/2072705Protobuf::Field::StringField(singleton)#set_field
0% 0%0.190.110.07642##map0.160.160.002072705##delete
0.180.120.06990985/991766Protobuf::Field::StringField(singleton)#encode_to_stream0.150.010.14153/153Class#new
0% 0%0.180.120.06991766BasicObject#!=0.150.010.14153Protobuf::Field::BaseField#initialize
0.120.11 0.00 0.11109/153Protobuf::Message::Fields::ClassMethods.optional1/412Bundler::SpecSet#materialize
0% 0%0.180.000.17153Protobuf::Message::Fields::ClassMethods.define_field0.150.020.13412##map!
0.170.11 0.000.17153/153Protobuf::Field.build0.1139/39Bundler::LazySpecification#__materialize__
0.170.170.150.15 0.001981971/1982154Protobuf::Field::StringField(singleton)#set_field3108780/3108780Protobuf::Decoder.decode_each_field
0% 0%0.170.170.150.15 0.001982154##delete3108780##>>
0.170.000.17153/153Protobuf::Message::Fields::ClassMethods.define_field
0% 0%0.170.000.17153Protobuf::Field.build
0.160.010.15153/1983436Class#new0.140.060.081137BasicObject#instance_eval
0.170.170.130.13 0.003963940/3966993Protobuf::Decoder.decode_each_field2072521/2073553Test::Resource#_protobuf_message_required_field_tags
0% 0%0.170.170.130.13 0.003966993##==2073553Kernel.dup
0%0%0.130.030.1061Kernel.eval
0.160.12 0.000.161/2Bundler::Source::Rubygems#installed_specs0.12109/109Kernel.require
0% 0%0.170.12 0.000.162Bundler::Index.build0.12109Protobuf::Message::Fields::ClassMethods.optional
0.150.12 0.000.151/1Bundler::RubygemsIntegration::MoreFuture#all_specs0.12109/153Protobuf::Message::Fields::ClassMethods.define_field
0.160.120.12 0.000.1638/38Bundler::LazySpecification#__materialize__1036260/1036260Protobuf::Decoder.decode_each_field
0% 0%0.160.120.12 0.000.1638Bundler::Source::Rubygems#specs1036260StringIO#read
0.160.120.12 0.000.161/1Bundler::Source::Rubygems#installed_specs1036260/1036260StringIO.new
0%0%0.120.120.001036260StringIO#initialize
0.160.11 0.000.160.11 1/1Bundler::Source::Rubygems#specsKernel.require
0% 0%0.160.11 0.000.160.11 1Bundler::Source::Rubygems#installed_specsGem::Specification.load_defaults
0.160.11 0.000.161/2Bundler::Index.build0.111/1Gem::Specification.each_spec
0.150.010.15153/153Class#new0.110.000.111/1Gem::Specification.load_defaults
0% 0%0.150.010.15153Protobuf::Field::BaseField#initialize0.110.000.111Gem::Specification.each_spec
0.150.150.003301175/3301175##each
0%0%0.150.150.11 0.003301175##<0.111/1Gem::Specification.each_gemspec
0.150.11 0.000.150.11 1/1Bundler::Index.buildGem::Specification.each_spec
0% 0%0.150.11 0.000.150.11 1Bundler::RubygemsIntegration::MoreFuture#all_specsGem::Specification.each_gemspec
0.150.11 0.000.151/1Gem::Specification.stubs0.111/1037819##each
0.150.150.110.11 0.002972955/2973417Protobuf::Enum.enum_for_tag_integer2072520/2072845Protobuf::Field::IntegerField#decode
0% 0%0.150.150.110.11 0.002973417##first2072845Numeric#nonzero?
0.150.000.151/1Bundler::RubygemsIntegration::MoreFuture#all_specs
0% 0%0.150.11 0.000.151Gem::Specification.stubs0.1113Bundler::SpecSet#sorted
0.130.11 0.000.131/1Gem::Specification.installed_stubs
0%0%0.140.060.081137BasicObject#instance_eval0.114/4TSort.tsort
0.130.10 0.000.132/3##each0.101/172Bundler::Definition#converge_paths
0% 0%0.140.11 0.000.143Gem::Specification.gemspec_stubs_in0.11172##any?
0.100.10 0.003/642##map0.102/2Bundler::Definition#specs_changed?
0.140.140.11 0.002972955/2972955Protobuf::Decoder.decode_each_field0.114/176##to_a
0% 0%0.140.140.110.000.11176Enumerator#each
0.11 0.002972955##>>
0%0%0.130.030.1060Kernel.eval0.114/8TSort.tsort_each
0.130.11 0.000.131/1Gem::Specification.stubs0.114/4Bundler::SpecSet#sorted
0% 0%0.130.11 0.000.131Gem::Specification.installed_stubs0.114TSort.tsort
0.130.11 0.000.131/1Gem::Specification.map_stubs0.114/4TSort.tsort
0.130.11 0.000.131/1Gem::Specification.installed_stubs0.114/4TSort.tsort
0% 0%0.130.11 0.000.131Gem::Specification.map_stubs0.114TSort.tsort
0.130.11 0.000.131/1##flat_map0.114/4##to_a
0.130.11 0.000.131/1Gem::Specification.map_stubs0.114/8Enumerator#each
0% 0%0.130.11 0.000.131##flat_map0.118TSort.tsort_each
0.130.11 0.000.131/992490##each0.114/4TSort.each_strongly_connected_component
0.120.120.11 0.001981971/1982937Test::Resource#_protobuf_message_required_field_tags0.114/4TSort.tsort
0% 0%0.120.120.11 0.001982937Kernel.dup0.114##to_a
0.110.000.114/176Enumerator#each
0.120.11 0.000.121/1Kernel.require0.114/4TSort.tsort_each
0% 0%0.120.11 0.000.121Gem::Specification.load_defaults0.114TSort.each_strongly_connected_component
0.120.11 0.000.121/1Gem::Specification.each_spec0.114/122Method#call
0.120.11 0.000.121/1Gem::Specification.load_defaults0.114/122TSort.each_strongly_connected_component
0% 0%0.120.11 0.000.121Gem::Specification.each_spec0.11122Method#call
0.120.11 0.000.121/1Gem::Specification.each_gemspec0.114/4Bundler::SpecSet#tsort_each_node
0.100.000.10118/118Bundler::SpecSet#tsort_each_child
0.120.11 0.000.121/1Gem::Specification.each_spec0.114/4Method#call
0% 0%0.120.11 0.000.121Gem::Specification.each_gemspec0.114Bundler::SpecSet#tsort_each_node
0.120.11 0.000.121/992490##each0.114/1037819##each
0.120.110.11 0.000.12109/109Kernel.require1036528/1036528Protobuf::Enum#to_i
0% 0%0.120.110.11 0.000.12109Protobuf::Message::Fields::ClassMethods.optional1036528Protobuf::Enum#tag
0.120.11 0.000.10118/118##each
0%0% 0.11109/153Protobuf::Message::Fields::ClassMethods.define_field0.000.10118TSort.each_strongly_connected_component_from
0.120.120.11 0.00990985/990985Protobuf::Decoder.decode_each_field0.1139/39##map!
0% 0%0.120.120.11 0.00990985StringIO#read0.1139Bundler::LazySpecification#__materialize__
0.120.120.100.10 0.00990985/990985StringIO.new1026260/1036260Proc#call
0% 0%0.120.120.110.11 0.00990985StringIO#initialize1036260Protobuf::Message#to_proto
0.110.10 0.000.110.10 1/1Bundler::Definition#specsBundler::Definition#initialize
0% 0%0.110.10 0.000.110.10 1Bundler::Definition#resolveBundler::Definition#converge_paths
0.100.000.101/172##any?
0.100.000.102/2##any?
0% 0% 0.10 0.00 0.106Bundler::SpecSet#for2Bundler::Definition#specs_changed?
0.100.010.096/6Kernel.loop0.000.102/2Bundler::Definition#specs_for_source_changed?
0.100.10 0.00991253/991253Protobuf::Enum#to_i0.102/2Bundler::Definition#specs_changed?
0% 0% 0.100.000.102Bundler::Definition#specs_for_source_changed?
0%0% 0.10 0.00991253Protobuf::Enum#tag0.105Bundler::Source::Path#specs
0.100.010.096/6Bundler::SpecSet#for0.000.10118/118Method#call
0% 0% 0.100.010.096Kernel.loop
0.000.10118Bundler::SpecSet#tsort_each_child
@@ -67,195 +67,204 @@

Total time: 63.27

- + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - - + + - + - + - - - + + + - + - - + + - - - - - + + + + + - + - - - - + + + + - + - - - - + + + + - + - - + + - + - - + + - - + + - + + + - - - + + + + + + + + + + - + - + - + - + - - - + + + - + - + - + - + - + @@ -264,381 +273,381 @@

Total time: 63.27

- + - + - - + + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - - - - + + + + - + - - - - + + + + - + - - + + - - + + - + - - + + - - + + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - + + - + - + - + - + - + - + - + - + - + - - - + + + - + - - - - + + + + - - - - + + + + - + - - - - - + + + + + - + - - - - + + + + - + - - - - + + + + - - - - - - - - - - + - - - - + + + + - + - - - - - + + + + + - + - - + + - + - + - - - - + + + + + + + + + + + + + - + - - - - + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - + + + + - - - - + + + + - + - - - - - + + + + + @@ -648,7 +657,7 @@

Total time: 63.27

- + @@ -659,1904 +668,1681 @@

Total time: 63.27

- + - - - - + + + + - + - - - + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - - - + + + + - - - - - - + + + + + + - + - - - - + + + + - + - - - - + + + + - + - - + + - + - + - - + + - - + + - + - - + + - - + + - + - - + + - - + + - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + + + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - + - - - - - + + + + + - + - - - - + + + + - + - - - - - + + + + + - + - - + + - - + + - + - - + + - + - - - - + + + + - - - - + + + + - + - - - - - + + + + + - + - - + + - + - + - - - - - + + + + + - - - - - - - + + + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - + - - - - - + + + + + - + - + + - - - - - - - - - - - - + + - + - - - - - + + + + + - - - - + + + + - + - + - - + + - + - - + + - - + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + - + - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - - + + - - - - + + + + - - + + - + - - - - - + + + + + - - - - - - - + + + + + + + - + - - - - - + + + + + - - + - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - + + - - - - - + + + + + - - + + + + + + + + + + - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - + - - - - - + + + + + - - + - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - + - - - - + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - + + - - + + - + - - + + - - + + - - + - - - - - + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - - + + + + + + + - + - - - - - - - - - - - - - - - - - - - - + + - + + - - - - - + + + + + - - - - - - + + + + + - - - - - - - - - - - - - - - - + + + + + + + - + - - + + - - + + - + - + - - + + - + - - - + + + - + - - - - + + + + - + - - - - - + + + + + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - - - - + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - + + - - - + - - - - - - - - - - - + + + - - + - - + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - + - - - - - + + + + + - + - - - - - + + + + + - - - - - - - - - - - - - - - - + + + + + + + - + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - + - - + + - - + + - + - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + + - - + + - - + + - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - + + + + + - - + + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - + + + + - - - - + + + + - - + - + + - - - - + + + + - - - - + + + + - + - - + + - + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - - - - - + + + + + - - - - - - - + + + + + + + - + - - - - - + + + + + - - + - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - - + + - - + + - - + + - - + + - + - - - - - + + + + + - + - - - - - + + + + + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - - - - - + + + + + - + - - + + - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - + + - - + + - - - - - - + + + + + - - - - - - + + + + + + - + - - + + - - + + - + - - + + - - + + - - + + - - + + - - - - - + + + + + - + + + + + + + + + + - - + + - - + + - - - - - + + + + + - - + + @@ -2565,240 +2351,222 @@

Total time: 63.27

- - + + - - - - - + + + + + - - - - - - - - - - - - + + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - + + + + + - - - - - + + + + + - + - - + + - - + + - + - - - - - + + + + + - + + + + + + + + + + - - - - - + + + + + + - - + + - - + + - - + + - - + + - - - - - + + + + + - - - - - + + + + + - + + + + + + + + + + - + - + - + - + - + - + - + - + - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - - - - - - - - - - - - - - - - + - - - + + + - + @@ -2814,13 +2582,13 @@

Total time: 63.27

- + - + - + @@ -2829,101 +2597,120 @@

Total time: 63.27

- + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -2932,54 +2719,7 @@

Total time: 63.27

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -2998,7 +2738,7 @@

Total time: 63.27

- + @@ -3026,7 +2766,7 @@

Total time: 63.27

- + @@ -3035,7 +2775,7 @@

Total time: 63.27

- + @@ -3054,7 +2794,7 @@

Total time: 63.27

- + @@ -3063,7 +2803,63 @@

Total time: 63.27

- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3082,7 +2878,7 @@

Total time: 63.27

- + @@ -3091,80 +2887,126 @@

Total time: 63.27

- + + + + + + + + + + - + - + - + - + - + - + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - + + + + + - - + + + + + + + + + + + - - + + @@ -3173,7 +3015,7 @@

Total time: 63.27

- + @@ -3182,16 +3024,16 @@

Total time: 63.27

- + - + - + @@ -3199,75 +3041,133 @@

Total time: 63.27

- - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - + - - - - - + + + + + + + + + + + + + + + - - + + - + - - + + - + - - - - - + + + + + - - - - - + + + + + - + + - - + + - - + + + + + + + + + + + @@ -3276,7 +3176,7 @@

Total time: 63.27

- + @@ -3285,10 +3185,10 @@

Total time: 63.27

- - + + - + @@ -3307,99 +3207,89 @@

Total time: 63.27

- - - - - - - - - - + - - - - - + + + + + - - - - - + + + + + - - - - - - + + + + - - + + + - + - - - + + + - - - + + + - + + + + + + + + + + - + + - - - + + - - - - - - - - - - + + - - - + + - + - + @@ -3408,18 +3298,18 @@

Total time: 63.27

- - + + - + - - + + @@ -3427,186 +3317,204 @@

Total time: 63.27

- - + + - - + + - + - - + + - - - - - - - - - - + - + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - + + + + + + + + + + + + + - + - + - - - + + + - - - - - + + + + + - + - + - - - + + + - + - - + - - + + + - - + - - + + + - - - - + + + - - - - + + + + - + - - + + - - + + - - + + - - - - - - - - - - - - + + - + - + - + - + - + - + - + - + @@ -3614,329 +3522,359 @@

Total time: 63.27

- - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - + - - - + + + - + - + + + + + + + + + + + - - + + - + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - - + - - + + + - - + + + + + + + + + + - - + + + + + + + + + + + + + - - + - - - + + + - + - + - + - + - + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - + - - - + + + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + + + - - - - + + + + - - - - + + - + + - + + - - - + + + + + + + + + + + - + - + + - - - + + - + + - - - + + - - - - + + + + + + - - - + + @@ -3945,63 +3883,45 @@

Total time: 63.27

- - + + - + - - - + + + - + - - + + - + - - - + + + - - - - - - - - - - - - - - - - - - - - + + @@ -4010,8 +3930,8 @@

Total time: 63.27

- - + + @@ -4019,27 +3939,37 @@

Total time: 63.27

- - + + - + + + + + + + + + - - + + + + - + - - + + @@ -4047,37 +3977,37 @@

Total time: 63.27

- - + + + - - - + + + - - - + + - + - - + + @@ -4085,122 +4015,150 @@

Total time: 63.27

- - + + + + + + + + + + + - + - - + - - + + + + + + + + + + + - - + + + - + - + - - - + + + + + + + + + + + + + - - + + - + - - + + - + - - - + + + - - - - - - - - - - - + + - + - - - + + + + + + + + + + + - - + + + + - - - + + - + - - + + @@ -4208,1253 +4166,1248 @@

Total time: 63.27

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + - - - - - - + + - - - - - - - - - + + + + - - - - - + - + + + + + + + + + - + - - + + + + + + - - - - + + + - + + + + + + + + + + + + + + + - + + + - - - - + + - - - + - - + + + + + + - + - + + + - - + + + + + - - - - - - - - - - - - - - + + + + + + + + + + - + + - - - - + + - - + + + - - + - + + + + - - - - - - - - - - - - - - + + - - - - - - + - - - + - - - - - + + + - - + + + + - + - + - + - - - + + + + - - - - - - + + + + + - - - - + - - - + - - - + + + + + + + + + + + - - - - - - - + + + + + - + + + + - - - - - - + + + - - - - - - - + + + + + + - - - + + + - + + + - - - - - + + + - - - - - + + - - - - - - - - - - - + + + + + - - + + + + + + - - - + + + + + + + + + + + + + - - + - - + + + - - - - - - + + + + + + - - - + + + - - - - - + + + + + + + + - - + + - + + + + + - - - - - - + + - - + + - - - - - + + - + + + - - - - + + + + + + + + - - - - - - - + + + + + + + - + - - - - + + - - - - - + + + + + + - + + + + + - - - - - - - - + + + - - + - - - - + - + + + - - - - - + - - - - + - - - - - - - - - - - - - - + - - - + + - - + + + - + + + + - - + + + + + + + + + + - - + + + + + + + + + + + + + - + + - - - - - - - - + - + + + + + + + + - - - - - + + + - - - - - - - - - - - - - - - - + - - + + + + + + - - + + + + + + - - + + - - - + - - - - - - - - + + - - + + - - - - - - + + + + - - + - - - + + + + + + + + + - + + + + + + - - + - - + + - + + + + + + + + + + + + + + + + + - - - - - - - - + + + - - + + + + + + - - - - - - - + - + + + + - + - - - + + + - + - + + + + - + + - + + + - - + + - - - - - - + + - + + + - - - - + + - - - + - + + + - - - + + + - - - + + - - - + - + - - - - + + + - - - - - - + - + + + - + - + + + + + + + + + + + + + + - - + + - - + + + - - - - + - - - - - + + + - + - - + + @@ -5464,8 +5417,11 @@

Total time: 63.27

+ + + @@ -5473,26 +5429,25 @@

Total time: 63.27

+ - + + - - - @@ -5504,19 +5459,18 @@

Total time: 63.27

- - + @@ -5527,34 +5481,35 @@

Total time: 63.27

+ - - - + + + + - @@ -5562,6 +5517,7 @@

Total time: 63.27

+ @@ -5573,9 +5529,9 @@

Total time: 63.27

+ - @@ -5586,7 +5542,6 @@

Total time: 63.27

- @@ -5601,7 +5556,6 @@

Total time: 63.27

- From 9468229ce4d1e1d118b0c12e18c24f1890e5edd2 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Thu, 27 Dec 2018 17:47:24 -0700 Subject: [PATCH 16/93] remove unneeded comment --- lib/protobuf/message/serialization.rb | 1 - profile.html | 5610 ++++++++++++------------- 2 files changed, 2724 insertions(+), 2887 deletions(-) diff --git a/lib/protobuf/message/serialization.rb b/lib/protobuf/message/serialization.rb index 246168de..9da948ca 100644 --- a/lib/protobuf/message/serialization.rb +++ b/lib/protobuf/message/serialization.rb @@ -76,7 +76,6 @@ def encode_to(stream) private def set_field_bytes(tag, bytes) - #field = self.class.get_field(tag, true) field = _protobuf_message_field[tag] field.set(self, bytes) if field end diff --git a/profile.html b/profile.html index b4e04e95..301a2adf 100644 --- a/profile.html +++ b/profile.html @@ -52,7 +52,7 @@

Profile Report: main

-

Total time: 63.20

+

Total time: 63.22

%Total
100% 0%63.2763.20 0.0063.2763.20 0 (top)
60.1060.08 0.0060.1060.08 1/1 Benchmark::IPS.ips
1.041.01 0.001.031.00 2/115 Kernel.require
0.920.93 0.000.920.93 6/1886 Kernel.require
0.730.65 0.040.690.61 1/5##times##times
0.480.53 0.060.420.47 17/19 Kernel.load
0.110.13 0.000.114/10378190.124/1265137 Bundler::SpecSet#tsort_each_node
0.110.14 0.000.111/10378190.141/1265137 Gem::Specification.each_gemspec
0.230.24 0.00 0.2319/103781919/1265137 Kernel.require
20.001.8318.171/10378191.8018.201/1265137 Benchmark::IPS::Job#run_warmup
40.0940.07 0.0140.091/103781940.071/1265137 Benchmark::IPS::Job#run_benchmark
96% 2%60.951.8759.081037819##each60.941.8459.091265137##each
57.052.7754.283593390/359339057.022.9254.103554696/3554696 Benchmark::IPS::Job::Entry#call_times
0.870.440.433593944/35939440.910.450.463555260/3555260 Benchmark::Timing.now
0.18 0.18 0.003593394/3593394##<3554700/3554700##<
0.140.140.150.15 0.003593404/18522606##+3554710/18454858##+
0.120.01 0.110.000.10 118/118 TSort.each_strongly_connected_component_from
0.110.000.1113/14Gem::Specification.load
0.730.65 0.040.690.61 1/5 (top)
60.1060.07 0.0060.1060.07 2/5 Benchmark::IPS::Job#run
96% 0%60.850.0560.8060.750.0660.69 5##times##times
40.0940.07 0.0040.0940.07 1/1 Benchmark::IPS::Job#run_benchmark
20.00 1/1 Benchmark::IPS::Job#run_warmup
0.340.29 0.000.3310000/10362600.2910000/1263578 Protobuf::Message::Serialization::ClassMethods.decode_from
0.210.19 0.010.2110000/10362600.1810000/1263578 Protobuf::Encoder.encode
60.1060.08 0.0060.1060.08 1/1 (top)
94%95% 0%60.1060.08 0.0060.1060.08 1 Benchmark::IPS.ips
60.1060.08 0.0060.1060.08 1/1 Benchmark::IPS::Job#run
60.1060.08 0.0060.1060.08 1/1 Benchmark::IPS.ips
94%95% 0%60.1060.08 0.0060.1060.08 1 Benchmark::IPS::Job#run
60.1060.07 0.0060.1060.07 2/5##times##times
57.052.7754.283593390/3593390##each57.022.9254.103554696/3554696##each
90% 4%57.052.7754.28359339057.022.9254.103554696 Benchmark::IPS::Job::Entry#call_times
52.942.2050.7414928119/1492866752.792.3150.4914899065/14899613 Proc#call
0.710.710.700.70 0.0018521509/20594046##<18453761/18453786##<
0.630.630.610.61 0.0014928119/18522606##+14899065/18454858##+
52.942.2050.7414928119/1492866752.792.3150.4914899065/14899613 Benchmark::IPS::Job::Entry#call_times
83% 3%52.972.2050.771492866752.822.3150.5114899613 Proc#call
22.242.5019.7413901859/1390185922.292.3619.9313645487/13645487 Protobuf::Message#to_hash
13.710.2513.461026260/103626013.180.3012.871253578/1263578 Protobuf::Message::Serialization::ClassMethods.decode_from
8.670.278.401026260/10362608.720.308.421253578/1263578 Protobuf::Encoder.encode
3.940.143.801026260/20740443.740.173.571253578/2528680 Class#new
1.770.251.531026260/10362602.110.291.821253578/1263578 Test::Resource#status=
0.250.140.111026260/10362600.270.170.101253578/1263578 StringIO.new
0.100.100.110.11 0.001026260/10362601253578/1263578 Protobuf::Message#to_proto
40.0940.07 0.0040.0940.07 1/1##times##times
63% 0%40.0940.07 0.0040.0940.07 1 Benchmark::IPS::Job#run_benchmark
40.0940.07 0.0140.091/1037819##each40.071/1265137##each
8.011.406.611036260/149381207.921.576.361263578/14909066 Protobuf::Message#each_field_for_serialization
19.745.9413.8013901859/1493812019.935.8514.0913645487/14909066 Protobuf::Message#to_hash
43%44% 11%27.757.3420.4114938120##each_key27.867.4120.4514909066##each_key
5.452.363.0913901859/139018595.602.353.2513645487/13645487 Protobuf::Field::StringField(singleton)#to_message_hash
5.262.263.0013901859/139018595.412.243.1713645487/13645487 Protobuf::Field::Int64Field(singleton)#to_message_hash
1.941.940.0030912498/71156329##[]
1.900.611.291036260/10362602.300.731.571263578/1263578 Protobuf::Field::StringField(singleton)#encode_to_stream
1.890.271.621036260/1036260Protobuf::Field::EnumField(singleton)#encode_to_stream2.022.020.0031081708/72277033##[]
1.551.551.541.54 0.0030912498/3713006031081708/38663178 Test::Resource#_protobuf_message_field
1.500.271.231036260/10362601.370.291.081263578/1263578Protobuf::Field::EnumField(singleton)#encode_to_stream
1.090.300.791263578/1263578 Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.340.100.251036260/159743790.400.120.281263578/16172643 Protobuf::Field::StringField(singleton)#value_from_values
0.300.080.221036260/15974379Protobuf::Field::Int64Field(singleton)#value_from_values0.360.100.261263578/2527156Protobuf::Field::EnumField(singleton)#value_from_values
0.280.090.191036260/2072520Protobuf::Field::EnumField(singleton)#value_from_values0.360.100.251263578/16172643Protobuf::Field::Int64Field(singleton)#value_from_values
22.242.5019.7413901859/1390185922.292.3619.9313645487/13645487 Proc#call
35% 3%22.242.5019.741390185922.292.3619.9313645487 Protobuf::Message#to_hash
19.745.9413.8013901859/14938120##each_key19.935.8514.0913645487/14909066##each_key
0.00 20.00 1/1##times##times
31% 1 Benchmark::IPS::Job#run_warmup
20.001.8318.171/1037819##each1.8018.201/1265137##each
0.340.29 0.000.3310000/1036260##times0.2910000/1263578##times
13.710.2513.461026260/103626013.180.3012.871253578/1263578 Proc#call
22%21% 0%14.050.2613.79103626013.470.3113.161263578 Protobuf::Message::Serialization::ClassMethods.decode_from
13.160.2412.921036260/103626012.380.2912.091263578/1263578 Protobuf::Message::Serialization.decode_from
0.630.130.501036260/20740440.780.170.611263578/2528680 Class#new
13.160.2412.921036260/103626012.380.2912.091263578/1263578 Protobuf::Message::Serialization::ClassMethods.decode_from
20%19% 0%13.160.2412.92103626012.380.2912.091263578 Protobuf::Message::Serialization.decode_from
12.921.7511.171036260/103626012.092.129.981263578/1263578 Protobuf::Decoder.decode_each_field
12.921.7511.171036260/103626012.092.129.981263578/1263578 Protobuf::Message::Serialization.decode_from
20%2%12.921.7511.17103626019%3%12.092.129.981263578 Protobuf::Decoder.decode_each_field
9.221.008.223108780/31087807.631.226.413790734/3790734 Protobuf::Message::Serialization.set_field_bytes
1.170.710.466217560/62175601.390.840.547581468/7581468 Protobuf::Varint.decode
0.210.210.280.28 0.004145040/41450405054312/5054312 StringIO#eof
0.170.170.210.21 0.004145040/4148208##==5054312/5057540##==
0.150.150.170.17 0.003108780/3108780##>>3790734/3790734##>>
0.130.130.170.17 0.003108780/7253820##&3790734/3790734##&
0.120.120.140.14 0.001036260/10362601263578/1263578 StringIO#read
9.221.008.223108780/3108780Protobuf::Decoder.decode_each_field
14%1%9.221.008.223108780Protobuf::Message::Serialization.set_field_bytes
3.430.263.181036260/1036260Protobuf::Field::EnumField(singleton)#set
2.260.252.011036260/1036260Protobuf::Field::Int64Field(singleton)#set
2.020.221.801036260/1036260Protobuf::Field::StringField(singleton)#set
0.270.270.003108780/71156329##[]
0.240.240.003108780/37130060Test::Resource#_protobuf_message_field
0.210.19 0.010.2110000/1036260##times0.1810000/1263578##times
8.670.278.401026260/10362608.720.308.421253578/1263578 Proc#call
14% 0%8.890.288.6010362608.910.318.591263578 Protobuf::Encoder.encode
8.600.398.211036260/10362608.590.448.161263578/1263578 Protobuf::Message#each_field_for_serialization
1.280.68 0.171.121036260/6217562Protobuf::Field::EnumField(singleton)#set0.511263578/7581470Protobuf::Field::Int64Field(singleton)#set
1.410.201.211036260/62175621.640.191.461263578/7581470 Protobuf::Field::StringField(singleton)#set
1.410.171.241036260/6217562Protobuf::Field::Int64Field(singleton)#set1.670.161.511263578/7581470Protobuf::Field::EnumField(singleton)#set
1.550.281.281036260/62175621.850.321.531263578/7581470 Test::Resource#status=
3.110.522.582072522/6217562##each2.800.632.182527158/7581470##each
13% 2%8.751.337.4262175628.651.467.197581470 Protobuf::Message#set_field
2.370.491.882072521/2072521Protobuf::Field::Int64Field(singleton)#set_field2.890.582.312527156/2527156Protobuf::Field::EnumField(singleton)#set_field
2.350.761.592072521/20725212.800.891.912527157/2527157 Protobuf::Field::StringField(singleton)#set_field
2.270.471.802072520/2072520Protobuf::Field::EnumField(singleton)#set_field0.960.580.382527157/2527157Protobuf::Field::Int64Field(singleton)#set_field
0.230.230.290.29 0.003108782/71156329##[]3790736/72277033##[]
0.210.210.250.25 0.003108782/371300603790736/38663178 Test::Resource#_protobuf_message_field
8.600.398.211036260/10362608.590.448.161263578/1263578 Protobuf::Encoder.encode
13% 0%8.600.398.2110362608.590.448.161263578 Protobuf::Message#each_field_for_serialization
8.011.406.611036260/14938120##each_key7.921.576.361263578/14909066##each_key
0.150.150.170.17 0.001036260/31087811263578/3790735 Test::Resource#_protobuf_message_required_field_tags
5.452.363.0913901859/13901859##each_key7.631.226.413790734/3790734Protobuf::Decoder.decode_each_field
8%3%5.452.363.0913901859Protobuf::Field::StringField(singleton)#to_message_hash12%1%7.631.226.413790734Protobuf::Message::Serialization.set_field_bytes
2.261.590.6813901859/15974379Protobuf::Field::StringField(singleton)#value_from_values2.390.252.131263578/1263578Protobuf::Field::StringField(singleton)#set
0.830.830.0013901859/34025837##[]=2.180.261.921263578/1263578Protobuf::Field::EnumField(singleton)#set
0.160.010.15153/2074044Protobuf::Field.build1.200.250.951263578/1263578Protobuf::Field::Int64Field(singleton)#set
0.300.010.301/2074044Bundler::Dsl#to_definition0.350.350.003790734/72277033##[]
0.630.130.501036260/2074044Protobuf::Message::Serialization::ClassMethods.decode_from0.290.290.003790734/38663178Test::Resource#_protobuf_message_field
3.940.143.801026260/2074044Proc#call5.602.353.2513645487/13645487##each_key
8%0%5.390.385.012074044Class#new3%5.602.353.2513645487Protobuf::Field::StringField(singleton)#to_message_hash
4.390.713.672072521/2072521Protobuf::Message#initialize2.381.590.7913645487/16172643Protobuf::Field::StringField(singleton)#value_from_values
0.300.870.87 0.000.291/1Bundler::Definition#initialize
0.150.010.14153/153Protobuf::Field::BaseField#initialize13645487/34877001##[]=
5.262.263.0013901859/13901859##each_key5.412.243.1713645487/13645487##each_key
8% 3%5.262.263.00139018595.412.243.1713645487 Protobuf::Field::Int64Field(singleton)#to_message_hash
2.202.33 1.550.6413901859/159743790.7813645487/16172643 Protobuf::Field::Int64Field(singleton)#value_from_values
0.800.800.840.84 0.0013901859/34025837##[]=13645487/34877001##[]=
4.390.713.672072521/2072521Class#new0.110.030.0816/2528680Kernel.eval
0.170.010.17153/2528680Protobuf::Field.build
0.290.010.281/2528680Bundler::Dsl#to_definition
0.780.170.611263578/2528680Protobuf::Message::Serialization::ClassMethods.decode_from
3.740.173.571253578/2528680Proc#call
6%1%4.390.713.672072521Protobuf::Message#initialize8%0%5.330.464.872528680Class#new
3.490.383.112072521/2072735##each4.250.813.432527157/2527157Protobuf::Message#initialize
0.280.000.281/1Bundler::Definition#initialize
0.170.010.16153/153Protobuf::Field::BaseField#initialize
0.180.180.150.15 0.003108780/711563292527156/72277033 Protobuf::Enum.enum_for_tag_integer
0.230.230.290.29 0.003108782/711563293790736/72277033 Protobuf::Message#set_field
0.270.270.350.35 0.003108780/711563293790734/72277033 Protobuf::Message::Serialization.set_field_bytes
0.710.710.850.85 0.0014938119/7115632914909065/72277033 Protobuf::Field::Int64Field(singleton)#value_from_values
0.750.750.890.89 0.0014938119/7115632914909065/72277033 Protobuf::Field::StringField(singleton)#value_from_values
1.941.942.022.02 0.0030912498/71156329##each_key31081708/72277033##each_key
6%6%4.164.137%7%4.664.63 0.0371156329##[]72277033##[]
3.490.383.112072521/2072735Protobuf::Message#initialize4.250.813.432527157/2527157Class#new
5%0%3.510.403.112072735##each6%1%4.250.813.432527157Protobuf::Message#initialize
3.110.522.582072522/6217562Protobuf::Message#set_field3.220.422.802527157/2527371##each
3.430.263.181036260/1036260Protobuf::Message::Serialization.set_field_bytes
5%0%3.430.263.181036260Protobuf::Field::EnumField(singleton)#set0.110.110.002527157/2527158##to_hash
1.890.251.651036260/1036260Protobuf::Field::EnumField#decode0.100.100.002527157/2527330Kernel.block_given?
1.280.171.121036260/6217562Protobuf::Message#set_field3.220.422.802527157/2527371Protobuf::Message#initialize
5%0%3.240.432.812527371##each
0.340.100.251036260/15974379##each_key2.800.632.182527158/7581470Protobuf::Message#set_field
2.261.590.6813901859/15974379Protobuf::Field::StringField(singleton)#to_message_hash2.890.582.312527156/2527156Protobuf::Message#set_field
4%2%2.601.680.9215974379Protobuf::Field::StringField(singleton)#value_from_values0%2.890.582.312527156Protobuf::Field::EnumField(singleton)#set_field
0.750.750.0014938119/71156329##[]2.040.471.572527156/2527156Protobuf::Field::EnumField#coerce!
0.300.080.221036260/15974379##each_key0.180.180.002527156/34877001##[]=
2.201.550.6413901859/15974379Protobuf::Field::Int64Field(singleton)#to_message_hash
3%2%2.501.640.8615974379Protobuf::Field::Int64Field(singleton)#value_from_values
0.710.710.0014938119/71156329##[]
2.370.491.882072521/2072521Protobuf::Message#set_field
3%0%2.370.491.882072521Protobuf::Field::Int64Field(singleton)#set_field
1.660.601.062072521/2072521Protobuf::Field::IntegerField#coerce!
0.140.140.002072521/34025837##[]=
2.350.761.592072521/20725212.800.891.912527157/2527157 Protobuf::Message#set_field
3%4% 1%2.350.761.5920725212.800.891.912527157 Protobuf::Field::StringField(singleton)#set_field
0.600.470.132072521/3108781Test::Resource#_protobuf_message_required_field_tags0.690.480.212527157/2527157Protobuf::Field::StringField#coerce!
0.570.410.162072521/2072521Protobuf::Field::StringField#coerce!0.680.530.152527157/3790735Test::Resource#_protobuf_message_required_field_tags
0.180.180.230.23 0.002072521/34025837##[]=2527157/34877001##[]=
0.160.160.210.21 0.002072521/2072705##delete2527157/2527341##delete
0.380.030.362/1886Kernel.load0.100.100.002527157/10109592Kernel.nil?
0.920.000.926/1886(top)0.400.120.281263578/16172643##each_key
1.030.001.03115/1886Kernel.require2.381.590.7913645487/16172643Protobuf::Field::StringField(singleton)#to_message_hash
3%0%2.340.032.311886Kernel.require4%2%2.781.711.0716172643Protobuf::Field::StringField(singleton)#value_from_values
0.890.00 0.891/1Bundler.setup
0.23 0.000.2319/1037819##each
0.120.000.12109/109Protobuf::Message::Fields::ClassMethods.optional14909065/72277033##[]
0.110.000.111/1Gem::Specification.load_defaults0.360.100.251263578/16172643##each_key
2.270.471.802072520/2072520Protobuf::Message#set_field2.331.550.7813645487/16172643Protobuf::Field::Int64Field(singleton)#to_message_hash
3%0%2.270.471.802072520Protobuf::Field::EnumField(singleton)#set_field
1.560.391.172072520/2072520Protobuf::Field::EnumField#coerce!4%2%2.691.651.0316172643Protobuf::Field::Int64Field(singleton)#value_from_values
0.170.170.850.85 0.002072520/34025837##[]=14909065/72277033##[]
2.262.39 0.252.011036260/10362602.131263578/1263578 Protobuf::Message::Serialization.set_field_bytes
3% 0%2.262.39 0.252.011036260Protobuf::Field::Int64Field(singleton)#set2.131263578Protobuf::Field::StringField(singleton)#set
1.410.171.241036260/62175621.640.191.461263578/7581470 Protobuf::Message#set_field
0.600.420.181036260/2072520Protobuf::Field::IntegerField#decode0.490.280.221263578/1263578Protobuf::Field::StringField#decode
0.140.140.160.16 0.002072521/340258372527157/34877001 Protobuf::Field::Int64Field(singleton)#set_field
0.170.170.180.18 0.002072520/340258372527156/34877001 Protobuf::Field::EnumField(singleton)#set_field
0.180.180.230.23 0.002072521/340258372527157/34877001 Protobuf::Field::StringField(singleton)#set_field
0.800.800.840.84 0.0013901859/3402583713645487/34877001 Protobuf::Field::Int64Field(singleton)#to_message_hash
0.830.830.870.87 0.0013901859/3402583713645487/34877001 Protobuf::Field::StringField(singleton)#to_message_hash
3% 3%2.122.110.0134025837##[]=2.382.290.0834877001##[]=
2.020.221.801036260/1036260Protobuf::Message::Serialization.set_field_bytes
3%0%2.020.221.801036260Protobuf::Field::StringField(singleton)#set
1.410.201.211036260/6217562Protobuf::Message#set_field
0.430.03 0.400.240.161036260/1036260Protobuf::Field::StringField#decode2/1886Kernel.load
0.210.210.93 0.003108782/37130060Protobuf::Message#set_field
0.240.240.003108780/37130060Protobuf::Message::Serialization.set_field_bytes0.936/1886(top)
1.551.551.00 0.0030912498/37130060##each_key1.00115/1886Kernel.require
3%3%2.002.000.0037130060Test::Resource#_protobuf_message_field
1.900.611.291036260/1036260##each_key
2% 0%1.900.611.291036260Protobuf::Field::StringField(singleton)#encode_to_stream2.360.032.331886Kernel.require
0.630.310.323108780/7253820IO::GenericWritable.<<0.860.000.861/1Bundler.setup
0.250.160.091036260/3108933Protobuf::Field::VarintField.encode0.240.000.2319/1265137##each
0.19 0.140.061036260/1037071BasicObject#!=
1.890.251.651036260/1036260Protobuf::Field::EnumField(singleton)#set
2%0%1.890.251.651036260Protobuf::Field::EnumField#decode
1.120.330.791036260/1036260Protobuf::Field::EnumField#acceptable?0.000.141/1Gem::Specification.load_defaults
0.530.380.151036260/2072520Protobuf::Field::IntegerField#decode0.140.000.13109/109Protobuf::Message::Fields::ClassMethods.optional
1.890.271.621036260/1036260##each_key2.300.731.571263578/1263578##each_key
2%0%1.890.271.621036260Protobuf::Field::EnumField(singleton)#encode_to_stream
1.250.241.001036260/1036260Protobuf::Field::EnumField#encode3%1%2.300.731.571263578Protobuf::Field::StringField(singleton)#encode_to_stream
0.380.190.182072520/72538200.750.360.403790734/8845046 IO::GenericWritable.<<
1.770.251.531026260/1036260Proc#call
2%0%1.810.261.551036260Test::Resource#status=
1.550.281.281036260/6217562Protobuf::Message#set_field
1.660.601.062072521/2072521Protobuf::Field::Int64Field(singleton)#set_field
2%0%1.660.601.062072521Protobuf::Field::IntegerField#coerce!0.320.220.111263578/1263731Protobuf::Field::VarintField.encode
0.870.580.282072521/2072521Protobuf::Field::IntegerField#acceptable?0.220.160.061263578/1264389BasicObject#!=
0.110.110.140.14 0.002072521/7255321Kernel.kind_of?1263578/2527298##+
0.590.200.381036260/3108789Protobuf::Field::EnumField#acceptable?
1.020.350.672072520/3108789Protobuf::Field::EnumField#coerce!2.180.261.921263578/1263578Protobuf::Message::Serialization.set_field_bytes
2%3% 0%1.610.561.053108789Protobuf::Enum.fetch2.180.261.921263578Protobuf::Field::EnumField(singleton)#set
0.910.570.343108780/3108780Protobuf::Enum.enum_for_tag_integer1.670.161.511263578/7581470Protobuf::Message#set_field
0.140.140.003108789/7255321Kernel.kind_of?0.250.200.051263578/1263578Protobuf::Field::EnumField#decode
1.560.391.172072520/2072520Protobuf::Field::EnumField(singleton)#set_field2.110.291.821253578/1263578Proc#call
2%3% 0%1.560.391.172072520Protobuf::Field::EnumField#coerce!2.150.301.851263578Test::Resource#status=
1.020.350.672072520/3108789Protobuf::Enum.fetch1.850.321.531263578/7581470Protobuf::Message#set_field
0.150.150.250.25 0.002072520/3109338Protobuf::Field::BaseField#type_class3790736/38663178Protobuf::Message#set_field
0.720.400.321036260/2072520Protobuf::Field::EnumField#encode0.290.290.003790734/38663178Protobuf::Message::Serialization.set_field_bytes
0.820.430.391036260/2072520Protobuf::Field::Int64Field(singleton)#encode_to_stream
2%1% 1.540.830.712072520Protobuf::Field::IntegerField#encode
0.460.260.202072520/3108933Protobuf::Field::VarintField.encode1.540.0031081708/38663178##each_key
0.250.25
3%3%2.072.07 0.002072520/7253820##&38663178Test::Resource#_protobuf_message_field
1.500.271.231036260/1036260##each_key2.040.471.572527156/2527156Protobuf::Field::EnumField(singleton)#set_field
2%3% 0%1.500.271.231036260Protobuf::Field::Int64Field(singleton)#encode_to_stream2.040.471.572527156Protobuf::Field::EnumField#coerce!
0.820.430.391036260/2072520Protobuf::Field::IntegerField#encode1.350.450.902527156/2527165Protobuf::Enum.fetch
0.410.19 0.222072520/7253820IO::GenericWritable.<<0.220.002527156/2527714Protobuf::Field::BaseField#type_class
0.380.190.182072520/72538200.430.230.202527156/8845046 Protobuf::Field::EnumField(singleton)#encode_to_stream
0.410.190.46 0.222072520/72538200.242527156/8845046 Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.630.310.323108780/72538200.750.360.403790734/8845046 Protobuf::Field::StringField(singleton)#encode_to_stream
2% 1%1.410.690.7372538201.650.810.838845046 IO::GenericWritable.<<
0.730.730.830.83 0.007253820/72538208845046/8845046 StringIO#write
1.250.241.001036260/1036260Protobuf::Field::EnumField(singleton)#encode_to_stream1.390.840.547581468/7581468Protobuf::Decoder.decode_each_field
2% 1%1.390.840.547581468Protobuf::Varint.decode
0.540.540.007581468/7581468ProtobufJavaHelpers::Varinter.read_varint
1.370.291.081263578/1263578##each_key
2% 0%1.250.241.001036260Protobuf::Field::EnumField#encode1.370.291.081263578Protobuf::Field::EnumField(singleton)#encode_to_stream
0.720.400.321036260/2072520Protobuf::Field::IntegerField#encode0.650.270.381263578/1263578Protobuf::Field::EnumField#encode
0.280.170.111036260/1036528Protobuf::Enum#to_i0.430.230.202527156/8845046IO::GenericWritable.<<
1.170.710.466217560/6217560Protobuf::Decoder.decode_each_field1.350.450.902527156/2527165Protobuf::Field::EnumField#coerce!
1%1%1.170.710.466217560Protobuf::Varint.decode2%0%1.350.450.902527165Protobuf::Enum.fetch
0.460.460.006217560/6217560ProtobufJavaHelpers::Varinter.read_varint0.770.490.282527156/2527156Protobuf::Enum.enum_for_tag_integer
0.530.380.151036260/2072520Protobuf::Field::EnumField#decode0.130.130.002527165/2528655Kernel.kind_of?
0.600.420.181036260/2072520Protobuf::Field::Int64Field(singleton)#set1.200.250.951263578/1263578Protobuf::Message::Serialization.set_field_bytes
1%1%1.130.800.332072520Protobuf::Field::IntegerField#decode0%1.200.250.951263578Protobuf::Field::Int64Field(singleton)#set
0.220.220.002072520/7253820##&0.680.170.511263578/7581470Protobuf::Message#set_field
0.110.110.002072520/2072845Numeric#nonzero?0.270.200.071263578/1263578Protobuf::Field::Int64Field#decode
1.120.331.090.30 0.791036260/1036260Protobuf::Field::EnumField#decode1263578/1263578##each_key
1% 0%1.120.331.090.30 0.791036260Protobuf::Field::EnumField#acceptable?1263578Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.590.200.381036260/3108789Protobuf::Enum.fetch0.460.220.242527156/8845046IO::GenericWritable.<<
0.110.110.001036260/3109338Protobuf::Field::BaseField#type_class0.330.210.121263578/1263578Protobuf::Field::Int64Field#encode
1.041.01 0.001.031.00 2/115 (top)
1% 0%1.041.01 0.001.031.00 115 Kernel.require
1.031.00 0.001.031.00 115/1886 Kernel.require
0.910.570.343108780/3108780Protobuf::Enum.fetch0.960.580.382527157/2527157Protobuf::Message#set_field
1% 0%0.910.570.343108780Protobuf::Enum.enum_for_tag_integer0.960.580.382527157Protobuf::Field::Int64Field(singleton)#set_field
0.180.180.160.16 0.003108780/71156329##[]2527157/34877001##[]=
0.170.170.120.120.002527157/2527157ProtobufJavaHelpers::Int64ProtobufField.coerce!
0.910.450.463555260/3555260##each
1%0%0.910.450.463555260Benchmark::Timing.now
0.460.46 0.003108780/3109269##first3555260/3555261Process.clock_gettime
0.890.86 0.000.890.86 1/1 Kernel.require
1% 0%0.890.86 0.000.890.86 1 Bundler.setup
0.510.49 0.010.500.48 1/2 Bundler.definition
0.370.36 0.000.370.36 1/1 Bundler::Runtime#setup
0.870.440.433593944/3593944##each
1%0%0.870.440.433593944Benchmark::Timing.now
0.430.430.170.17 0.003593944/3593945Process.clock_gettime1263578/3790735Protobuf::Message#each_field_for_serialization
0.870.580.282072521/2072521Protobuf::Field::IntegerField#coerce!0.680.530.152527157/3790735Protobuf::Field::StringField(singleton)#set_field
1%0%0.870.580.282072521Protobuf::Field::IntegerField#acceptable?1%0.850.700.153790735Test::Resource#_protobuf_message_required_field_tags
0.110.110.150.15 0.002072521/7255321Kernel.kind_of?2527157/2528189Kernel.dup
0.710.710.830.83 0.0018521509/20594046Benchmark::IPS::Job::Entry#call_times8845046/8845046IO::GenericWritable.<<
1% 1%0.790.790.830.83 0.0020594046##<8845046StringIO#write
0.140.140.003593404/18522606##each0.770.490.282527156/2527156Protobuf::Enum.fetch
1%0%0.770.490.282527156Protobuf::Enum.enum_for_tag_integer
0.630.630.150.15 0.0014928119/18522606Benchmark::IPS::Job::Entry#call_times2527156/72277033##[]
1%1%0.780.78
0.130.13 0.0018522606##+2527156/2527645##first
0.15 0.15 0.001036260/3108781Protobuf::Message#each_field_for_serialization3554710/18454858##each
0.600.470.132072521/3108781Protobuf::Field::StringField(singleton)#set_field0.610.610.0014899065/18454858Benchmark::IPS::Job::Entry#call_times
1%0%0.750.620.133108781Test::Resource#_protobuf_message_required_field_tags
0.130.131%0.760.76 0.002072521/2073553Kernel.dup18454858##+
0.730.730.700.70 0.007253820/7253820IO::GenericWritable.<<18453761/18453786Benchmark::IPS::Job::Entry#call_times
1% 1%0.730.730.700.70 0.007253820StringIO#write18453786##<
0.250.160.091036260/3108933Protobuf::Field::StringField(singleton)#encode_to_stream
0.460.260.202072520/3108933Protobuf::Field::IntegerField#encode0.690.480.212527157/2527157Protobuf::Field::StringField(singleton)#set_field
1% 0%0.710.420.293108933Protobuf::Field::VarintField.encode0.690.480.212527157Protobuf::Field::StringField#coerce!
0.290.290.120.12 0.003108933/3108933ProtobufJavaHelpers::Varinter.to_varint2527157/2528322##to_s
0.130.130.003108780/7253820Protobuf::Decoder.decode_each_field0.650.270.381263578/1263578Protobuf::Field::EnumField(singleton)#encode_to_stream
1%0%0.650.270.381263578Protobuf::Field::EnumField#encode
0.220.220.002072520/7253820Protobuf::Field::IntegerField#decode0.280.170.111263578/1263846Protobuf::Enum#to_i
0.250.250.540.54 0.002072520/7253820Protobuf::Field::IntegerField#encode7581468/7581468Protobuf::Varint.decode
0% 0%0.610.610.540.54 0.007253820##&7581468ProtobufJavaHelpers::Varinter.read_varint
0.570.410.162072521/2072521Protobuf::Field::StringField(singleton)#set_field0.530.060.4717/19(top)
0% 0%0.570.410.162072521Protobuf::Field::StringField#coerce!0.530.060.4719Kernel.load
0.430.030.402/1886Kernel.require
0.510.49 0.010.500.48 1/2 Bundler.setup
0% 0%0.510.49 0.010.500.48 2 Bundler.definition
0.410.40 0.000.410.39 1/1 Bundler::Definition.build
0.480.060.4217/19(top)0.490.280.221263578/1263578Protobuf::Field::StringField(singleton)#set
0% 0%0.480.060.4219Kernel.load0.490.280.221263578Protobuf::Field::StringField#decode
0.380.030.362/1886Kernel.require0.140.140.001263578/2527298##+
0.46 0.46 0.006217560/6217560Protobuf::Varint.decode
0%0%0.460.460.006217560ProtobufJavaHelpers::Varinter.read_varint
0.430.430.003593944/35939453555260/3555261 Benchmark::Timing.now
0%0%0.430.430%0.460.46 0.0035939453555261 Process.clock_gettime
0% 0%0.420.41 0.000.420.41 873 Kernel.send
0.33 1/1 Bundler::Definition#requested_specs
0.410.40 0.000.410.39 1/1 Bundler.definition
0% 0%0.410.40 0.000.410.39 1 Bundler::Definition.build
0.400.38 0.000.400.38 1/1 Bundler::Dsl.evaluate
0.400.38 0.000.400.38 1/1 Bundler::Definition.build
0% 0%0.400.38 0.000.400.38 1 Bundler::Dsl.evaluate
0.300.29 0.000.300.29 1/1 Bundler::Dsl#to_definition
0.400.240.161036260/1036260Protobuf::Field::StringField(singleton)#set0.100.100.002527157/10109592Protobuf::Field::StringField(singleton)#set_field
0% 0%0.400.240.161036260Protobuf::Field::StringField#decode0.380.380.0010109592Kernel.nil?
0.360.100.261263578/2527156##each_key
0%0%0.360.100.262527156Protobuf::Field::EnumField(singleton)#value_from_values
0.370.36 0.000.370.36 1/1 Bundler.setup
0% 0%0.370.36 0.000.370.36 1 Bundler::Runtime#setup
0.33 1/1 Bundler::Runtime#requested_specs
0.110.110.002072521/7255321Protobuf::Field::IntegerField#acceptable?
0.110.110.002072521/7255321Protobuf::Field::IntegerField#coerce!
0.140.140.003108789/7255321Protobuf::Enum.fetch
0%0%0.360.360.007255321Kernel.kind_of?
0%0%0.350.350.009327308Kernel.nil?
1 Bundler::Runtime#requested_specs
0.33 1 Bundler::Definition#requested_specs
0.33 1/1 Bundler::Definition#specs_for
1 Bundler::Definition#specs_for
0.32 1/1 Bundler::Definition#specs
0.330.210.121263578/1263578Protobuf::Field::Int64Field(singleton)#encode_to_stream
0%0%0.330.210.121263578Protobuf::Field::Int64Field#encode
0.120.120.001263578/2527156ProtobufJavaHelpers::Varinter.to_varint_64
0.320.220.111263578/1263731Protobuf::Field::StringField(singleton)#encode_to_stream
0%0%0.330.220.111263731Protobuf::Field::VarintField.encode
0.110.110.001263731/1263731ProtobufJavaHelpers::Varinter.to_varint
1 Bundler::Definition#specs
0.21 1/1 Bundler::SpecSet#materialize
0.100.000.101/1Bundler::Definition#resolve
0.300.29 0.000.300.29 1/1 Bundler::Dsl.evaluate
0% 0%0.300.29 0.000.300.29 1 Bundler::Dsl#to_definition
0.300.29 0.010.301/20740440.281/2528680 Class#new
0.300.140.140.001263578/2527298Protobuf::Field::StringField#decode
0.140.14 0.001263578/2527298Protobuf::Field::StringField(singleton)#encode_to_stream
0%0% 0.290.290.002527298##+
0.280.000.28 1/1 Class#new
0% 0%0.300.28 0.000.290.28 1 Bundler::Definition#initialize
0.100.11 0.000.100.11 1/1 Bundler::Definition#converge_paths
0.290.290.003108933/3108933Protobuf::Field::VarintField.encode0.270.170.101253578/1263578Proc#call
0% 0%0.290.290.280.180.101263578StringIO.new
0.100.10 0.003108933ProtobufJavaHelpers::Varinter.to_varint1263578/1263578StringIO#initialize
0.28 0.17 0.111036260/10365281263578/1263846 Protobuf::Field::EnumField#encode
0.28 0.17 0.1110365281263846 Protobuf::Enum#to_i
0.11 0.11 0.001036528/10365281263846/1263846 Protobuf::Enum#tag
0.280.090.191036260/2072520##each_key0.280.005054312/5054312Protobuf::Decoder.decode_each_field
0%0%0.280.280.005054312StringIO#eof
0.270.200.071263578/1263578Protobuf::Field::Int64Field(singleton)#set
0%0%0.270.200.071263578Protobuf::Field::Int64Field#decode
0.250.200.051263578/1263578Protobuf::Field::EnumField(singleton)#set
0% 0%0.280.090.192072520Protobuf::Field::EnumField(singleton)#value_from_values0.250.200.051263578Protobuf::Field::EnumField#decode
0.110.110.001036260/3109338Protobuf::Field::EnumField#acceptable?0.220.160.061263578/1264389Protobuf::Field::StringField(singleton)#encode_to_stream
0%0%0.230.160.071264389BasicObject#!=
0.150.150.220.22 0.002072520/31093382527156/2527714 Protobuf::Field::EnumField#coerce!
0% 0%0.260.260.220.22 0.0031093382527714 Protobuf::Field::BaseField#type_class
0.250.140.111026260/1036260Proc#call0.120.120.001263578/2527156Protobuf::Field::Int64Field#encode
0% 0%0.260.140.121036260StringIO.new0.220.220.002527156ProtobufJavaHelpers::Varinter.to_varint_64
0.120.120.210.21 0.001036260/1036260StringIO#initialize2527157/2527341Protobuf::Field::StringField(singleton)#set_field
0%0%0.210.210.002527341##delete
0.21 0.21 0.004145040/41450405054312/5057540 Protobuf::Decoder.decode_each_field
0.21 0.21 0.004145040StringIO#eof5057540##==
1 Bundler::SpecSet#materialize
0.110.000.111/412##map!
0.190.140.061036260/1037071Protobuf::Field::StringField(singleton)#encode_to_stream0.130.000.13109/153Protobuf::Message::Fields::ClassMethods.optional
0% 0%0.200.140.061037071BasicObject#!=0.190.000.18153Protobuf::Message::Fields::ClassMethods.define_field
0%0%0.200.20
0.18 0.002072662##+0.18153/153Protobuf::Field.build
0.180.18 0.003593394/3593394##each0.18153/153Protobuf::Message::Fields::ClassMethods.define_field
0% 0% 0.180.18 0.003593394##<0.18153Protobuf::Field.build
0.170.010.17153/2528680Class#new
0.120.180.18 0.000.12109/153Protobuf::Message::Fields::ClassMethods.optional3554700/3554700##each
0% 0%0.170.000.17153Protobuf::Message::Fields::ClassMethods.define_field
0.160.180.18 0.000.16153/153Protobuf::Field.build3554700##<
0.17 0.17 0.004145040/41482083790734/3790734 Protobuf::Decoder.decode_each_field
0.17 0.17 0.004148208##==3790734##>>
0.17 0.17 0.003108780/3109269Protobuf::Enum.enum_for_tag_integer3790734/3790734Protobuf::Decoder.decode_each_field
0% 0.17 0.17 0.003109269##first3790734##&
0.160.000.170.01 0.16 153/153Protobuf::Message::Fields::ClassMethods.define_fieldClass#new
0% 0%0.160.000.170.01 0.16 153Protobuf::Field.build
0.160.010.15153/2074044Class#newProtobuf::Field::BaseField#initialize
0.160.160.150.15 0.002072521/2072705Protobuf::Field::StringField(singleton)#set_field2527157/2528189Test::Resource#_protobuf_message_required_field_tags
0% 0%0.160.160.150.15 0.002072705##delete2528189Kernel.dup
0%0%0.150.070.081137BasicObject#instance_eval
0%0%0.140.030.1261Kernel.eval
0.110.030.0816/2528680Class#new
0.150.01 0.14153/153Class#new0.000.141/1Kernel.require
0% 0%0.150.01 0.14153Protobuf::Field::BaseField#initialize0.000.141Gem::Specification.load_defaults
0.140.000.141/1Gem::Specification.each_spec
0.110.14 0.000.111/412Bundler::SpecSet#materialize0.141/1Gem::Specification.load_defaults
0% 0%0.150.020.13412##map!0.140.000.141Gem::Specification.each_spec
0.110.14 0.000.1139/39Bundler::LazySpecification#__materialize__0.141/1Gem::Specification.each_gemspec
0.150.150.14 0.003108780/3108780Protobuf::Decoder.decode_each_field0.141/1Gem::Specification.each_spec
0% 0%0.150.150.14 0.003108780##>>0.141Gem::Specification.each_gemspec
0%0%
0.140.060.081137BasicObject#instance_eval0.000.141/1265137##each
0.130.130.140.14 0.002072521/2073553Test::Resource#_protobuf_message_required_field_tags1263578/1263578Protobuf::Decoder.decode_each_field
0% 0%0.130.130.140.14 0.002073553Kernel.dup
0%0%0.130.030.1061Kernel.eval1263578StringIO#read
0.120.14 0.000.120.13 109/109 Kernel.require
0% 0%0.120.14 0.000.120.13 109 Protobuf::Message::Fields::ClassMethods.optional
0.120.13 0.000.120.13 109/153 Protobuf::Message::Fields::ClassMethods.define_field
0.120.120.130.13 0.001036260/1036260Protobuf::Decoder.decode_each_field2527165/2528655Protobuf::Enum.fetch
0% 0%0.120.120.130.13 0.001036260StringIO#read2528655Kernel.kind_of?
0.120.120.130.13 0.001036260/1036260StringIO.new2527156/2527645Protobuf::Enum.enum_for_tag_integer
0% 0%0.120.120.130.13 0.001036260StringIO#initialize2527645##first
0.110.000.111/1Kernel.require
0% 0%0.110.13 0.000.111Gem::Specification.load_defaults0.1313Bundler::SpecSet#sorted
0.110.13 0.000.134/4TSort.tsort
0%0%0.130.02 0.111/1Gem::Specification.each_spec412##map!
0.110.13 0.000.111/1Gem::Specification.load_defaults0.134/176##to_a
0% 0%0.110.13 0.000.111Gem::Specification.each_spec0.13176Enumerator#each
0.110.13 0.000.111/1Gem::Specification.each_gemspec0.134/8TSort.tsort_each
0.110.13 0.000.111/1Gem::Specification.each_spec0.134/4Bundler::SpecSet#sorted
0% 0%0.110.13 0.000.111Gem::Specification.each_gemspec0.134TSort.tsort
0.110.13 0.000.111/1037819##each0.134/4TSort.tsort
0.110.110.13 0.002072520/2072845Protobuf::Field::IntegerField#decode0.134/4TSort.tsort
0% 0%0.110.110.130.000.134TSort.tsort
0.13 0.002072845Numeric#nonzero?0.134/4##to_a
0.130.000.134/8Enumerator#each
0% 0%0.110.13 0.000.1113Bundler::SpecSet#sorted0.138TSort.tsort_each
0.110.13 0.000.110.13 4/4TSort.tsortTSort.each_strongly_connected_component
0.100.13 0.000.101/172Bundler::Definition#converge_paths0.134/4TSort.tsort
0% 0%0.110.13 0.000.11172##any?0.134##to_a
0.100.13 0.000.102/2Bundler::Definition#specs_changed?0.134/176Enumerator#each
0.110.13 0.000.114/176##to_a0.134/4TSort.tsort_each
0% 0%0.110.13 0.000.11176Enumerator#each0.134TSort.each_strongly_connected_component
0.110.13 0.000.114/8TSort.tsort_each0.134/122Method#call
0.110.13 0.000.114/4Bundler::SpecSet#sorted0.134/122TSort.each_strongly_connected_component
0% 0%0.110.13 0.000.114TSort.tsort0.13122Method#call
0.110.13 0.000.110.13 4/4TSort.tsortBundler::SpecSet#tsort_each_node
0.110.13 0.000.110.13 4/4TSort.tsortMethod#call
0% 0%0.110.13 0.000.110.13 4TSort.tsortBundler::SpecSet#tsort_each_node
0.110.13 0.000.114/4##to_a0.124/1265137##each
0.120.01 0.110.000.114/8Enumerator#each118/118##each
0% 0%0.120.01 0.110.000.118TSort.tsort_each118TSort.each_strongly_connected_component_from
0.110.120.12 0.000.114/4TSort.each_strongly_connected_component2527157/2527157Protobuf::Field::Int64Field(singleton)#set_field
0%0%0.120.120.002527157ProtobufJavaHelpers::Int64ProtobufField.coerce!
0.110.120.12 0.000.114/4TSort.tsort2527157/2528322Protobuf::Field::StringField#coerce!
0% 0%0.110.120.12 0.000.114##to_a2528322##to_s
0.11
0%0%0.120.12 0.000.114/176Enumerator#each2527156ProtobufJavaHelpers::IntegerProtobufField.decode_varint_64
0.11 0.00 0.114/4TSort.tsort_each1/172Bundler::Definition#converge_paths
0% 0%0.110.12 0.000.114TSort.each_strongly_connected_component0.12172##any?
0.11 0.00 0.114/122Method#call2/2Bundler::Definition#specs_changed?
0.110.00 0.114/122TSort.each_strongly_connected_component0.001263846/1263846Protobuf::Enum#to_i
0% 0% 0.110.000.11122Method#call
0.110.00 0.114/4Bundler::SpecSet#tsort_each_node
0.10 0.000.10118/118Bundler::SpecSet#tsort_each_child1263846Protobuf::Enum#tag
0.11 0.00 0.114/4Method#call13/14##each
0% 0.11 0.00 0.114Bundler::SpecSet#tsort_each_node14Gem::Specification.load
0.110.11 0.002527157/2527158Protobuf::Message#initialize
0%0% 0.114/1037819##each0.110.002527158##to_hash
0.11 0.11 0.001036528/1036528Protobuf::Enum#to_i1253578/1263578Proc#call
0% 0.11 0.11 0.001036528Protobuf::Enum#tag1263578Protobuf::Message#to_proto
0.110.11 0.000.10118/118##each1263731/1263731Protobuf::Field::VarintField.encode
0% 0% 0.110.11 0.000.10118TSort.each_strongly_connected_component_from1263731ProtobufJavaHelpers::Varinter.to_varint
0.11 0.00 0.1139/39##map!1/1Bundler::Definition#initialize
0% 0.11 0.00 0.1139Bundler::LazySpecification#__materialize__1Bundler::Definition#converge_paths
0.110.000.111/172##any?
0.100.100.11 0.001026260/1036260Proc#call0.112/2##any?
0% 0% 0.110.000.112Bundler::Definition#specs_changed?
0.11 0.001036260Protobuf::Message#to_proto0.112/2Bundler::Definition#specs_for_source_changed?
0.100.11 0.000.101/1Bundler::Definition#initialize0.112/2Bundler::Definition#specs_changed?
0%0%0.110.000.112Bundler::Definition#specs_for_source_changed?
0% 0% 0.10 0.00 0.101Bundler::Definition#converge_paths5Bundler::Source::Path#specs
0.10 0.00 0.101/172##any?5/5Bundler::Source::Path#local_specs
0.100.00 0.102/2##any?0.002527157/2527330Protobuf::Message#initialize
0% 0% 0.100.000.102Bundler::Definition#specs_changed?
0.10 0.000.102/2Bundler::Definition#specs_for_source_changed?2527330Kernel.block_given?
0.100.00 0.102/2Bundler::Definition#specs_changed?0.001263578/1263578StringIO.new
0% 0% 0.100.10 0.001263578StringIO#initialize
0.102Bundler::Definition#specs_for_source_changed?0.000.101/1Bundler::Definition#specs
0% 0% 0.10 0.00 0.105Bundler::Source::Path#specs1Bundler::Definition#resolve
0.10 0.00 0.10118/118Method#call5/5Bundler::Source::Path#specs
0% 0.10 0.00 0.10118Bundler::SpecSet#tsort_each_child
5Bundler::Source::Path#local_specs
@@ -67,13 +67,13 @@

Total time: 63.20

- + - + - + @@ -82,152 +82,125 @@

Total time: 63.20

- + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - + + - - - + + + - - - + + + - + - + - - - - - + + + + + - + - - - + + + - + - - - - + + + + - - - - - - - - - - + - - + + - - - - - - - - - - - + + - + - + + - - - + + - + @@ -240,31 +213,31 @@

Total time: 63.20

- + - + - + - + - + - + - + - + - + @@ -273,25 +246,25 @@

Total time: 63.20

- + - - + + - + - + - + @@ -310,7 +283,7 @@

Total time: 63.20

- + @@ -319,7 +292,7 @@

Total time: 63.20

- + @@ -338,316 +311,316 @@

Total time: 63.20

- + - + - + - + - + - - - - + + + + - - - + + + - + - + - - + + - + - - + + - - + + - + - - + + - - + + - + - - + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - + - - + + - + - - - - + + + + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - - + + - + - - - - + + + + - - - - + + + + - - - - - + + + + + - + - - - - + + + + - + - - - - + + + + - + - + - + - + - - + + - - + + - + - - + + - + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - + + + - + - - - - + + + + - + - - - - + + + + - + - - - - - + + + + + @@ -657,7 +630,7 @@

Total time: 63.20

- + @@ -668,14 +641,14 @@

Total time: 63.20

- + - - - - + + + + @@ -683,154 +656,154 @@

Total time: 63.20

- - - + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - + - - + + - - - - + + + + - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - + + - + - + - - + + - - + + - + - - + + - + - - + + - + - - + + - + @@ -840,319 +813,319 @@

Total time: 63.20

- - + + - - - - + + + + - - - - + + + + - + - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - - + + - + - - + + - - - - + + + + - - - - - + + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - + + - - + + - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - + - - - - + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - + + + + - + - - + + - - + + - + - + - - - - - + + + + + - - - - + + + + - + - - - - + + + + - + - - + + - - + + - - - - - + + + + + - - - - + + + + - + - - - - + + + + - + - - + + - - + + - - + + - + @@ -1160,1105 +1133,1114 @@

Total time: 63.20

- - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - + - - + + - + - + - + - + - - + + - + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - - + + - - - - + + + + - - + + - + - + - - + + - + - - + + - + - - - - - + + + + + - + - - + + - + - - + + - - + + - - - - + + + + - + - - - - - + + + + + - + - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - - + + - + - - - - - + + + + + - - - - + + + + - - - - + + + + - + - - + + - - + + - - - - + + + + - - - - + + + + - - - - + + + + - + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + + + - + - + - + - + - + - + - + - + - - + + - + - + - + - - - - + + + + - + - + - - + + - + - - - - + + + + - + - - + + - - + + - + - - - - + + + + - - - - + + + + - + - + - - + + - + - - + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - - - - + + + + - + + + + + + + + + + - - - - - + + + + + - + - - + + - - + + - - - - - + + + + + - - + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + + + - + - - + + - + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - - + + + + + + + - + + - - - - - + + + + + - - - - - - + + + + + + + + + + + + + + - - - - - + + + + + - + - - + + - - + + - - - - - + + + + + - - - - + + + + - + - + - - + + - + - + - - + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - + - - + + - + - + - - + + - + - + - - - - + + + + - - - - + + + + - + - + - - + + - + - - - - + + + + - - - - - + + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - + - + - + - + - + - + - + - - - - + + + + - - - - + + + + - + - - + + - + - - + + - + - + + + + + + + + + + - - - - - + + + + + - - - - + + + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + @@ -2267,450 +2249,440 @@

Total time: 63.20

- + - - + + - + - + - + - - + + - + - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - + - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - + - - + + - + - - - - + + + + - + + + + + + + + + + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + + + - - - - + + + + - + - - + + - - + + - + - - + + - + - - + + - + - + - - - + + + - + - - - + + + - + - + - + - + - + - + - - - + + + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - + + + + + + + + + + - - + + - - - - - + + + + + - - - - + + + + - + - + - + - + - + - + @@ -2719,7 +2691,35 @@

Total time: 63.20

- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2738,7 +2738,7 @@

Total time: 63.20

- + @@ -2766,7 +2766,7 @@

Total time: 63.20

- + @@ -2775,7 +2775,7 @@

Total time: 63.20

- + @@ -2794,7 +2794,7 @@

Total time: 63.20

- + @@ -2803,63 +2803,7 @@

Total time: 63.20

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -2878,16 +2822,16 @@

Total time: 63.20

- + - + - + - + @@ -2896,82 +2840,110 @@

Total time: 63.20

- + - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -2980,32 +2952,32 @@

Total time: 63.20

- + - + - - + + - - - - + + + + - + - - + + - + @@ -3013,274 +2985,302 @@

Total time: 63.20

- - - - + + + + - - - - + + + + - + + - - + + - - + + - - - + + - - + + - - + + - - + + - - + + - - + + - - - - - + + + + + - + - - + + - + - - + + - + - - - - - - - - - - - - - - - - - - - - + - - + + - + - - + + - + - - + + + + + + + + + + + - + - - + + - + - - + + - - + + - - + + - - + + - - + + - + - - + + - - + + - + - + + - + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + + - + + + + + + + + + + + + + + + + + + + - + - + - + - - + + - + - - + + - - + + - - + + - - + + @@ -3289,7 +3289,7 @@

Total time: 63.20

- + @@ -3298,55 +3298,93 @@

Total time: 63.20

- - + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - + + + + + + + + + + - - + + + - + - - + + - - + + - + + + + + + + + + + + - + @@ -3355,93 +3393,46 @@

Total time: 63.20

- + - - - - - - - - - - - + - + - + - - + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - + + @@ -3450,8 +3441,8 @@

Total time: 63.20

- - + + @@ -3459,27 +3450,18 @@

Total time: 63.20

- - - - - - - - - - - + + - + - - + + @@ -3487,36 +3469,8 @@

Total time: 63.20

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -3525,8 +3479,8 @@

Total time: 63.20

- - + + @@ -3534,8 +3488,8 @@

Total time: 63.20

- - + + @@ -3544,8 +3498,8 @@

Total time: 63.20

- - + + @@ -3553,29 +3507,10 @@

Total time: 63.20

- - + + - - - - - - - - - - - - - - - - - - - @@ -3583,185 +3518,17 @@

Total time: 63.20

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - + + @@ -3769,112 +3536,101 @@

Total time: 63.20

- - + + - + - + - - - + + + - + - + - - - + + + - + - - - + + + - + - + - - + + - + - - - - + + + + - - - - + + + + - - + - - - - - - - - - - - + + - - - + + + - - - - - - - - + + + + + + - - + + + @@ -3893,9 +3649,9 @@

Total time: 63.20

- + - + @@ -3904,53 +3660,53 @@

Total time: 63.20

- + - - + + - - + + - - + + - - + + - - - + + + - - - + + + - + - - + + @@ -3958,56 +3714,84 @@

Total time: 63.20

- - + + - - - + + + + + + + + + + + - - + + + - + + + + + + + + + + + + + + + + + + - - + + + + - - + + - + - - - + + + @@ -4015,19 +3799,19 @@

Total time: 63.20

- - + + - + - - + + - + @@ -4035,7 +3819,7 @@

Total time: 63.20

- + @@ -4044,92 +3828,130 @@

Total time: 63.20

- + - + - + - - - + + + - + - - - + + + + + + + + + + + - - + + + + - - + - + - + - + - + - - + + + + + + + + + + + + - + + + + + + + + + + - - + + - - + + - - + + - - + + + + + + + + + + + + - - + + - - + + - - + + - - + + @@ -4150,1233 +3972,1247 @@

Total time: 63.20

- + + + + + + + + - - + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - - + + + + + + + + + + - - - - + + - + + + + - - - - - - - - - + + + + - + + + + + - - - - - - + + + + + + + + + + - - - + + + - - - - - - - - - - - - - - - - - - + + + + + - - + + - + + - - - - - - - - - - + + - - - - - + + + + + + + + - - - - - - - - - - + - + + + + + - + + + - - + + + - - - + + + - - - - - + + + - - + + + - + + + - + + + + + + + + + + + + + + + - - - - - - - - + + - + - + + + + + + - - - - + + - - - - - + + + - + + + - + - - - - - - - - + + + + + - - - + + + + + + + - - - - - + + + - - + + + - - + + + + + + + - - - + + - + + - - - - - + + + + + + - - - + - + - - - - + + + + + - - - + + + + + + + + - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + - + + - - - - - - + - - + + + + + + + - + - - + - + + + - - - - - - + + - - + - - - - - - - + - - + + + - - + + + + + + + + + - - + - - - + - - + + + + + - - - - - - + + + + + - - - - - - - + + + - + + + + - - + + + + + + + + - - - - - - + - - - - - - - - + + - + - + + + + + - - - + + + + + + - + + + + + + + - + + + - + - - - - - + + + + - - - - + + + + - - - - - - - - - - + - - - + + + - + - - - - - - - - - - - + + + + + + + + + - + + + + + - - - - - - - - - - + - + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + - - + + - + + + + + + + - - + - - + + + - - - - + + + + + + + + - + - + - - - + - - - - - + + - - - - - - + + - + + - - + + - + - - - + + + + + - - - - + + + - - - - - + + - - - + + + + - - - - - - + + - + + - + - - - + - + + + + + + + - - - - + - + + - - + - - - - + + - - - + + + + + + + + + + + + + + + + - + + + + + - - + + + - - - + + + - - + + - + + - - + + - + + - - - + + - - + + + - - + + + + - - - - - - - + + + + + - + + + + + + + + - - + - - - - - - - - - - - + - - - - + - @@ -5384,44 +5220,45 @@

Total time: 63.20

- + + + + + - - - + - + + - - + + + - - - @@ -5429,23 +5266,23 @@

Total time: 63.20

- + - - + + @@ -5470,7 +5307,7 @@

Total time: 63.20

- + @@ -5478,10 +5315,12 @@

Total time: 63.20

+ + + - @@ -5492,21 +5331,19 @@

Total time: 63.20

- - - + - + @@ -5517,21 +5354,22 @@

Total time: 63.20

- + + - + From e03383604da55ec2bc293ac56d2bd39e0eb84db9 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Fri, 28 Dec 2018 10:57:08 -0700 Subject: [PATCH 17/93] do not need an intermediate stored value --- lib/protobuf/field/enum_field.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/protobuf/field/enum_field.rb b/lib/protobuf/field/enum_field.rb index 4c7f6653..9a29b42a 100644 --- a/lib/protobuf/field/enum_field.rb +++ b/lib/protobuf/field/enum_field.rb @@ -47,8 +47,7 @@ def enum? end def coerce!(value) - enum_value = type_class.fetch(value) - enum_value || fail(TypeError, "Invalid Enum value: #{value.inspect} for #{name}") + type_class.fetch(value) || fail(TypeError, "Invalid Enum value: #{value.inspect} for #{name}") end private From e0acb26f6f34f40911b318bb2843560dff40bc60 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Fri, 28 Dec 2018 11:21:09 -0700 Subject: [PATCH 18/93] no need for intermediary --- lib/protobuf/message.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/protobuf/message.rb b/lib/protobuf/message.rb index 54e8621d..c61087db 100644 --- a/lib/protobuf/message.rb +++ b/lib/protobuf/message.rb @@ -95,8 +95,7 @@ def each_field def each_field_for_serialization _protobuf_message_required_field_tags.each do |tag| - field = _protobuf_message_field[tag] - fail ::Protobuf::SerializationError, "Required field #{self.class.name}##{field.name} does not have a value." + fail ::Protobuf::SerializationError, "Required field #{self.class.name}##{_protobuf_message_field[tag].name} does not have a value." end @values.each_key do |fully_qualified_name| From cf430a380edd3ab2051ed4a8b25b920595d40b88 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Fri, 28 Dec 2018 12:01:03 -0700 Subject: [PATCH 19/93] more java helpers and we should not need to copy decoded string fields --- lib/protobuf/field/string_field.rb | 5 ++--- lib/protobuf/field/uint32_field.rb | 17 ++++++++++------- lib/protobuf/field/uint64_field.rb | 17 ++++++++++------- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/lib/protobuf/field/string_field.rb b/lib/protobuf/field/string_field.rb index a59fd652..49b6d2b8 100644 --- a/lib/protobuf/field/string_field.rb +++ b/lib/protobuf/field/string_field.rb @@ -27,9 +27,8 @@ def coerce!(value) end def decode(bytes) - bytes_to_decode = "" + bytes - bytes_to_decode.force_encoding(::Protobuf::Field::StringField::ENCODING) - bytes_to_decode + bytes.force_encoding(::Protobuf::Field::StringField::ENCODING) + bytes end def encode(value) diff --git a/lib/protobuf/field/uint32_field.rb b/lib/protobuf/field/uint32_field.rb index 50fa8fef..6d512c8e 100644 --- a/lib/protobuf/field/uint32_field.rb +++ b/lib/protobuf/field/uint32_field.rb @@ -7,15 +7,18 @@ class Uint32Field < VarintField ## # Class Methods # + if defined?(::ProtobufJavaHelpers) + include ::ProtobufJavaHelpers::Uint32ProtobufField + extend ::ProtobufJavaHelpers::Uint32ProtobufField + else + def self.max + UINT32_MAX + end - def self.max - UINT32_MAX + def self.min + 0 + end end - - def self.min - 0 - end - end end end diff --git a/lib/protobuf/field/uint64_field.rb b/lib/protobuf/field/uint64_field.rb index 8a060f14..0ef93bdf 100644 --- a/lib/protobuf/field/uint64_field.rb +++ b/lib/protobuf/field/uint64_field.rb @@ -7,15 +7,18 @@ class Uint64Field < VarintField ## # Class Methods # + if defined?(::ProtobufJavaHelpers) + include ::ProtobufJavaHelpers::Uint64ProtobufField + extend ::ProtobufJavaHelpers::Uint64ProtobufField + else + def self.max + UINT64_MAX + end - def self.max - UINT64_MAX + def self.min + 0 + end end - - def self.min - 0 - end - end end end From 5b8013f0f39ca902d686d733767ef898a4b73540 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Fri, 28 Dec 2018 12:05:47 -0700 Subject: [PATCH 20/93] should be using bytesize for string and bytes fields --- lib/protobuf/field/bytes_field.rb | 20 ++++++++------------ lib/protobuf/field/string_field.rb | 2 +- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/lib/protobuf/field/bytes_field.rb b/lib/protobuf/field/bytes_field.rb index 40aa3fbe..81a3634d 100644 --- a/lib/protobuf/field/bytes_field.rb +++ b/lib/protobuf/field/bytes_field.rb @@ -27,23 +27,19 @@ def acceptable?(val) end def decode(bytes) - bytes_to_decode = bytes.dup - bytes_to_decode.force_encoding(::Protobuf::Field::BytesField::BYTES_ENCODING) - bytes_to_decode + bytes.force_encoding(::Protobuf::Field::BytesField::BYTES_ENCODING) + bytes end def encode(value) - value_to_encode = - if value.is_a?(::Protobuf::Message) - value.encode - else - value.dup - end + value_to_encode = if value.is_a?(::Protobuf::Message) + value.encode + else + "" + value + end value_to_encode.force_encoding(::Protobuf::Field::BytesField::BYTES_ENCODING) - string_size = ::Protobuf::Field::VarintField.encode(value_to_encode.size) - - "#{string_size}#{value_to_encode}" + "#{::Protobuf::Field::VarintField.encode(value_to_encode.bytesize)}#{value_to_encode}" end def wire_type diff --git a/lib/protobuf/field/string_field.rb b/lib/protobuf/field/string_field.rb index 49b6d2b8..055ace43 100644 --- a/lib/protobuf/field/string_field.rb +++ b/lib/protobuf/field/string_field.rb @@ -38,7 +38,7 @@ def encode(value) end value_to_encode.force_encoding(::Protobuf::Field::BytesField::BYTES_ENCODING) - "#{::Protobuf::Field::VarintField.encode(value_to_encode.size)}#{value_to_encode}" + "#{::Protobuf::Field::VarintField.encode(value_to_encode.bytesize)}#{value_to_encode}" end def json_encode(value) From 69d948be6ef01d492b143e90136d6386f2e2951c Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Fri, 28 Dec 2018 17:14:51 -0700 Subject: [PATCH 21/93] account for int32 values --- lib/protobuf/field/int32_field.rb | 25 +++++++++++++++++++------ spec/encoding/extreme_values_spec.rb | Bin 1381 -> 1378 bytes 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/lib/protobuf/field/int32_field.rb b/lib/protobuf/field/int32_field.rb index 4a7865f9..b8f3ab88 100644 --- a/lib/protobuf/field/int32_field.rb +++ b/lib/protobuf/field/int32_field.rb @@ -7,15 +7,28 @@ class Int32Field < IntegerField ## # Class Methods # + if defined?(::ProtobufJavaHelpers) + include ::ProtobufJavaHelpers::Varinter + include ::ProtobufJavaHelpers::IntegerProtobufField + include ::ProtobufJavaHelpers::Int32ProtobufField + extend ::ProtobufJavaHelpers::Int32ProtobufField - def self.max - INT32_MAX - end + def encode(value) + to_varint_64(value) + end - def self.min - INT32_MIN - end + def decode(value) + decode_varint_64(value) + end + else + def self.max + INT32_MAX + end + def self.min + INT32_MIN + end + end end end end diff --git a/spec/encoding/extreme_values_spec.rb b/spec/encoding/extreme_values_spec.rb index 6678f991028fce2a8ad5b948a1dfd6ee62a458c3..097e8ede11f9edc24c5fca6bfc690451247df920 100644 GIT binary patch delta 21 dcmaFL^@wYOHsfX;#xADG+nKdCKVoiX1OQpC2e$wK delta 31 mcmaFF^^|LaHY20*W^KkUCPwAS_nE~fpJ5gT3fyOIW&{AAfC;Gp From 13eb3d34a96ce353f5d0aa8a761710de3a3e0403 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Sat, 29 Dec 2018 20:12:11 -0700 Subject: [PATCH 22/93] should wait for helpers --- Gemfile | 2 - lib/protobuf/field/enum_field.rb | 27 +++------ lib/protobuf/field/int32_field.rb | 25 ++------ lib/protobuf/field/int64_field.rb | 32 +++++----- lib/protobuf/field/integer_field.rb | 22 ------- lib/protobuf/field/message_field.rb | 2 +- lib/protobuf/field/uint32_field.rb | 17 +++--- lib/protobuf/field/uint64_field.rb | 17 +++--- lib/protobuf/field/varint_field.rb | 55 +++++++++++++----- .../field/varint_field_encoder_pure.rb | 48 --------------- lib/protobuf/message.rb | 22 +++---- protobuf.gemspec | 1 - spec/encoding/extreme_values_spec.rb | Bin 1378 -> 1358 bytes 13 files changed, 93 insertions(+), 177 deletions(-) delete mode 100644 lib/protobuf/field/varint_field_encoder_pure.rb diff --git a/Gemfile b/Gemfile index d5b5bd21..fa75df15 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,3 @@ source 'https://rubygems.org/' -gem 'protobuf_java_helpers', :path => "~/code/protobuf_java_helpers" - gemspec diff --git a/lib/protobuf/field/enum_field.rb b/lib/protobuf/field/enum_field.rb index 9a29b42a..63f4d49b 100644 --- a/lib/protobuf/field/enum_field.rb +++ b/lib/protobuf/field/enum_field.rb @@ -15,27 +15,14 @@ def self.default ## # Public Instance Methods # - if defined?(::ProtobufJavaHelpers) - include ::ProtobufJavaHelpers::Varinter - include ::ProtobufJavaHelpers::IntegerProtobufField - - def encode(value) - to_varint_64(value.to_i) # Calling `to_i` because it is a delegator and the java side doesn't follow - end - - def decode(value) - decode_varint_64(value) - end - else - def encode(value) - # original Google's library uses 64bits integer for negative value - ::Protobuf::Field::VarintField.encode(value & 0xffff_ffff_ffff_ffff) - end + def encode(value) + # original Google's library uses 64bits integer for negative value + ::Protobuf::Field::VarintField.encode(value & 0xffff_ffff_ffff_ffff) + end - def decode(value) - value -= 0x1_0000_0000_0000_0000 if (value & 0x8000_0000_0000_0000).nonzero? - value if acceptable?(value) - end + def decode(value) + value -= 0x1_0000_0000_0000_0000 if (value & 0x8000_0000_0000_0000).nonzero? + value if acceptable?(value) end def acceptable?(val) diff --git a/lib/protobuf/field/int32_field.rb b/lib/protobuf/field/int32_field.rb index b8f3ab88..4a7865f9 100644 --- a/lib/protobuf/field/int32_field.rb +++ b/lib/protobuf/field/int32_field.rb @@ -7,28 +7,15 @@ class Int32Field < IntegerField ## # Class Methods # - if defined?(::ProtobufJavaHelpers) - include ::ProtobufJavaHelpers::Varinter - include ::ProtobufJavaHelpers::IntegerProtobufField - include ::ProtobufJavaHelpers::Int32ProtobufField - extend ::ProtobufJavaHelpers::Int32ProtobufField - def encode(value) - to_varint_64(value) - end - - def decode(value) - decode_varint_64(value) - end - else - def self.max - INT32_MAX - end + def self.max + INT32_MAX + end - def self.min - INT32_MIN - end + def self.min + INT32_MIN end + end end end diff --git a/lib/protobuf/field/int64_field.rb b/lib/protobuf/field/int64_field.rb index 493f6ab2..3b338894 100644 --- a/lib/protobuf/field/int64_field.rb +++ b/lib/protobuf/field/int64_field.rb @@ -7,26 +7,26 @@ class Int64Field < IntegerField ## # Class Methods # - if defined?(::ProtobufJavaHelpers) - include ::ProtobufJavaHelpers::Varinter - include ::ProtobufJavaHelpers::IntegerProtobufField - include ::ProtobufJavaHelpers::Int64ProtobufField - def encode(value) - to_varint_64(value) - end + def self.max + INT64_MAX + end - def decode(value) - decode_varint_64(value) - end - else - def self.max - INT64_MAX - end + def self.min + INT64_MIN + end - def self.min - INT64_MIN + ## + # Instance Methods + # + def acceptable?(val) + if val.is_a?(Integer) || val.is_a?(Numeric) + val >= INT64_MIN && val <= INT64_MAX + else + Integer(val, 10) >= INT64_MIN && Integer(val, 10) <= INT64_MAX end + rescue + return false end end diff --git a/lib/protobuf/field/integer_field.rb b/lib/protobuf/field/integer_field.rb index 3b66ec2c..5eb3b064 100644 --- a/lib/protobuf/field/integer_field.rb +++ b/lib/protobuf/field/integer_field.rb @@ -7,28 +7,6 @@ class IntegerField < VarintField ## # Public Instance Methods # - def acceptable?(val) - int_val = if val.is_a?(Integer) - return true if val >= 0 && val < INT32_MAX # return quickly for smallest integer size, hot code path - val - elsif val.is_a?(Numeric) - val.to_i - else - Integer(val, 10) - end - - int_val >= self.class.min && int_val <= self.class.max - rescue - false - end - - def coerce!(val) - fail TypeError, "Expected value of type '#{type_class}' for field #{name}, but got '#{val.class}'" unless acceptable?(val) - return val.to_i if val.is_a?(Numeric) - Integer(val, 10) - rescue ArgumentError - fail TypeError, "Expected value of type '#{type_class}' for field #{name}, but got '#{val.class}'" - end def decode(value) value -= 0x1_0000_0000_0000_0000 if (value & 0x8000_0000_0000_0000).nonzero? diff --git a/lib/protobuf/field/message_field.rb b/lib/protobuf/field/message_field.rb index 304a201f..34f45fd2 100644 --- a/lib/protobuf/field/message_field.rb +++ b/lib/protobuf/field/message_field.rb @@ -18,7 +18,7 @@ def decode(bytes) def encode(value) bytes = value.encode - result = ::Protobuf::Field::VarintField.encode(bytes.size) + result = ::Protobuf::Field::VarintField.encode(bytes.bytesize) result << bytes end diff --git a/lib/protobuf/field/uint32_field.rb b/lib/protobuf/field/uint32_field.rb index 6d512c8e..50fa8fef 100644 --- a/lib/protobuf/field/uint32_field.rb +++ b/lib/protobuf/field/uint32_field.rb @@ -7,18 +7,15 @@ class Uint32Field < VarintField ## # Class Methods # - if defined?(::ProtobufJavaHelpers) - include ::ProtobufJavaHelpers::Uint32ProtobufField - extend ::ProtobufJavaHelpers::Uint32ProtobufField - else - def self.max - UINT32_MAX - end - def self.min - 0 - end + def self.max + UINT32_MAX end + + def self.min + 0 + end + end end end diff --git a/lib/protobuf/field/uint64_field.rb b/lib/protobuf/field/uint64_field.rb index 0ef93bdf..8a060f14 100644 --- a/lib/protobuf/field/uint64_field.rb +++ b/lib/protobuf/field/uint64_field.rb @@ -7,18 +7,15 @@ class Uint64Field < VarintField ## # Class Methods # - if defined?(::ProtobufJavaHelpers) - include ::ProtobufJavaHelpers::Uint64ProtobufField - extend ::ProtobufJavaHelpers::Uint64ProtobufField - else - def self.max - UINT64_MAX - end - def self.min - 0 - end + def self.max + UINT64_MAX end + + def self.min + 0 + end + end end end diff --git a/lib/protobuf/field/varint_field.rb b/lib/protobuf/field/varint_field.rb index 70879c03..02a8cddc 100644 --- a/lib/protobuf/field/varint_field.rb +++ b/lib/protobuf/field/varint_field.rb @@ -1,5 +1,4 @@ require 'protobuf/field/base_field' -require 'protobuf/field/varint_field_encoder_pure' module Protobuf module Field @@ -25,27 +24,55 @@ def self.default 0 end - if defined?(::ProtobufJavaHelpers) - include ::ProtobufJavaHelpers::VarintProtobufField - extend ::ProtobufJavaHelpers::VarintProtobufField - extend ::ProtobufJavaHelpers::Varinter + # Because all tags and enums are calculated as VarInt it is "most common" to have + # values < CACHE_LIMIT (low numbers) which is defaulting to 1024 + def self.cached_varint(value) + @_varint_cache ||= {} + (@_varint_cache[value] ||= encode(value, false)).dup + end - def self.encode(value) - to_varint(value) - end - else - include ::Protobuf::Field::VarintFieldEncoderPure - extend ::Protobuf::Field::VarintFieldEncoderPure::ClassMethods + def self.encode(value, use_cache = true) + return cached_varint(value) if use_cache && value >= 0 && value <= CACHE_LIMIT - # Load the cache of VarInts on load of file - (0..CACHE_LIMIT).each do |cached_value| - cached_varint(cached_value) + bytes = [] + until value < 128 + bytes << (0x80 | (value & 0x7f)) + value >>= 7 end + (bytes << value).pack('C*') + end + + # Load the cache of VarInts on load of file + (0..CACHE_LIMIT).each do |cached_value| + cached_varint(cached_value) end ## # Public Instance Methods # + def acceptable?(val) + int_val = if val.is_a?(Integer) + return true if val >= 0 && val < INT32_MAX # return quickly for smallest integer size, hot code path + val + elsif val.is_a?(Numeric) + val.to_i + else + Integer(val, 10) + end + + int_val >= self.class.min && int_val <= self.class.max + rescue + false + end + + def coerce!(val) + fail TypeError, "Expected value of type '#{type_class}' for field #{name}, but got '#{val.class}'" unless acceptable?(val) + return val.to_i if val.is_a?(Numeric) + Integer(val, 10) + rescue ArgumentError + fail TypeError, "Expected value of type '#{type_class}' for field #{name}, but got '#{val.class}'" + end + def decode(value) value end diff --git a/lib/protobuf/field/varint_field_encoder_pure.rb b/lib/protobuf/field/varint_field_encoder_pure.rb deleted file mode 100644 index 2dba22c5..00000000 --- a/lib/protobuf/field/varint_field_encoder_pure.rb +++ /dev/null @@ -1,48 +0,0 @@ -module Protobuf - module Field - module VarintFieldEncoderPure - module ClassMethods - # Because all tags and enums are calculated as VarInt it is "most common" to have - # values < CACHE_LIMIT (low numbers) which is defaulting to 1024 - def cached_varint(value) - @_varint_cache ||= {} - (@_varint_cache[value] ||= encode(value, false)).dup - end - - def encode(value, use_cache = true) - return cached_varint(value) if use_cache && value >= 0 && value <= CACHE_LIMIT - - bytes = [] - until value < 128 - bytes << (0x80 | (value & 0x7f)) - value >>= 7 - end - (bytes << value).pack('C*') - end - end - - def acceptable?(val) - int_val = if val.is_a?(Integer) - return true if val >= 0 && val < INT32_MAX # return quickly for smallest integer size, hot code path - val - elsif val.is_a?(Numeric) - val.to_i - else - Integer(val, 10) - end - - int_val >= self.class.min && int_val <= self.class.max - rescue - false - end - - def coerce!(val) - fail TypeError, "Expected value of type '#{type_class}' for field #{name}, but got '#{val.class}'" unless acceptable?(val) - return val.to_i if val.is_a?(Numeric) - Integer(val, 10) - rescue ArgumentError - fail TypeError, "Expected value of type '#{type_class}' for field #{name}, but got '#{val.class}'" - end - end - end -end diff --git a/lib/protobuf/message.rb b/lib/protobuf/message.rb index c61087db..412732f1 100644 --- a/lib/protobuf/message.rb +++ b/lib/protobuf/message.rb @@ -23,20 +23,6 @@ class Message include ::Protobuf::Message::Serialization ::Protobuf::Optionable.inject(self) { ::Google::Protobuf::MessageOptions } - def self.inherited(subclass) - subclass.const_set("PROTOBUF_MESSAGE_REQUIRED_FIELD_TAGS", subclass.required_field_tags) - subclass.const_set("PROTOBUF_MESSAGE_GET_FIELD", subclass.field_store) - subclass.class_eval <<~RUBY, __FILE__, __LINE__ - def _protobuf_message_field - PROTOBUF_MESSAGE_GET_FIELD - end - - def _protobuf_message_required_field_tags - @_protobuf_message_required_field_tags ||= PROTOBUF_MESSAGE_REQUIRED_FIELD_TAGS.dup - end - RUBY - end - ## # Class Methods # @@ -207,6 +193,14 @@ def set_field(name, value, ignore_nil_for_repeated, field = nil) end end + def _protobuf_message_field + @_protobuf_message_field ||= self.class.field_store + end + + def _protobuf_message_required_field_tags + @_protobuf_message_required_field_tags ||= self.class.required_field_tags + end + ## # Instance Aliases # diff --git a/protobuf.gemspec b/protobuf.gemspec index 2d9330ef..4f182c4e 100644 --- a/protobuf.gemspec +++ b/protobuf.gemspec @@ -51,7 +51,6 @@ require "protobuf/version" s.add_development_dependency 'varint' s.add_development_dependency 'ruby-prof' elsif RUBY_PLATFORM =~ /java/i - #s.add_development_dependency 'protobuf_java_helpers' s.add_development_dependency 'fast_blank_java' s.add_development_dependency 'pry' end diff --git a/spec/encoding/extreme_values_spec.rb b/spec/encoding/extreme_values_spec.rb index 097e8ede11f9edc24c5fca6bfc690451247df920..477e695aa37676462eb7cbcd5cc355e2f7fc387d 100644 GIT binary patch delta 125 zcmaFFb&hMo*@@?FPF}&NpsxT1R#mA*`SEEv`H3Y8wsr~zI$Tik{Jd0zu%QmuDT23A$6Mfve*Ir)ht3bu9%20C2IlkYK#%fh6K za}#rN5b}n4rXUppOo~8b44LGCWB`*akj!OL2a;2m)PUqJCT$@36s(4gSry3EX4V3d eq09 Date: Sun, 30 Dec 2018 12:48:05 -0700 Subject: [PATCH 23/93] delegator fix for encode in enum_field --- lib/protobuf/field/enum_field.rb | 2 +- profile.html | 6236 ++++++++++++++++-------------- 2 files changed, 3265 insertions(+), 2973 deletions(-) diff --git a/lib/protobuf/field/enum_field.rb b/lib/protobuf/field/enum_field.rb index 63f4d49b..6993faff 100644 --- a/lib/protobuf/field/enum_field.rb +++ b/lib/protobuf/field/enum_field.rb @@ -17,7 +17,7 @@ def self.default # def encode(value) # original Google's library uses 64bits integer for negative value - ::Protobuf::Field::VarintField.encode(value & 0xffff_ffff_ffff_ffff) + ::Protobuf::Field::VarintField.encode(value.to_i & 0xffff_ffff_ffff_ffff) end def decode(value) diff --git a/profile.html b/profile.html index 301a2adf..cdc0569d 100644 --- a/profile.html +++ b/profile.html @@ -52,7 +52,7 @@

Profile Report: main

-

Total time: 63.22

+

Total time: 63.34

%Total
100% 0%63.2063.22 0.0063.2063.22 0 (top)
60.08 1/1 Benchmark::IPS.ips
1.011.05 0.001.001.05 2/115 Kernel.require
0.930.91 0.000.930.91 6/1886 Kernel.require
0.65 0.04 0.61 1/5##times##times
0.530.52 0.060.470.46 17/19 Kernel.load
0.130.00 0.124/1265137Bundler::SpecSet#tsort_each_node
0.14 0.000.141/12651370.121/1292879 Gem::Specification.each_gemspec
0.240.00 0.2319/12651370.000.2219/1292879 Kernel.require
20.001.8018.201/12651371.7718.241/1292879 Benchmark::IPS::Job#run_warmup
40.0740.08 0.01 40.071/12651371/1292879 Benchmark::IPS::Job#run_benchmark
96% 2%60.941.8459.091265137##each60.851.8159.041292879##each
57.022.9254.103554696/35546963.0653.963681351/3681351 Benchmark::IPS::Job::Entry#call_times
0.910.450.463555260/35552600.950.470.493681900/3681900 Benchmark::Timing.now
0.180.180.003554700/3554700##<
0.150.150.170.17 0.003554710/18454858##+
0.120.010.11118/118TSort.each_strongly_connected_component_from3681355/3681355##<
0.110.140.14 0.000.1113/14Gem::Specification.load3681365/18790704##+
60.0760.08 0.0060.0760.08 2/5 Benchmark::IPS::Job#run
96% 0%60.7560.76 0.0660.6960.70 5##times##times
40.0740.08 0.0040.0740.08 1/1 Benchmark::IPS::Job#run_benchmark
20.00 1/1 Benchmark::IPS::Job#run_warmup
0.29 0.000.2910000/12635780.2810000/1291320 Protobuf::Message::Serialization::ClassMethods.decode_from
0.19 0.01 0.1810000/126357810000/1291320 Protobuf::Encoder.encode
1 Benchmark::IPS.ips
60.08 1/1 Benchmark::IPS::Job#run
1 Benchmark::IPS::Job#run
60.0760.08 0.0060.0760.08 2/5##times##times
57.022.9254.103554696/3554696##each3.0653.963681351/3681351##each
90% 4% 57.022.9254.1035546963.0653.963681351 Benchmark::IPS::Job::Entry#call_times
52.7952.58 2.3150.4914899065/1489961350.2615108256/15108804 Proc#call
0.700.700.710.71 0.0018453761/18453786##<18789607/18789624##<
0.610.610.670.67 0.0014899065/18454858##+15108256/18790704##+
52.7952.58 2.3150.4914899065/1489961350.2615108256/15108804 Benchmark::IPS::Job::Entry#call_times
83% 3%52.822.3150.511489961352.612.3250.2915108804 Proc#call
22.292.3619.9313645487/1364548722.112.3719.7413826936/13826936 Protobuf::Message#to_hash
13.180.3012.871253578/126357812.920.3312.591281320/1291320 Protobuf::Message::Serialization::ClassMethods.decode_from
8.720.308.421253578/12635789.100.358.751281320/1291320 Protobuf::Encoder.encode
3.743.53 0.173.571253578/25286803.361281320/2584164 Class#new
2.110.291.821253578/12635782.170.311.871281320/1291320 Test::Resource#status=
0.270.28 0.170.101253578/12635780.111281320/1291320 StringIO.new
0.11 0.11 0.001253578/12635781281320/1291320 Protobuf::Message#to_proto
40.0740.08 0.0040.0740.08 1/1##times##times
63% 0%40.0740.08 0.0040.0740.08 1 Benchmark::IPS::Job#run_benchmark
40.0740.08 0.01 40.071/1265137##each1/1292879##each
7.921.576.361263578/149090668.231.646.601291320/15118257 Protobuf::Message#each_field_for_serialization
19.935.8514.0913645487/1490906619.745.9313.8113826936/15118257 Protobuf::Message#to_hash
44% 11%27.867.4120.4514909066##each_key27.987.5720.4115118257##each_key
5.602.353.2513645487/136454875.462.323.1513826936/13826936 Protobuf::Field::StringField(singleton)#to_message_hash
5.412.243.1713645487/136454875.342.273.0613826936/13826936 Protobuf::Field::Int64Field(singleton)#to_message_hash
2.300.730.74 1.571263578/12635781291320/1291320 Protobuf::Field::StringField(singleton)#encode_to_stream
2.022.021.991.99 0.0031081708/72277033##[]31527832/73391217##[]
1.541.541.551.55 0.0031081708/3866317831527832/39275754 Test::Resource#_protobuf_message_field
1.370.291.081263578/12635781.440.321.121291320/1291320 Protobuf::Field::EnumField(singleton)#encode_to_stream
1.090.300.791263578/12635781.180.320.861291320/1291320 Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.400.120.281263578/161726430.410.110.301291320/16409576 Protobuf::Field::StringField(singleton)#value_from_values
0.360.100.261263578/25271560.370.110.271291320/2582640 Protobuf::Field::EnumField(singleton)#value_from_values
0.360.100.251263578/161726430.110.261291320/16409576 Protobuf::Field::Int64Field(singleton)#value_from_values
22.292.3619.9313645487/1364548722.112.3719.7413826936/13826936 Proc#call
35%34% 3%22.292.3619.931364548722.112.3719.7413826936 Protobuf::Message#to_hash
19.935.8514.0913645487/14909066##each_key19.745.9313.8113826936/15118257##each_key
0.00 20.00 1/1##times##times
31% 1 Benchmark::IPS::Job#run_warmup
20.001.8018.201/1265137##each1.7718.241/1292879##each
0.29 0.000.2910000/1263578##times0.2810000/1291320##times
13.180.3012.871253578/126357812.920.3312.591281320/1291320 Proc#call
21%20% 0%13.470.3113.16126357813.200.3312.871291320 Protobuf::Message::Serialization::ClassMethods.decode_from
12.380.2912.091263578/126357812.110.3211.781291320/1291320 Protobuf::Message::Serialization.decode_from
0.780.76 0.170.611263578/25286800.591291320/2584164 Class#new
12.380.2912.091263578/126357812.110.3211.781291320/1291320 Protobuf::Message::Serialization::ClassMethods.decode_from
19% 0%12.380.2912.09126357812.110.3211.781291320 Protobuf::Message::Serialization.decode_from
12.092.129.981263578/126357811.782.059.741291320/1291320 Protobuf::Decoder.decode_each_field
12.092.129.981263578/126357811.782.059.741291320/1291320 Protobuf::Message::Serialization.decode_from
19%18% 3%12.092.129.98126357811.782.059.741291320 Protobuf::Decoder.decode_each_field
7.631.226.413790734/37907347.401.166.243873960/3873960 Protobuf::Message::Serialization.set_field_bytes
1.390.840.547581468/75814681.420.850.577747920/7747920 Protobuf::Varint.decode
0.280.280.240.24 0.005054312/50543125165280/5165280 StringIO#eof
0.210.210.200.20 0.005054312/5057540##==5165280/5168510##==
0.17 0.17 0.003790734/3790734##>>3873960/3873960##>>
0.17 0.17 0.003790734/3790734##&3873960/3873960##&
0.140.140.130.13 0.001263578/12635781291320/1291320 StringIO#read
0.19 0.01 0.1810000/1263578##times10000/1291320##times
8.720.308.421253578/12635789.100.358.751281320/1291320 Proc#call
14% 0%8.910.318.5912635789.280.368.931291320 Protobuf::Encoder.encode
8.590.448.161263578/12635788.930.458.481291320/1291320 Protobuf::Message#each_field_for_serialization
0.688.930.458.481291320/1291320Protobuf::Encoder.encode
14%0%8.930.458.481291320Protobuf::Message#each_field_for_serialization
8.231.646.601291320/15118257##each_key
0.180.180.001291320/3873961Test::Resource#_protobuf_message_required_field_tags
0.69 0.170.511263578/75814700.521291320/7747922 Protobuf::Field::Int64Field(singleton)#set
1.641.34 0.191.461263578/75814701.151291320/7747922 Protobuf::Field::StringField(singleton)#set
1.671.73 0.161.511263578/75814701.571291320/7747922 Protobuf::Field::EnumField(singleton)#set
1.850.321.531263578/75814701.890.311.591291320/7747922 Test::Resource#status=
2.800.632.182527158/7581470##each2.570.641.932582642/7747922##each
13% 2%8.651.467.1975814708.221.476.757747922 Protobuf::Message#set_field
2.890.582.312527156/25271562.980.602.392582640/2582640 Protobuf::Field::EnumField(singleton)#set_field
2.800.891.912527157/25271572.210.941.272582641/2582641 Protobuf::Field::StringField(singleton)#set_field
0.960.580.382527157/25271570.970.600.372582641/2582641 Protobuf::Field::Int64Field(singleton)#set_field
0.290.290.320.32 0.003790736/72277033##[]3873962/73391217##[]
0.250.250.260.26 0.003790736/386631783873962/39275754 Test::Resource#_protobuf_message_field
8.590.448.161263578/1263578Protobuf::Encoder.encode
13%0%8.590.448.161263578Protobuf::Message#each_field_for_serialization
7.921.576.361263578/14909066##each_key
0.170.170.001263578/3790735Test::Resource#_protobuf_message_required_field_tags
7.631.226.413790734/37907347.401.166.243873960/3873960 Protobuf::Decoder.decode_each_field
12%11% 1%7.631.226.4137907347.401.166.243873960 Protobuf::Message::Serialization.set_field_bytes
2.390.252.131263578/1263578Protobuf::Field::StringField(singleton)#set2.250.271.971291320/1291320Protobuf::Field::EnumField(singleton)#set
2.180.261.921263578/1263578Protobuf::Field::EnumField(singleton)#set2.120.281.851291320/1291320Protobuf::Field::StringField(singleton)#set
1.200.250.951263578/12635781.240.270.971291320/1291320 Protobuf::Field::Int64Field(singleton)#set
0.350.350.340.34 0.003790734/72277033##[]3873960/73391217##[]
0.29 0.29 0.003790734/386631783873960/39275754 Test::Resource#_protobuf_message_field
5.602.353.2513645487/13645487##each_key5.462.323.1513826936/13826936##each_key
8% 3%5.602.353.25136454875.462.323.1513826936 Protobuf::Field::StringField(singleton)#to_message_hash
2.381.590.7913645487/161726432.341.660.6813826936/16409576 Protobuf::Field::StringField(singleton)#value_from_values
0.870.870.810.81 0.0013645487/34877001##[]=13826936/35406351##[]=
5.412.243.1713645487/13645487##each_key5.342.273.0613826936/13826936##each_key
8% 3%5.412.243.17136454875.342.273.0613826936 Protobuf::Field::Int64Field(singleton)#to_message_hash
2.331.550.7813645487/161726432.241.590.6513826936/16409576 Protobuf::Field::Int64Field(singleton)#value_from_values
0.840.840.820.82 0.0013645487/34877001##[]=13826936/35406351##[]=
0.110.030.100.02 0.0816/252868016/2584164 Kernel.eval
0.17 0.010.17153/25286800.16153/2584164 Protobuf::Field.build
0.290.30 0.010.281/25286800.291/2584164 Bundler::Dsl#to_definition
0.780.76 0.170.611263578/25286800.591291320/2584164 Protobuf::Message::Serialization::ClassMethods.decode_from
3.743.53 0.173.571253578/25286803.361281320/2584164 Proc#call
8% 0%5.335.12 0.464.8725286804.662584164 Class#new
4.254.02 0.813.432527157/25271573.212582641/2582641 Protobuf::Message#initialize
0.280.29 0.000.280.29 1/1 Bundler::Definition#initialize
0.170.01 0.160.010.15 153/153 Protobuf::Field::BaseField#initialize
0.15 0.15 0.002527156/722770332582640/73391217 Protobuf::Enum.enum_for_tag_integer
0.290.290.320.32 0.003790736/722770333873962/73391217 Protobuf::Message#set_field
0.350.350.340.34 0.003790734/722770333873960/73391217 Protobuf::Message::Serialization.set_field_bytes
0.850.850.720.72 0.0014909065/7227703315118256/73391217 Protobuf::Field::Int64Field(singleton)#value_from_values
0.890.890.760.76 0.0014909065/7227703315118256/73391217 Protobuf::Field::StringField(singleton)#value_from_values
2.022.021.991.99 0.0031081708/72277033##each_key31527832/73391217##each_key
7%7%4.664.636%6%4.404.37 0.0372277033##[]73391217##[]
4.254.02 0.813.432527157/25271573.212582641/2582641 Class#new
6% 1%4.254.02 0.813.4325271573.212582641 Protobuf::Message#initialize
3.220.422.802527157/2527371##each3.000.432.572582641/2582855##each
0.11 0.11 0.002527157/2527158##to_hash2582641/2582814Kernel.block_given?
0.100.100.110.11 0.002527157/2527330Kernel.block_given?2582641/2582642##to_hash
3.220.422.802527157/25273713.000.432.572582641/2582855 Protobuf::Message#initialize
5%4% 0%3.240.432.812527371##each3.020.442.582582855##each
2.800.632.182527158/75814702.570.641.932582642/7747922 Protobuf::Message#set_field
2.890.582.312527156/25271562.980.602.392582640/2582640 Protobuf::Message#set_field
4% 0%2.890.582.3125271562.980.602.392582640 Protobuf::Field::EnumField(singleton)#set_field
2.040.471.572527156/25271562.110.491.622582640/2582640 Protobuf::Field::EnumField#coerce!
0.180.180.002527156/34877001##[]=
2.800.891.912527157/2527157Protobuf::Message#set_field
4%1%2.800.891.912527157Protobuf::Field::StringField(singleton)#set_field
0.690.480.212527157/2527157Protobuf::Field::StringField#coerce!
0.680.530.152527157/3790735Test::Resource#_protobuf_message_required_field_tags
0.230.230.002527157/34877001##[]=
0.210.210.002527157/2527341##delete
0.100.100.170.17 0.002527157/10109592Kernel.nil?2582640/35406351##[]=
0.400.120.281263578/16172643##each_key0.410.110.301291320/16409576##each_key
2.381.590.7913645487/161726432.341.660.6813826936/16409576 Protobuf::Field::StringField(singleton)#to_message_hash
4% 2%2.781.711.07161726432.751.770.9816409576 Protobuf::Field::StringField(singleton)#value_from_values
0.890.890.760.76 0.0014909065/72277033##[]15118256/73391217##[]
0.360.100.251263578/16172643##each_key0.110.261291320/16409576##each_key
2.331.550.7813645487/161726432.241.590.6513826936/16409576 Protobuf::Field::Int64Field(singleton)#to_message_hash
4% 2%2.691.651.03161726432.611.700.9116409576 Protobuf::Field::Int64Field(singleton)#value_from_values
0.850.850.720.72 0.0014909065/72277033##[]15118256/73391217##[]
2.390.252.131263578/1263578Protobuf::Message::Serialization.set_field_bytes
3%0%2.390.252.131263578Protobuf::Field::StringField(singleton)#set
1.640.191.461263578/7581470Protobuf::Message#set_field
0.490.280.221263578/1263578Protobuf::Field::StringField#decode
0.160.160.002527157/34877001Protobuf::Field::Int64Field(singleton)#set_field
0.180.180.002527156/34877001Protobuf::Field::EnumField(singleton)#set_field
0.230.230.002527157/34877001Protobuf::Field::StringField(singleton)#set_field
0.840.840.0013645487/34877001Protobuf::Field::Int64Field(singleton)#to_message_hash
0.870.870.0013645487/34877001Protobuf::Field::StringField(singleton)#to_message_hash
3%3%2.382.290.0834877001##[]=
0.430.42 0.030.400.39 2/1886 Kernel.load
0.930.91 0.000.930.91 6/1886 (top)
1.001.05 0.001.001.05 115/1886 Kernel.require
3% 0%2.362.37 0.032.332.34 1886 Kernel.require
0.860.88 0.000.860.88 1/1 Bundler.setup
0.240.00 0.2319/1265137##each0.000.2219/1292879##each
0.140.13 0.000.140.13 1/1 Gem::Specification.load_defaults
0.140.12 0.000.130.12 109/109 Protobuf::Message::Fields::ClassMethods.optional
2.300.730.74 1.571263578/1263578##each_key1291320/1291320##each_key
3% 1% 2.300.730.74 1.5712635781291320 Protobuf::Field::StringField(singleton)#encode_to_stream
0.750.360.403790734/88450460.740.350.393873960/9039240 IO::GenericWritable.<<
0.320.34 0.220.111263578/12637310.121291320/1291473 Protobuf::Field::VarintField.encode
0.220.160.061263578/12643890.240.170.071291320/1292131 BasicObject#!=
0.140.140.120.12 0.001263578/2527298##+1291320/2582782##+
2.180.261.921263578/12635782.250.271.971291320/1291320 Protobuf::Message::Serialization.set_field_bytes
3% 0%2.180.261.9212635782.250.271.971291320 Protobuf::Field::EnumField(singleton)#set
1.671.73 0.161.511263578/75814701.571291320/7747922 Protobuf::Message#set_field
0.250.200.240.19 0.051263578/12635781291320/1291320 Protobuf::Field::EnumField#decode
2.110.291.821253578/12635782.170.311.871281320/1291320 Proc#call
3% 0%2.150.301.8512635782.210.321.891291320 Test::Resource#status=
1.850.321.531263578/75814701.890.311.591291320/7747922 Protobuf::Message#set_field
0.250.250.003790736/386631782.210.941.272582641/2582641 Protobuf::Message#set_field
3%1%2.210.941.272582641Protobuf::Field::StringField(singleton)#set_field
0.290.290.003790734/38663178Protobuf::Message::Serialization.set_field_bytes0.680.530.152582641/3873961Test::Resource#_protobuf_message_required_field_tags
1.541.540.200.20 0.0031081708/38663178##each_key2582641/2582825##delete
3%3%2.072.07
0.180.18 0.0038663178Test::Resource#_protobuf_message_field2582641/35406351##[]=
0.100.100.002582641/7748887Kernel.nil?
0.100.100.002582641/2583806##to_s
2.040.471.572527156/25271560.160.160.002582641/35406351Protobuf::Field::Int64Field(singleton)#set_field
0.170.170.002582640/35406351 Protobuf::Field::EnumField(singleton)#set_field
0.180.180.002582641/35406351Protobuf::Field::StringField(singleton)#set_field
0.810.810.0013826936/35406351Protobuf::Field::StringField(singleton)#to_message_hash
0.820.820.0013826936/35406351Protobuf::Field::Int64Field(singleton)#to_message_hash
3%3%2.152.140.0135406351##[]=
2.120.281.851291320/1291320Protobuf::Message::Serialization.set_field_bytes
3% 0%2.040.471.5725271562.120.281.851291320Protobuf::Field::StringField(singleton)#set
1.340.191.151291320/7747922Protobuf::Message#set_field
0.500.300.201291320/1291320Protobuf::Field::StringField#decode
2.110.491.622582640/2582640Protobuf::Field::EnumField(singleton)#set_field
3%0%2.110.491.622582640 Protobuf::Field::EnumField#coerce!
1.350.450.902527156/25271651.380.460.922582640/2582649 Protobuf::Enum.fetch
0.220.220.240.24 0.002527156/25277142582640/2583314 Protobuf::Field::BaseField#type_class
0.430.230.202527156/8845046Protobuf::Field::EnumField(singleton)#encode_to_stream0.260.260.003873962/39275754Protobuf::Message#set_field
0.460.220.242527156/8845046Protobuf::Field::Int64Field(singleton)#encode_to_stream0.290.290.003873960/39275754Protobuf::Message::Serialization.set_field_bytes
0.750.360.403790734/8845046Protobuf::Field::StringField(singleton)#encode_to_stream1.551.550.0031527832/39275754##each_key
2%1%1.650.810.838845046IO::GenericWritable.<<3%3%2.092.090.0039275754Test::Resource#_protobuf_message_field
0.830.830.008845046/8845046StringIO#write0.440.230.212582640/9039240Protobuf::Field::EnumField(singleton)#encode_to_stream
1.390.840.547581468/7581468Protobuf::Decoder.decode_each_field0.480.230.252582640/9039240Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.740.350.393873960/9039240Protobuf::Field::StringField(singleton)#encode_to_stream
2% 1%1.390.840.547581468Protobuf::Varint.decode1.670.820.859039240IO::GenericWritable.<<
0.540.540.850.85 0.007581468/7581468ProtobufJavaHelpers::Varinter.read_varint9039240/9039240StringIO#write
1.370.291.081263578/1263578##each_key1.440.321.121291320/1291320##each_key
2% 0%1.370.291.0812635781.440.321.121291320 Protobuf::Field::EnumField(singleton)#encode_to_stream
0.650.68 0.270.381263578/12635780.421291320/1291320 Protobuf::Field::EnumField#encode
0.430.44 0.230.202527156/88450460.212582640/9039240 IO::GenericWritable.<<
1.350.450.902527156/25271651.420.850.577747920/7747920Protobuf::Decoder.decode_each_field
2%1%1.420.850.577747920Protobuf::Varint.decode
0.570.570.007747920/7747920ProtobufJavaHelpers::Varinter.read_varint
1.380.460.922582640/2582649 Protobuf::Field::EnumField#coerce!
2% 0%1.350.450.9025271651.380.460.922582649 Protobuf::Enum.fetch
0.770.490.780.51 0.282527156/25271562582640/2582640 Protobuf::Enum.enum_for_tag_integer
0.130.130.140.14 0.002527165/25286552582649/2584139 Kernel.kind_of?
1.200.250.951263578/12635781.240.270.971291320/1291320 Protobuf::Message::Serialization.set_field_bytes
1% 0%1.200.250.9512635781.240.270.971291320 Protobuf::Field::Int64Field(singleton)#set
0.680.69 0.170.511263578/75814700.521291320/7747922 Protobuf::Message#set_field
0.270.200.071263578/12635780.280.220.061291320/1291320 Protobuf::Field::Int64Field#decode
1.090.300.791263578/1263578##each_key1.180.320.861291320/1291320##each_key
1% 0%1.090.300.7912635781.180.320.861291320 Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.460.220.242527156/88450460.480.230.252582640/9039240 IO::GenericWritable.<<
0.330.210.121263578/12635780.380.240.141291320/1291320 Protobuf::Field::Int64Field#encode
1.011.05 0.001.001.05 2/115 (top)
1% 0%1.011.05 0.001.001.05 115 Kernel.require
1.001.05 0.001.001.05 115/1886 Kernel.require
0.960.580.382527157/25271570.970.600.372582641/2582641 Protobuf::Message#set_field
1% 0%0.960.580.3825271570.970.600.372582641 Protobuf::Field::Int64Field(singleton)#set_field
0.16 0.16 0.002527157/34877001##[]=2582641/35406351##[]=
0.120.120.110.11 0.002527157/25271572582641/2582641 ProtobufJavaHelpers::Int64ProtobufField.coerce!
0.100.100.002582641/7748887Kernel.nil?
0.910.450.463555260/3555260##each0.950.470.493681900/3681900##each
1% 0%0.910.450.4635552600.950.470.493681900 Benchmark::Timing.now
0.460.460.490.49 0.003555260/35552613681900/3681901 Process.clock_gettime
0.860.88 0.000.860.88 1/1 Kernel.require
1% 0%0.860.88 0.000.860.88 1 Bundler.setup
0.490.52 0.010.480.51 1/2 Bundler.definition
0.360.35 0.000.360.35 1/1 Bundler::Runtime#setup
0.170.170.180.18 0.001263578/37907351291320/3873961 Protobuf::Message#each_field_for_serialization
0.68 0.53 0.152527157/37907352582641/3873961 Protobuf::Field::StringField(singleton)#set_field
1% 1%0.850.700.860.71 0.1537907353873961 Test::Resource#_protobuf_message_required_field_tags
0.15 0.15 0.002527157/25281892582641/2583673 Kernel.dup
0.830.830.850.85 0.008845046/88450469039240/9039240 IO::GenericWritable.<<
1% 1%0.830.830.850.85 0.0088450469039240 StringIO#write
0.770.490.140.140.003681365/18790704##each
0.670.670.0015108256/18790704Benchmark::IPS::Job::Entry#call_times
1%1%0.810.810.0018790704##+
0.780.51 0.282527156/25271562582640/2582640 Protobuf::Enum.fetch
1% 0%0.770.490.780.51 0.2825271562582640 Protobuf::Enum.enum_for_tag_integer
0.15 0.15 0.002527156/72277033##[]2582640/73391217##[]
0.13 0.13 0.002527156/2527645##first
0.150.150.003554710/18454858##each
0.610.610.0014899065/18454858Benchmark::IPS::Job::Entry#call_times
1%1%0.760.760.0018454858##+2582640/2583129##first
0.700.700.710.71 0.0018453761/1845378618789607/18789624 Benchmark::IPS::Job::Entry#call_times
1% 1%0.700.700.710.71 0.0018453786##<18789624##<
0.690.480.212527157/2527157Protobuf::Field::StringField(singleton)#set_field
1%0%0.690.480.212527157Protobuf::Field::StringField#coerce!
0.120.120.002527157/2528322##to_s
0.650.68 0.270.381263578/12635780.421291320/1291320 Protobuf::Field::EnumField(singleton)#encode_to_stream
1% 0%0.650.68 0.270.3812635780.421291320 Protobuf::Field::EnumField#encode
0.280.170.111263578/12638460.310.180.141291320/1291588 Protobuf::Enum#to_i
0.100.100.001291320/2582640ProtobufJavaHelpers::Varinter.to_varint_64
0.540.540.570.57 0.007581468/75814687747920/7747920 Protobuf::Varint.decode
0% 0%0.540.540.570.57 0.0075814687747920 ProtobufJavaHelpers::Varinter.read_varint
0.530.52 0.060.470.46 17/19 (top)
0% 0%0.530.52 0.060.470.46 19 Kernel.load
0.430.42 0.030.400.39 2/1886 Kernel.require
0.490.52 0.010.480.51 1/2 Bundler.setup
0% 0%0.490.52 0.010.480.51 2 Bundler.definition
0.400.42 0.000.390.42 1/1 Bundler::Definition.build
0.490.280.221263578/12635780.500.300.201291320/1291320 Protobuf::Field::StringField(singleton)#set
0% 0%0.490.280.2212635780.500.300.201291320 Protobuf::Field::StringField#decode
0.140.140.130.13 0.001263578/2527298##+1291320/2582782##+
0.460.460.490.49 0.003555260/35552613681900/3681901 Benchmark::Timing.now
0% 0%0.460.460.490.49 0.0035552613681901 Process.clock_gettime
0.330.42 0.000.331/873Bundler::Runtime#requested_specs0.421/1Bundler.definition
0% 0%0.410.42 0.000.41873Kernel.send0.421Bundler::Definition.build
0.330.40 0.000.330.40 1/1Bundler::Definition#requested_specsBundler::Dsl.evaluate
0.400.33 0.000.391/1Bundler.definition0.331/873Bundler::Runtime#requested_specs
0% 0%0.400.41 0.000.391Bundler::Definition.build0.41873Kernel.send
0.380.33 0.000.380.33 1/1Bundler::Dsl.evaluateBundler::Definition#requested_specs
0.380.40 0.000.380.40 1/1 Bundler::Definition.build
0% 0%0.380.40 0.000.380.40 1 Bundler::Dsl.evaluate
0.290.30 0.000.290.30 1/1 Bundler::Dsl#to_definition
0.100.100.002527157/10109592Protobuf::Field::StringField(singleton)#set_field0.380.240.141291320/1291320Protobuf::Field::Int64Field(singleton)#encode_to_stream
0% 0% 0.380.380.240.141291320Protobuf::Field::Int64Field#encode
0.140.14 0.0010109592Kernel.nil?1291320/2582640ProtobufJavaHelpers::Varinter.to_varint_64
0.360.100.261263578/2527156##each_key0.370.110.271291320/2582640##each_key
0% 0%0.360.100.2625271560.370.110.272582640 Protobuf::Field::EnumField(singleton)#value_from_values
0.360.35 0.000.360.35 1/1 Bundler.setup
0% 0%0.360.35 0.000.360.35 1 Bundler::Runtime#setup
0.33 1/1 Bundler::Runtime#requested_specs
0.340.220.121291320/1291473Protobuf::Field::StringField(singleton)#encode_to_stream
0%0%0.340.220.121291473Protobuf::Field::VarintField.encode
0.120.120.001291473/1291473ProtobufJavaHelpers::Varinter.to_varint
1 Bundler::Runtime#requested_specs
0.33 1 Bundler::Definition#requested_specs
0.33 1/1 Bundler::Definition#specs_for
1 Bundler::Definition#specs_for
0.32 1/1 Bundler::Definition#specs
0.330.210.121263578/1263578Protobuf::Field::Int64Field(singleton)#encode_to_stream
0%0%0.330.210.121263578Protobuf::Field::Int64Field#encode
0.120.120.001263578/2527156ProtobufJavaHelpers::Varinter.to_varint_64
0.320.220.111263578/1263731Protobuf::Field::StringField(singleton)#encode_to_stream
0%0%0.330.220.111263731Protobuf::Field::VarintField.encode
0.110.110.001263731/1263731ProtobufJavaHelpers::Varinter.to_varint
1 Bundler::Definition#specs
0.210.20 0.000.210.20 1/1 Bundler::SpecSet#materialize
0.10 1/1 Bundler::Definition#resolve
0.290.000.291/1Bundler::Dsl.evaluate0.310.180.141291320/1291588Protobuf::Field::EnumField#encode
0% 0%0.290.000.291Bundler::Dsl#to_definition0.310.180.141291588Protobuf::Enum#to_i
0.290.010.281/2528680Class#new0.140.140.001291588/1291588Protobuf::Enum#tag
0.140.140.100.10 0.001263578/2527298Protobuf::Field::StringField#decode2582641/7748887Protobuf::Field::Int64Field(singleton)#set_field
0.140.140.100.10 0.001263578/2527298Protobuf::Field::StringField(singleton)#encode_to_stream2582641/7748887Protobuf::Field::StringField(singleton)#set_field
0% 0%0.290.290.300.30 0.002527298##+7748887Kernel.nil?
0.280.30 0.000.280.301/1Bundler::Dsl.evaluate
0%0%0.300.000.301Bundler::Dsl#to_definition
0.300.010.291/2584164Class#new
0.290.000.29 1/1 Class#new
0% 0%0.280.29 0.000.280.29 1 Bundler::Definition#initialize
0.11 1/1 Bundler::Definition#converge_paths
0.270.28 0.170.101253578/12635780.111281320/1291320 Proc#call
0% 0%0.280.180.1012635780.290.170.111291320 StringIO.new
0.100.100.110.11 0.001263578/12635781291320/1291320 StringIO#initialize
0.280.170.111263578/1263846Protobuf::Field::EnumField#encode0.220.061291320/1291320Protobuf::Field::Int64Field(singleton)#set
0% 0% 0.280.170.111263846Protobuf::Enum#to_i0.220.061291320Protobuf::Field::Int64Field#decode
0.110.110.120.12 0.001263846/1263846Protobuf::Enum#tag1291320/2582782Protobuf::Field::StringField(singleton)#encode_to_stream
0.280.280.130.13 0.005054312/5054312Protobuf::Decoder.decode_each_field1291320/2582782Protobuf::Field::StringField#decode
0% 0%0.280.280.250.25 0.005054312StringIO#eof2582782##+
0.270.200.240.17 0.071263578/1263578Protobuf::Field::Int64Field(singleton)#set1291320/1292131Protobuf::Field::StringField(singleton)#encode_to_stream
0% 0%0.270.200.071263578Protobuf::Field::Int64Field#decode0.240.170.081292131BasicObject#!=
0.250.200.240.19 0.051263578/12635781291320/1291320 Protobuf::Field::EnumField(singleton)#set
0% 0%0.250.200.240.19 0.0512635781291320 Protobuf::Field::EnumField#decode
0.220.160.061263578/1264389Protobuf::Field::StringField(singleton)#encode_to_stream
0%0%0.230.160.071264389BasicObject#!=
0.220.220.240.24 0.002527156/25277142582640/2583314 Protobuf::Field::EnumField#coerce!
0% 0%0.220.220.240.24 0.0025277142583314 Protobuf::Field::BaseField#type_class
0.120.120.100.100.001291320/2582640Protobuf::Field::EnumField#encode
0.140.14 0.001263578/25271561291320/2582640 Protobuf::Field::Int64Field#encode
0% 0%0.220.220.240.24 0.0025271562582640 ProtobufJavaHelpers::Varinter.to_varint_64
0.210.210.240.24 0.002527157/2527341Protobuf::Field::StringField(singleton)#set_field5165280/5165280Protobuf::Decoder.decode_each_field
0% 0%0.210.210.240.24 0.002527341##delete5165280StringIO#eof
0.210.210.200.20 0.005054312/50575405165280/5168510 Protobuf::Decoder.decode_each_field
0% 0%0.210.210.200.20 0.005057540##==5168510##==
0.210.200.20 0.000.212582641/2582825Protobuf::Field::StringField(singleton)#set_field
0%0%0.200.200.002582825##delete
0.200.000.20 1/1 Bundler::Definition#specs
0% 0%0.210.20 0.000.210.20 1 Bundler::SpecSet#materialize
0.130.12 0.000.130.12 109/153 Protobuf::Message::Fields::ClassMethods.optional
0% 0%0.190.18 0.00 0.18 153 Protobuf::Message::Fields::ClassMethods.define_field
0.180.17 0.000.180.17 153/153 Protobuf::Field.build
0.180.170.17 0.000.183873960/3873960Protobuf::Decoder.decode_each_field
0%0%0.170.170.003873960##>>
0.170.000.17 153/153 Protobuf::Message::Fields::ClassMethods.define_field
0% 0%0.180.17 0.000.180.17 153 Protobuf::Field.build
0.17 0.010.17153/25286800.16153/2584164 Class#new
0.180.180.170.17 0.003554700/3554700##each3681355/3681355##each
0% 0%0.180.180.170.17 0.003554700##<3681355##<
0.17 0.17 0.003790734/37907343873960/3873960 Protobuf::Decoder.decode_each_field
0.17 0.17 0.003790734##>>3873960##&
0%0%0.160.000.166Bundler::SpecSet#for
0.160.010.166/6Kernel.loop
0.170.170.003790734/3790734Protobuf::Decoder.decode_each_field0.160.010.166/6Bundler::SpecSet#for
0% 0%0.170.170.160.010.166Kernel.loop
0.14 0.003790734##&0.14215/215Bundler::SpecSet#spec_for_dependency
0.170.01 0.160.010.15 153/153 Class#new
0% 0%0.170.01 0.160.010.15 153 Protobuf::Field::BaseField#initialize
0%0%0.150.060.091137BasicObject#instance_eval
0.15 0.15 0.002527157/25281892582641/2583673 Test::Resource#_protobuf_message_required_field_tags
0.15 0.15 0.0025281892583673 Kernel.dup
0%0%0.150.070.081137BasicObject#instance_eval
0% 0% 0.14 0.030.120.11 61 Kernel.eval
0.110.030.100.02 0.0816/252868016/2584164 Class#new
0.140.000.141/1Kernel.require
0%0%0.140.000.141Gem::Specification.load_defaults
0.140.000.141/1Gem::Specification.each_spec
0.14 0.000.141/1Gem::Specification.load_defaults2582649/2584139Protobuf::Enum.fetch
0% 0% 0.140.000.141Gem::Specification.each_spec
0.14 0.000.141/1Gem::Specification.each_gemspec2584139Kernel.kind_of?
0.14 0.00 0.141/1Gem::Specification.each_spec215/215Kernel.loop
0% 0.14 0.00 0.141Gem::Specification.each_gemspec
0.140.000.141/1265137##each215Bundler::SpecSet#spec_for_dependency
0.14 0.14 0.001263578/1263578Protobuf::Decoder.decode_each_field1291588/1291588Protobuf::Enum#to_i
0% 0.14 0.14 0.001263578StringIO#read
0.140.000.13109/109Kernel.require
0%0%0.140.000.13109Protobuf::Message::Fields::ClassMethods.optional
0.130.000.13109/153Protobuf::Message::Fields::ClassMethods.define_field1291588Protobuf::Enum#tag
0.13 0.13 0.002527165/2528655Protobuf::Enum.fetch2582640/2583129Protobuf::Enum.enum_for_tag_integer
0% 0.13 0.13 0.002528655Kernel.kind_of?2583129##first
0.13 0.13 0.002527156/2527645Protobuf::Enum.enum_for_tag_integer1291320/1291320Protobuf::Decoder.decode_each_field
0% 0.13 0.13 0.002527645##first1291320StringIO#read
0%0%0.130.000.1313Bundler::SpecSet#sorted
0.130.000.134/4TSort.tsort
0% 0% 0.02 0.11 412##map!
0.130.000.134/176##to_a
0%0%0.130.000.13176Enumerator#each
0.130.000.134/8TSort.tsort_each
0.130.000.134/4Bundler::SpecSet#sorted
0%0%0.130.000.134TSort.tsort
0.130.000.134/4TSort.tsort
0.130.000.134/4TSort.tsort
0%0%0.130.000.134TSort.tsort
0.130.000.134/4##to_a
0.130.000.134/8Enumerator#each
0%0%0.130.000.138TSort.tsort_each
0.130.000.134/4TSort.each_strongly_connected_component
0.130.000.134/4TSort.tsort
0%0%0.130.000.134##to_a
0.130.000.134/176Enumerator#each
0.130.000.134/4TSort.tsort_each
0%0%0.130.000.134TSort.each_strongly_connected_component
0.130.000.134/122Method#call##map!
0.13 0.00 0.134/122TSort.each_strongly_connected_component1/1Kernel.require
0% 0.13 0.00 0.13122Method#call1Gem::Specification.load_defaults
0.130.12 0.000.134/4Bundler::SpecSet#tsort_each_node0.121/1Gem::Specification.each_spec
0.130.12 0.000.134/4Method#call0.121/1Gem::Specification.load_defaults
0% 0%0.130.12 0.000.134Bundler::SpecSet#tsort_each_node0.121Gem::Specification.each_spec
0.130.12 0.00 0.124/1265137##each1/1Gem::Specification.each_gemspec
0.120.010.11118/118##each0.000.12109/109Kernel.require
0% 0% 0.120.010.11118TSort.each_strongly_connected_component_from0.000.12109Protobuf::Message::Fields::ClassMethods.optional
0.120.12 0.002527157/2527157Protobuf::Field::Int64Field(singleton)#set_field
0%0% 0.120.120.002527157ProtobufJavaHelpers::Int64ProtobufField.coerce!109/153Protobuf::Message::Fields::ClassMethods.define_field
0.120.12 0.002527157/2528322Protobuf::Field::StringField#coerce!0.121/1Gem::Specification.each_spec
0% 0% 0.120.12 0.002528322##to_s
0%0% 0.121Gem::Specification.each_gemspec
0.12 0.002527156ProtobufJavaHelpers::IntegerProtobufField.decode_varint_640.121/1292879##each
0.00 0.12 172##any?##any?
0.11 2/2 Bundler::Definition#specs_changed?
0.110.110.120.12 0.001263846/1263846Protobuf::Enum#to_i1291473/1291473Protobuf::Field::VarintField.encode
0% 0%0.110.110.120.12 0.001263846Protobuf::Enum#tag1291473ProtobufJavaHelpers::Varinter.to_varint
0.110.00 0.1113/14##each0.001291320/1291320StringIO.new
0% 0% 0.110.00 0.1114Gem::Specification.load0.001291320StringIO#initialize
0.11 0.11 0.002527157/2527158Protobuf::Message#initialize2582641/2582641Protobuf::Field::Int64Field(singleton)#set_field
0% 0.11 0.11 0.002527158##to_hash2582641ProtobufJavaHelpers::Int64ProtobufField.coerce!
0.110.11 0.001253578/1263578Proc#call0.111/1Bundler::Definition#initialize
0% 0% 0.110.000.111Bundler::Definition#converge_paths
0.11 0.001263578Protobuf::Message#to_proto0.111/172##any?
0.110.000.112/2##any?
0%0%0.110.000.112Bundler::Definition#specs_changed?
0.11 0.001263731/1263731Protobuf::Field::VarintField.encode0.112/2Bundler::Definition#specs_for_source_changed?
0% 0% 0.11 0.11 0.001263731ProtobufJavaHelpers::Varinter.to_varint2582640ProtobufJavaHelpers::IntegerProtobufField.decode_varint_64
0.110.10 0.000.111/1Bundler::Definition#initialize0.102/5Bundler::Definition#specs_for_source_changed?
0% 0.11 0.00 0.111Bundler::Definition#converge_paths5Bundler::Source::Path#specs
0.11 0.00 0.111/172##any?5/5Bundler::Source::Path#local_specs
0.00 0.11 2/2##any?Bundler::Definition#specs_changed?
0% 0.00 0.11 2Bundler::Definition#specs_changed?Bundler::Definition#specs_for_source_changed?
0.110.10 0.000.112/2Bundler::Definition#specs_for_source_changed?0.102/5Bundler::Source::Path#specs
0.110.00 0.112/2Bundler::Definition#specs_changed?0.002582641/2582814Protobuf::Message#initialize
0% 0% 0.110.11 0.002582814Kernel.block_given?
0.112Bundler::Definition#specs_for_source_changed?0.000.115/5Bundler::Source::Path#specs
0% 0%0.100.11 0.000.100.11 5Bundler::Source::Path#specsBundler::Source::Path#local_specs
0.100.11 0.000.105/50.113/3Bundler::Source::Path#load_spec_files
0.110.000.113/3 Bundler::Source::Path#local_specs
0%0%0.110.000.113Bundler::Source::Path#load_spec_files
0.100.100.110.11 0.002527157/2527330Protobuf::Message#initialize1281320/1291320Proc#call
0% 0%0.100.100.110.11 0.002527330Kernel.block_given?1291320Protobuf::Message#to_proto
0%0%0.110.090.02449##reverse_each
0.100.100.110.11 0.001263578/1263578StringIO.new2582641/2582642Protobuf::Message#initialize
0% 0%0.100.100.110.11 0.001263578StringIO#initialize2582642##to_hash
1 Bundler::Definition#resolve
0.100.10 0.002582641/2583806Protobuf::Field::StringField(singleton)#set_field
0%0% 0.105/5Bundler::Source::Path#specs0.100.002583806##to_s
0% 0% 0.10 0.00 0.105Bundler::Source::Path#local_specs14Gem::Specification.load
@@ -67,13 +67,13 @@

Total time: 63.22

- + - + - + @@ -82,34 +82,34 @@

Total time: 63.22

- + - + - - + + - + - - - - - + + + + + - + - - - - - + + + + + - + @@ -118,153 +118,189 @@

Total time: 63.22

- + - - - - - + + + + + - + - - - + + + - + + + + + + + + + + + + + + + + + + + - - - + + + - + - + - - - - - - - - - - - - + + + - + - - - - - + + + + + - + - - - - - + + + + + - + + - - + - - + + + - + + + + + + + + + - - + + + - - - - - - + + + + + - + - - - + + + - - - - - - + + + + + + - + - + + + + + + + + + + + + + + + + + + + + - - - + + - + - + + - - - + + - + - + - - - + + + - + - - - - - + + + + + - + @@ -275,7 +311,7 @@

Total time: 63.22

- + @@ -283,7 +319,7 @@

Total time: 63.22

- + @@ -292,7 +328,7 @@

Total time: 63.22

- + @@ -303,7 +339,7 @@

Total time: 63.22

- + @@ -311,144 +347,135 @@

Total time: 63.22

- + - + - + - - - - - + + + + + - - - - + + + + - + - - - - + + + + - + - - + + - - + + - + - - + + - - + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - + - + + - - - - - - - - - - + @@ -456,7 +483,7 @@

Total time: 63.22

- + @@ -467,160 +494,160 @@

Total time: 63.22

- + - + - - + + - + - - - - + + + + - - - - + + + + - - - - - - + + + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - - + + + + + - + - - + + - - + + - + - - + + - - + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - - + + + + + @@ -630,7 +657,7 @@

Total time: 63.22

- + @@ -641,813 +668,1051 @@

Total time: 63.22

- + - - - - + + + + - - - - - + + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - - - + + + + - - - - - - + + + + + + - + - - - - + + + + - + - - - - - + + + + + - + - - + + - + - + - - + + - - + + - + - - + + - - + + - + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - - + + + + + - + - - + + - - + + - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - - + + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - + - - - + + + - + - - - - - + + + + + - + - - + + - - + + - - - - - + + + + + - - - - - - - + + + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + + - - - - - + + + + + + + + + + + + + + - + - - + + + + + + + + + + + - - + + - + - - + + - - + + - - + - - - - - + + + + + - - - - - - - - + + + + + + + + - + - - - - - + + + + + - + - - + + - - + + - - - - - + + + + + - - - - + + + + - + - - - - + + + + - + - - + + - - + + + + + + + + + + + - - + + - + - - + + - + - - + + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - + - + - + - + - + - + - - + + - + - - + + + + + + + + + + + - + - - + + - + - - + + - + - - + + - + - - + + - - + + - - + + - - + + - + - - - - + + + + - - - - - - + + + + + + - + - - - - - + + + + + - + + - - + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + - + - - + + - - + + - + - - - - + + + + - - - - - + + + + + - + - - - - + + + + - + - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + - + - - - - - + + + + + - + - - + + - - + + - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + - - - - + + + + + + + + + + + + + - - - - + + + + - + - - + + - - + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + + + - + - - + + - - + + @@ -1456,978 +1721,1081 @@

Total time: 63.22

- + - + - - + + - + - - + + - + - - + + - + - + - + - + - - - + + + - + - + - + - + - + - + - + - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - + + - - + + + + + + + + + + + - + - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - - - - - + + + + + - + - - - - + + + + - + - - - - - + + + + + - + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - + + + + + + + - + - - - - - + + + + + - + - - + + - - + + - + + - - - - - + + + + + - + + + + + + + + + + - - - - - + + + + + - + - - - - - + + + + + - - - - - + + + + + - + + + + + + + + + + - - - - - + + + + + - + - - - - - + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - - - - - + + + + + - - - - - - - + + + + + + + + + + + + + + + + - + + + + + + + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + + - - - - - + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - - - - - + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - + - - + + - + - - - - - - - - - - - - - - + + + + + - + - - - - + + + + - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - + - - + + - + - - + + - + - + - - + + - + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - + - - + + - - + + - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - - - - + + + + - - - - - - - - - - - - - - - + + + + + + - - + - - - - - - - - - - - + + - - + + - + - - + + - - + + - - + + - + - - + + - - + + - - - - - + + + + + - - - - - - - - - - - - - - + + + + + - + - - + + - - + + - - - - - + + + + + - - - + + + + + + + + + + + + - - + + - + - - - - - + + + + + - - - - - + + + + + - + - - - - + + + + - + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + @@ -2448,126 +2816,89 @@

Total time: 63.22

- + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - + - - + + - + - - - - - + + + + + - - - - - - - - - - - - - - + + + + + - + - + @@ -2576,10 +2907,10 @@

Total time: 63.22

- + - + @@ -2588,138 +2919,110 @@

Total time: 63.22

- + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - - - - - - - - - - - + + - - + + - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - - - - - + + + + + - - - - - + + + + + - + - - + - - + + + - + @@ -2738,13 +3041,13 @@

Total time: 63.22

- + - + @@ -2766,7 +3069,7 @@

Total time: 63.22

- + @@ -2775,7 +3078,7 @@

Total time: 63.22

- + @@ -2794,7 +3097,7 @@

Total time: 63.22

- + @@ -2803,7 +3106,26 @@

Total time: 63.22

- + + + + + + + + + + + + + + + + + + + + @@ -2822,314 +3144,317 @@

Total time: 63.22

- + - + - + - - - - - - - - - - + - - - - - + + + + + - - - - - - - - - - - - - + + + + - - + + - - + + - - + + + + + + + + + + + + - - + + - - + + - - + + - - + + - + - + - + - + - + - + - - + + - + - + - + - + - + + - - - - - + + + + + + + + + + + + + + - + - - - - - + + + + + - - - - - + + + + + - + - - + - - + + + - + - - - - + + + + - - - - - - - - - - - - - - - - - - - - + - - + + + - - + + - - + + - - + + - - + + - - - - - + + + + + - + - - - - - + + + + + - + + + + + + + + + - - - + + + + - + - - + + - - + + - - + + - - + + - - - - - + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -3138,8 +3463,8 @@

Total time: 63.22

- - + + @@ -3147,840 +3472,827 @@

Total time: 63.22

- - + + - + - - + - - + + + - - + - - + + + - - + - + - - - + + + + + + + + + + + + + - - - - - + + + + + - + - + + - - - + + - - - + + + - + + - + + - - - + + + + + + + + + + + - + - - + + - - + + - - - + + + - - + + - + - - - + + + - + - + - + - + - - - - + + + + - + - - + - - + + + - - - - - + + + + + - - + - - - - - - - - - - - + - - + + + - + - - - - - - - - - - - - + + + - + - - - - - + + + + + - + - - + + - + - - + + - + - + - + - + - + - - - - + + + - - - - + + + + - + - - - + + + + + + + + + + + + + + + + + + + + + - - + + + - - - - - - + + + + + - + - - - - - + + + + + - + - - - - + + + + - - - - - + + + + + - + - + + - - - + + - + + - - - + + - + + - - - + + + - - - + + - + - - + - - + + + - - + - - + + + - - + - - - - - - - - - - - + - - + + + - + - - - - - + + + + + - + - + - + - + - + - + - + - + - - - - - - - - - - + - - - - - + + + + + - + - - - - - + + + + + - + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - + - + - + - + - + - - - + + + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - - + + - - + + - - + + - - + + - + - - + - - + + + - - + + + + + + + + + + - - + + + - + - - + + - - + + - - + + - - + + - + + - - - + + - - - - - - - - - - + + - - - + + - + - + - - - + + + - + - - - + + + - + + + - - - - + + - + - - + + - - + + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - - + - - + + + - - + - - + + + + + + + + + + + + - + - - - + + + - + - - - + + + - + - + - - - + + + + + - - - - + + + + - - - - + + - + - - - + + + - - - - - - - - - - - - + + - - + - - - - - - - - - - - + + - + - - + + - + - - - + + + - + - - + + @@ -3988,1228 +4300,1207 @@

Total time: 63.22

- - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + - - - - + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - - - - - - + + + + + + + + + + - - - + + + + + + + + + + + - - - - - + - - - - + + + + - - - + + + + + - + - - - - + + + + + + - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + - - + + + + - + + + - - + + - - + + - - - - - - - - - - - - - - + + - - + + + - - + - + + + + + - - - - - - + + + - - + + + + + + + + - - - + + + + + - - - + - - - - - - + - - - - - - - + + - - - + + + - - - + + + + + + - - + + + - - - - - + + + + + + - - + - - + + + + + + + + + + + + + + - - - - - - - + + - + + + + + + + + + + + + + + + - - - - + + - + + + + - - - - - + - + + + - - - - - - - - - + + + + - - + - - + + + + - + + - - - - - - - - + - + + + + - - + + - - - - - - - + + - - - - - - - + + + + - - + + - - - - - + + + - + + + - + + - - - - - - + + + + - - - - + - + + + + - - + + - - - - - - - - + + + + + + + + + - - - - - + + + - + + + + + + + + + + + + + + + - - + + + - - - - - - + + - - - - - - + + + - + + - + + + - - - - - + + + + - + + + + - - + - + + + + + + - - - + + + + - + + - - - - + + + + + + + - - - - + + + + - + - - - + + - + + + + - - - - - + + - - - - - + + + + + + - - - - + + + + - - - - - - - - - - + - - - - - - - - - - + - - - - + + + + + - - + - - - - - - + + - + + + + + - + + + + - - - + + - - + + + + + + - - - - - - + - + + + - + - + - - - - + + - + - - - + + + - + - - - - - + - - - + - + + + + + - - - - - + + + + + + + + + + - - + + - - - - - - + - - - - - + + + + - - - + - + + + + - - - - - + - - - - - - - - - - + + + + + + + + + - - + + - + + - - - - - - - + + - + + - - + - - - - - + + - - - + - + - + + - + + + + + - - + + - + + + - - - - + - - - - + + + + + - - - - + + - - - + - - - + + + - + + + + + - @@ -5218,18 +5509,17 @@

Total time: 63.22

+ + - - - + - - + @@ -5237,23 +5527,23 @@

Total time: 63.22

+ + + + - + + - - - - - @@ -5261,17 +5551,19 @@

Total time: 63.22

+ + + - @@ -5282,7 +5574,6 @@

Total time: 63.22

- @@ -5295,6 +5586,8 @@

Total time: 63.22

+ + @@ -5307,18 +5600,17 @@

Total time: 63.22

- + + + - - - @@ -5328,6 +5620,7 @@

Total time: 63.22

+ @@ -5339,11 +5632,9 @@

Total time: 63.22

- - @@ -5353,14 +5644,15 @@

Total time: 63.22

+ + - - + @@ -5369,12 +5661,12 @@

Total time: 63.22

- + From 71b2fc09951d042d8d24470de9e3353b94144f22 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Sun, 30 Dec 2018 13:11:13 -0700 Subject: [PATCH 24/93] move the const setting to the module fields --- lib/protobuf/message.rb | 8 -------- lib/protobuf/message/fields.rb | 11 +++++++++++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/protobuf/message.rb b/lib/protobuf/message.rb index 412732f1..3ff3115e 100644 --- a/lib/protobuf/message.rb +++ b/lib/protobuf/message.rb @@ -193,14 +193,6 @@ def set_field(name, value, ignore_nil_for_repeated, field = nil) end end - def _protobuf_message_field - @_protobuf_message_field ||= self.class.field_store - end - - def _protobuf_message_required_field_tags - @_protobuf_message_required_field_tags ||= self.class.required_field_tags - end - ## # Instance Aliases # diff --git a/lib/protobuf/message/fields.rb b/lib/protobuf/message/fields.rb index 268851a8..87793c5c 100644 --- a/lib/protobuf/message/fields.rb +++ b/lib/protobuf/message/fields.rb @@ -20,6 +20,17 @@ def self.extended(other) module ClassMethods def inherited(subclass) inherit_fields!(subclass) + subclass.const_set("PROTOBUF_MESSAGE_REQUIRED_FIELD_TAGS", subclass.required_field_tags) + subclass.const_set("PROTOBUF_MESSAGE_GET_FIELD", subclass.field_store) + subclass.class_eval <<~RUBY, __FILE__, __LINE__ + def _protobuf_message_field + PROTOBUF_MESSAGE_GET_FIELD + end + + def _protobuf_message_required_field_tags + @_protobuf_message_required_field_tags ||= PROTOBUF_MESSAGE_REQUIRED_FIELD_TAGS.dup + end + RUBY end ## From c54ae743e3873481211bced3bfdad526286e261a Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Mon, 31 Dec 2018 11:03:52 -0700 Subject: [PATCH 25/93] fixing specs for refactor --- lib/protobuf.rb | 7 ------- .../field/base_field_method_definitions.rb | 14 +++++++++++--- lib/protobuf/field/string_field.rb | 4 +++- lib/protobuf/varint.rb | 6 ------ 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/lib/protobuf.rb b/lib/protobuf.rb index 3f9b7e91..148b1170 100644 --- a/lib/protobuf.rb +++ b/lib/protobuf.rb @@ -10,13 +10,6 @@ require 'active_support/json' require 'active_support/notifications' -# rubocop:disable Lint/HandleExceptions -begin - require 'protobuf_java_helpers' -rescue LoadError -end -# rubocop:enable Lint/HandleExceptions - # All top-level run time code requires, ordered by necessity require 'protobuf/wire_type' diff --git a/lib/protobuf/field/base_field_method_definitions.rb b/lib/protobuf/field/base_field_method_definitions.rb index 2ff4786c..a19b1a96 100644 --- a/lib/protobuf/field/base_field_method_definitions.rb +++ b/lib/protobuf/field/base_field_method_definitions.rb @@ -231,7 +231,11 @@ def set_field(values, value, ignore_nil_for_repeated, message_instance) message_instance._protobuf_message_required_field_tags << #{selph.tag} else message_instance._protobuf_message_required_field_tags.delete(#{selph.tag}) - values[#{fully_qualified_name_string(selph)}] = value.to_s + values[#{fully_qualified_name_string(selph)}] = if value.is_a?(String) + value + else + coerce!(value) + end end end RUBY @@ -241,7 +245,11 @@ def set_field(values, value, ignore_nil_for_repeated, message_instance) if value.nil? values.delete(#{fully_qualified_name_string(selph)}) else - values[#{fully_qualified_name_string(selph)}] = value.to_s + values[#{fully_qualified_name_string(selph)}] = if value.is_a?(String) + value + else + coerce!(value) + end end end RUBY @@ -335,7 +343,7 @@ def value_from_values(values) def value_from_values_for_serialization(values) value = value_from_values(values) - array = Array.new(value.size) + array = [] value.each do |k, v| array << type_class.new(:key => k, :value => v) end diff --git a/lib/protobuf/field/string_field.rb b/lib/protobuf/field/string_field.rb index 055ace43..6c9c278f 100644 --- a/lib/protobuf/field/string_field.rb +++ b/lib/protobuf/field/string_field.rb @@ -21,8 +21,10 @@ def acceptable?(val) def coerce!(value) if value.nil? nil - else + elsif acceptable?(value) value.to_s + else + fail TypeError, "Unacceptable value #{value} for field #{name} of type #{type_class}" end end diff --git a/lib/protobuf/varint.rb b/lib/protobuf/varint.rb index 1012d658..fef5e953 100644 --- a/lib/protobuf/varint.rb +++ b/lib/protobuf/varint.rb @@ -2,12 +2,6 @@ module Protobuf class Varint if defined?(::Varint) extend ::Varint - elsif defined?(::ProtobufJavaHelpers) - extend ::ProtobufJavaHelpers::Varinter - - def self.decode(stream) - read_varint(stream) - end else extend VarintPure end From 451384755d6e0bb4ccc190d742c959c6aa763263 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Mon, 31 Dec 2018 13:34:53 -0700 Subject: [PATCH 26/93] fix specs and keep the cops happy --- .rubocop.yml | 2 ++ lib/protobuf/code_generator.rb | 4 ++++ lib/protobuf/field/base_field.rb | 6 +----- lib/protobuf/field/bool_field.rb | 2 +- lib/protobuf/message.rb | 4 +++- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 9972b631..e0cad4be 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,6 +4,8 @@ AllCops: DisplayCopNames: true Exclude: - 'spec/support/protos/*.pb.rb' + - 'lib/protobuf/field/base_field_method_definitions.rb' + - 'varint_prof.rb' Lint/EndAlignment: AlignWith: keyword diff --git a/lib/protobuf/code_generator.rb b/lib/protobuf/code_generator.rb index 230a7501..7b04a32c 100644 --- a/lib/protobuf/code_generator.rb +++ b/lib/protobuf/code_generator.rb @@ -50,6 +50,9 @@ def response_bytes end Protobuf::Field::BaseField.module_eval do + def define_set_method! + end + def set_without_options(message_instance, bytes) return message_instance[name] = decode(bytes) unless repeated? @@ -98,6 +101,7 @@ def set_with_options(message_instance, bytes) set_without_options(message_instance, bytes) end + alias_method :set, :set_with_options def option_set(message_field, subfield, subvalue) return unless yield diff --git a/lib/protobuf/field/base_field.rb b/lib/protobuf/field/base_field.rb index 689b23ca..a219a462 100644 --- a/lib/protobuf/field/base_field.rb +++ b/lib/protobuf/field/base_field.rb @@ -22,7 +22,7 @@ class BaseField ## # Attributes # - attr_reader :message_class, :name, :fully_qualified_name, :options, :rule, :tag, :type_class + attr_reader :default_value, :message_class, :name, :fully_qualified_name, :options, :rule, :tag, :type_class ## # Class Methods @@ -104,10 +104,6 @@ def set_default_value! end end - def default_value - @default_value - end - def define_encode_to_stream! if repeated? && packed? ::Protobuf::Field::BaseFieldMethodDefinitions.define_repeated_packed_encode_to_stream_method!(self) diff --git a/lib/protobuf/field/bool_field.rb b/lib/protobuf/field/bool_field.rb index b325acfd..bba089f4 100644 --- a/lib/protobuf/field/bool_field.rb +++ b/lib/protobuf/field/bool_field.rb @@ -3,7 +3,7 @@ module Protobuf module Field class BoolField < VarintField - ONE = 1.freeze + ONE = 1 FALSE_ENCODE = [0].pack('C') FALSE_STRING = "false".freeze FALSE_VALUES = [false, FALSE_STRING].freeze diff --git a/lib/protobuf/message.rb b/lib/protobuf/message.rb index 3ff3115e..d1db6551 100644 --- a/lib/protobuf/message.rb +++ b/lib/protobuf/message.rb @@ -186,7 +186,9 @@ def []=(name, value) end def set_field(name, value, ignore_nil_for_repeated, field = nil) - if (field || field = _protobuf_message_field[name]) + field ||= _protobuf_message_field[name] + + if field field.set_field(@values, value, ignore_nil_for_repeated, self) else fail(::Protobuf::FieldNotDefinedError, name) unless ::Protobuf.ignore_unknown_fields? From 400b1d3ca23ebbf36ca255ad172a449661838b16 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Mon, 31 Dec 2018 13:46:05 -0700 Subject: [PATCH 27/93] specs and cops passing --- .rubocop.yml | 1 - .../field/base_field_method_definitions.rb | 104 +++++++++--------- lib/protobuf/message/fields.rb | 2 +- 3 files changed, 55 insertions(+), 52 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index e0cad4be..310aa0c8 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,7 +4,6 @@ AllCops: DisplayCopNames: true Exclude: - 'spec/support/protos/*.pb.rb' - - 'lib/protobuf/field/base_field_method_definitions.rb' - 'varint_prof.rb' Lint/EndAlignment: diff --git a/lib/protobuf/field/base_field_method_definitions.rb b/lib/protobuf/field/base_field_method_definitions.rb index a19b1a96..069ee40e 100644 --- a/lib/protobuf/field/base_field_method_definitions.rb +++ b/lib/protobuf/field/base_field_method_definitions.rb @@ -12,7 +12,7 @@ def self.fully_qualified_name_string(selph) end def self.define_to_hash_value_to_message_hash!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def to_message_hash(values, result) result[#{selph.name.inspect}] = value_from_values(values).to_hash_value end @@ -20,7 +20,7 @@ def to_message_hash(values, result) end def self.define_base_to_message_hash!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def to_message_hash(values, result) result[#{selph.name.inspect}] = value_from_values(values) end @@ -28,7 +28,7 @@ def to_message_hash(values, result) end def self.define_repeated_packed_encode_to_stream_method!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def encode_to_stream(value, stream) packed_value = value.map { |val| encode(val) }.join stream << #{selph.tag_encoded.dump} << "\#{::Protobuf::Field::VarintField.encode(packed_value.size)}\#{packed_value}" @@ -37,7 +37,7 @@ def encode_to_stream(value, stream) end def self.define_bytes_encode_to_stream_method!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def encode_to_stream(value, stream) value = value.encode if value.is_a?(::Protobuf::Message) byte_size = ::Protobuf::Field::VarintField.encode(value.bytesize) @@ -48,7 +48,7 @@ def encode_to_stream(value, stream) end def self.define_string_encode_to_stream_method!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def encode_to_stream(value, stream) new_value = "" + value if new_value.encoding != ::Protobuf::Field::StringField::ENCODING @@ -61,7 +61,7 @@ def encode_to_stream(value, stream) end def self.define_base_encode_to_stream_method!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def encode_to_stream(value, stream) stream << #{selph.tag_encoded.dump} << encode(value) end @@ -69,7 +69,7 @@ def encode_to_stream(value, stream) end def self.define_repeated_not_packed_encode_to_stream_method!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def encode_to_stream(value, stream) value.each do |val| stream << #{selph.tag_encoded.dump} << encode(val) @@ -79,7 +79,7 @@ def encode_to_stream(value, stream) end def self.define_base_set_method!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def set(message_instance, bytes) message_instance.set_field("#{selph.name}", decode(bytes), true, self) end @@ -87,7 +87,7 @@ def set(message_instance, bytes) end def self.define_map_set_method!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def set(message_instance, bytes) hash = message_instance["#{selph.name}"] entry = decode(bytes) @@ -100,7 +100,7 @@ def set(message_instance, bytes) end def self.define_repeated_not_packed_set_method!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def set(message_instance, bytes) message_instance["#{selph.name}"] << decode(bytes) end @@ -108,7 +108,7 @@ def set(message_instance, bytes) end def self.define_repeated_packed_set_method!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def set(message_instance, bytes) array = message_instance["#{selph.name}"] stream = ::StringIO.new(bytes) @@ -126,7 +126,7 @@ def set(message_instance, bytes) def self.define_map_set_field!(selph) if selph.required? - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def set_field(values, value, ignore_nil_for_repeated, message_instance) unless value.is_a?(Hash) fail TypeError, <<-TYPE_ERROR @@ -146,7 +146,7 @@ def set_field(values, value, ignore_nil_for_repeated, message_instance) end RUBY else - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def set_field(values, value, ignore_nil_for_repeated, message_instance) unless value.is_a?(Hash) fail TypeError, <<-TYPE_ERROR @@ -166,36 +166,40 @@ def set_field(values, value, ignore_nil_for_repeated, message_instance) end end - def self.define_repeated_set_field!(selph) - if selph.required? - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 - def set_field(values, value, ignore_nil_for_repeated, message_instance) - if value.nil? && ignore_nil_for_repeated - ::Protobuf.deprecator.deprecation_warning("['#{fully_qualified_name_string(selph)}']=nil", "use an empty array instead of nil") - return - end + def self.define_required_repeated_set_field!(selph) + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 + def set_field(values, value, ignore_nil_for_repeated, message_instance) + if value.nil? && ignore_nil_for_repeated + ::Protobuf.deprecator.deprecation_warning("['#{fully_qualified_name_string(selph)}']=nil", "use an empty array instead of nil") + return + end - unless value.is_a?(Array) - fail TypeError, <<-TYPE_ERROR - Expected repeated value of type '#{selph.type_class}' - Got '\#{value.class}' for repeated protobuf field #{selph.name} - TYPE_ERROR - end + unless value.is_a?(Array) + fail TypeError, <<-TYPE_ERROR + Expected repeated value of type '#{selph.type_class}' + Got '\#{value.class}' for repeated protobuf field #{selph.name} + TYPE_ERROR + end - value = value.compact + value = value.compact - if value.empty? - values.delete(#{fully_qualified_name_string(selph)}) - message_instance._protobuf_message_required_field_tags << #{selph.tag} - else - message_instance._protobuf_message_required_field_tags.delete(#{selph.tag}) - values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldArray.new(self) - values[#{fully_qualified_name_string(selph)}].replace(value) - end + if value.empty? + values.delete(#{fully_qualified_name_string(selph)}) + message_instance._protobuf_message_required_field_tags << #{selph.tag} + else + message_instance._protobuf_message_required_field_tags.delete(#{selph.tag}) + values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldArray.new(self) + values[#{fully_qualified_name_string(selph)}].replace(value) end - RUBY + end + RUBY + end + + def self.define_repeated_set_field!(selph) + if selph.required? + define_required_repeated_set_field!(selph) else - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def set_field(values, value, ignore_nil_for_repeated, message_instance) if value.nil? && ignore_nil_for_repeated ::Protobuf.deprecator.deprecation_warning("['#{fully_qualified_name_string(selph)}']=nil", "use an empty array instead of nil") @@ -224,7 +228,7 @@ def set_field(values, value, ignore_nil_for_repeated, message_instance) def self.define_string_set_field!(selph) if selph.required? - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def set_field(values, value, ignore_nil_for_repeated, message_instance) if value.nil? values.delete(#{fully_qualified_name_string(selph)}) @@ -240,7 +244,7 @@ def set_field(values, value, ignore_nil_for_repeated, message_instance) end RUBY else - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def set_field(values, value, ignore_nil_for_repeated, message_instance) if value.nil? values.delete(#{fully_qualified_name_string(selph)}) @@ -258,7 +262,7 @@ def set_field(values, value, ignore_nil_for_repeated, message_instance) def self.define_base_set_field!(selph) if selph.required? - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def set_field(values, value, ignore_nil_for_repeated, message_instance) if value.nil? values.delete(#{fully_qualified_name_string(selph)}) @@ -270,7 +274,7 @@ def set_field(values, value, ignore_nil_for_repeated, message_instance) end RUBY else - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def set_field(values, value, ignore_nil_for_repeated, message_instance) if value.nil? values.delete(#{fully_qualified_name_string(selph)}) @@ -283,7 +287,7 @@ def set_field(values, value, ignore_nil_for_repeated, message_instance) end def self.define_base_field_and_present_p!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def field_and_present?(values) values[#{fully_qualified_name_string(selph)}].present? end @@ -291,7 +295,7 @@ def field_and_present?(values) end def self.define_bool_field_and_present_p!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 BOOL_VALUES = [true, false].freeze unless defined?(BOOL_VALUES) def field_and_present?(values) @@ -301,7 +305,7 @@ def field_and_present?(values) end def self.define_base_field_p!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def field?(values) values.key?(#{fully_qualified_name_string(selph)}) end @@ -309,7 +313,7 @@ def field?(values) end def self.define_repeated_field_p!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def field?(values) values.key?(#{fully_qualified_name_string(selph)}) && values[#{fully_qualified_name_string(selph)}].present? end @@ -317,7 +321,7 @@ def field?(values) end def self.define_bool_field_value_from_values!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def value_from_values(values) values.fetch(#{fully_qualified_name_string(selph)}) { default_value } end @@ -326,7 +330,7 @@ def value_from_values(values) end def self.define_field_value_from_values!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def value_from_values(values) values[#{fully_qualified_name_string(selph)}] || default_value end @@ -335,7 +339,7 @@ def value_from_values(values) end def self.define_map_value_from_values!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def value_from_values(values) values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldHash.new(self) end @@ -354,7 +358,7 @@ def value_from_values_for_serialization(values) end def self.define_repeated_value_from_values!(selph) - selph.instance_eval <<~RUBY, __FILE__, __LINE__ + 1 + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def value_from_values(values) values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldArray.new(self) end diff --git a/lib/protobuf/message/fields.rb b/lib/protobuf/message/fields.rb index 87793c5c..f3c51012 100644 --- a/lib/protobuf/message/fields.rb +++ b/lib/protobuf/message/fields.rb @@ -22,7 +22,7 @@ def inherited(subclass) inherit_fields!(subclass) subclass.const_set("PROTOBUF_MESSAGE_REQUIRED_FIELD_TAGS", subclass.required_field_tags) subclass.const_set("PROTOBUF_MESSAGE_GET_FIELD", subclass.field_store) - subclass.class_eval <<~RUBY, __FILE__, __LINE__ + subclass.class_eval <<-RUBY, __FILE__, __LINE__ def _protobuf_message_field PROTOBUF_MESSAGE_GET_FIELD end From e41fe3c0dce42f1c9528bf9c2a1bb723f0af6b9d Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Wed, 2 Jan 2019 13:30:12 -0700 Subject: [PATCH 28/93] remove empty string --- .../field/base_field_method_definitions.rb | 1 - varint_prof.rb | 22 +++++++++++++------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/lib/protobuf/field/base_field_method_definitions.rb b/lib/protobuf/field/base_field_method_definitions.rb index 069ee40e..0b2484dc 100644 --- a/lib/protobuf/field/base_field_method_definitions.rb +++ b/lib/protobuf/field/base_field_method_definitions.rb @@ -3,7 +3,6 @@ module Field class BaseFieldMethodDefinitions def self.fully_qualified_name_string(selph) - fully_qualified_name = "" fully_qualified_name << ":" fully_qualified_name << '"' if selph.fully_qualified_name.to_s.start_with?(".") fully_qualified_name << selph.fully_qualified_name.to_s diff --git a/varint_prof.rb b/varint_prof.rb index 056a1d96..dedf95a8 100644 --- a/varint_prof.rb +++ b/varint_prof.rb @@ -52,19 +52,27 @@ printer.printProfile(STDOUT) else TO_HASH = ::Test::Resource.new(:name => "derp", :date_created => 123456789) + ENCODE = ::Test::Resource.new(:name => "derp", :date_created => 123456789) + DECODE = begin + ss = StringIO.new + ::Protobuf::Encoder.encode(ENCODE.to_proto, ss) + ss.rewind + ss.string + end + Benchmark.ips do |x| x.config(:time => 20, :warmup => 10) - x.report("to_hash => true java") do + x.report("to_hash") do TO_HASH.to_hash end - x.report("to_proto => true java") do - t = ::Test::Resource.new(:name => "derp", :date_created => 123456789) - t.status = 3 + x.report("encode") do ss = StringIO.new - ::Protobuf::Encoder.encode(t.to_proto, ss) - ss.rewind - t2 = ::Test::Resource.decode_from(ss) + ::Protobuf::Encoder.encode(ENCODE.to_proto, ss) + end + + x.report("decode") do + ::Test::Resource.decode_from(::StringIO.new(DECODE.dup)) end end end From 964ab0ad9c995a2f33da85ed87cc5641aef57a47 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Fri, 4 Jan 2019 11:41:02 -0700 Subject: [PATCH 29/93] load protobuf helpers if present and use the java encode/decode and fix minor issues with perf in to_i enum and fix a typo --- lib/protobuf.rb | 14 +++++++++++ lib/protobuf/enum.rb | 13 ++++------ .../field/base_field_method_definitions.rb | 2 +- lib/protobuf/field/varint_field.rb | 25 ++----------------- lib/protobuf/message.rb | 10 -------- lib/protobuf/varint.rb | 11 ++++++++ lib/protobuf/varint_pure.rb | 18 +++++++++++++ 7 files changed, 51 insertions(+), 42 deletions(-) diff --git a/lib/protobuf.rb b/lib/protobuf.rb index 148b1170..a1300025 100644 --- a/lib/protobuf.rb +++ b/lib/protobuf.rb @@ -9,6 +9,20 @@ require 'active_support/inflector' require 'active_support/json' require 'active_support/notifications' +# Under MRI, this optimizes proto decoding by around 15% in tests. +# When unavailable, we fall to pure Ruby. +# rubocop:disable Lint/HandleExceptions +begin + require 'varint/varint' +rescue LoadError +end +# rubocop:enable Lint/HandleExceptions +# rubocop:disable Lint/HandleExceptions +begin + require 'protobuf_java_helpers' +rescue LoadError +end +# rubocop:enable Lint/HandleExceptions # All top-level run time code requires, ordered by necessity require 'protobuf/wire_type' diff --git a/lib/protobuf/enum.rb b/lib/protobuf/enum.rb index c38b216b..c0a2a809 100644 --- a/lib/protobuf/enum.rb +++ b/lib/protobuf/enum.rb @@ -313,10 +313,6 @@ def inspect "\#" end - def to_i - tag - end - def to_int tag.to_int end @@ -357,12 +353,13 @@ def try(*args, &block) end end - ::Protobuf.deprecator.define_deprecated_methods(self, :value => :to_i) - ## # Instance Aliases # - alias :to_hash_value to_i - alias :to_json_hash_value to_i + alias :to_i tag + alias :to_hash_value tag + alias :to_json_hash_value tag + + ::Protobuf.deprecator.define_deprecated_methods(self, :value => :to_i) end end diff --git a/lib/protobuf/field/base_field_method_definitions.rb b/lib/protobuf/field/base_field_method_definitions.rb index 0b2484dc..e9053919 100644 --- a/lib/protobuf/field/base_field_method_definitions.rb +++ b/lib/protobuf/field/base_field_method_definitions.rb @@ -3,7 +3,7 @@ module Field class BaseFieldMethodDefinitions def self.fully_qualified_name_string(selph) - fully_qualified_name << ":" + fully_qualified_name = ":" fully_qualified_name << '"' if selph.fully_qualified_name.to_s.start_with?(".") fully_qualified_name << selph.fully_qualified_name.to_s fully_qualified_name << '"' if selph.fully_qualified_name.to_s.start_with?(".") diff --git a/lib/protobuf/field/varint_field.rb b/lib/protobuf/field/varint_field.rb index 02a8cddc..3372094e 100644 --- a/lib/protobuf/field/varint_field.rb +++ b/lib/protobuf/field/varint_field.rb @@ -7,8 +7,6 @@ class VarintField < BaseField ## # Constants # - - CACHE_LIMIT = 2048 INT32_MAX = 2**31 - 1 INT32_MIN = -2**31 INT64_MAX = 2**63 - 1 @@ -24,27 +22,8 @@ def self.default 0 end - # Because all tags and enums are calculated as VarInt it is "most common" to have - # values < CACHE_LIMIT (low numbers) which is defaulting to 1024 - def self.cached_varint(value) - @_varint_cache ||= {} - (@_varint_cache[value] ||= encode(value, false)).dup - end - - def self.encode(value, use_cache = true) - return cached_varint(value) if use_cache && value >= 0 && value <= CACHE_LIMIT - - bytes = [] - until value < 128 - bytes << (0x80 | (value & 0x7f)) - value >>= 7 - end - (bytes << value).pack('C*') - end - - # Load the cache of VarInts on load of file - (0..CACHE_LIMIT).each do |cached_value| - cached_varint(cached_value) + def self.encode(value) + ::Protobuf::Varint.encode(value) end ## diff --git a/lib/protobuf/message.rb b/lib/protobuf/message.rb index d1db6551..cc73ff6d 100644 --- a/lib/protobuf/message.rb +++ b/lib/protobuf/message.rb @@ -1,15 +1,5 @@ require 'protobuf/message/fields' require 'protobuf/message/serialization' - -# Under MRI, this optimizes proto decoding by around 15% in tests. -# When unavailable, we fall to pure Ruby. -# rubocop:disable Lint/HandleExceptions -begin - require 'varint/varint' -rescue LoadError -end -# rubocop:enable Lint/HandleExceptions - require 'protobuf/varint' module Protobuf diff --git a/lib/protobuf/varint.rb b/lib/protobuf/varint.rb index fef5e953..be70cca3 100644 --- a/lib/protobuf/varint.rb +++ b/lib/protobuf/varint.rb @@ -2,6 +2,17 @@ module Protobuf class Varint if defined?(::Varint) extend ::Varint + + def self.encode(value) + bytes = [] + until value < 128 + bytes << (0x80 | (value & 0x7f)) + value >>= 7 + end + (bytes << value).pack('C*') + end + elsif defined?(::ProtobufJavaHelpers) + extend ::ProtobufJavaHelpers::EncodeDecode else extend VarintPure end diff --git a/lib/protobuf/varint_pure.rb b/lib/protobuf/varint_pure.rb index eeffbecc..6013241c 100644 --- a/lib/protobuf/varint_pure.rb +++ b/lib/protobuf/varint_pure.rb @@ -1,5 +1,12 @@ module Protobuf module VarintPure + CACHE_LIMIT = 2048 + + def cached_varint(value) + @_varint_cache ||= {} + (@_varint_cache[value] ||= encode(value, false)).dup + end + def decode(stream) value = index = 0 begin @@ -9,5 +16,16 @@ def decode(stream) end while (byte & 0x80).nonzero? value end + + def encode(value, use_cache = true) + return cached_varint(value) if use_cache && value >= 0 && value <= CACHE_LIMIT + + bytes = [] + until value < 128 + bytes << (0x80 | (value & 0x7f)) + value >>= 7 + end + (bytes << value).pack('C*') + end end end From 801553b026ce37134ee78b0afe930d20d240adfc Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Fri, 4 Jan 2019 12:03:29 -0700 Subject: [PATCH 30/93] fix some of our install and travis issues --- .travis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index f0153d97..f89eb2e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,8 +11,6 @@ before_install: - java -Xmx1g -version - javac -J-Xmx1g -version - export JRUBY_OPTS=-J-Xmx1g - # Required for rainbow installation issue, https://github.com/sickill/rainbow/issues/44 - - gem update --system - gem update bundler language: ruby rvm: @@ -20,10 +18,11 @@ rvm: - 2.0.0 - 2.1 - 2.2 - - 2.2.2 - 2.3 - 2.4 - - jruby-9.1.7.0 + - 2.5 + - jruby-9.1.17.0 + - jruby-9.2.5.0 - rbx-2 env: - PROTOBUF_VERSION=2.6.1 From a993f92125642126096a610e310cc032981b1c79 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Tue, 8 Jan 2019 13:36:56 -0700 Subject: [PATCH 31/93] change tags names to reflect only unset field tags --- lib/protobuf/field/base_field.rb | 1 - .../field/base_field_method_definitions.rb | 16 ++++++++-------- lib/protobuf/message.rb | 2 +- lib/protobuf/message/fields.rb | 4 ++-- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/lib/protobuf/field/base_field.rb b/lib/protobuf/field/base_field.rb index a219a462..f8dba7a3 100644 --- a/lib/protobuf/field/base_field.rb +++ b/lib/protobuf/field/base_field.rb @@ -69,7 +69,6 @@ def initialize(message_class, rule, type_class, fully_qualified_name, tag, simpl define_to_message_hash! define_encode_to_stream! set_default_value! - tag_encoded end ## diff --git a/lib/protobuf/field/base_field_method_definitions.rb b/lib/protobuf/field/base_field_method_definitions.rb index e9053919..afbae3cf 100644 --- a/lib/protobuf/field/base_field_method_definitions.rb +++ b/lib/protobuf/field/base_field_method_definitions.rb @@ -136,9 +136,9 @@ def set_field(values, value, ignore_nil_for_repeated, message_instance) if value.empty? values.delete(#{fully_qualified_name_string(selph)}) - message_instance._protobuf_message_required_field_tags << #{selph.tag} + message_instance._protobuf_message_unset_required_field_tags << #{selph.tag} else - message_instance._protobuf_message_required_field_tags.delete(#{selph.tag}) + message_instance._protobuf_message_unset_required_field_tags.delete(#{selph.tag}) values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldHash.new(self) values[#{fully_qualified_name_string(selph)}].replace(value) end @@ -184,9 +184,9 @@ def set_field(values, value, ignore_nil_for_repeated, message_instance) if value.empty? values.delete(#{fully_qualified_name_string(selph)}) - message_instance._protobuf_message_required_field_tags << #{selph.tag} + message_instance._protobuf_message_unset_required_field_tags << #{selph.tag} else - message_instance._protobuf_message_required_field_tags.delete(#{selph.tag}) + message_instance._protobuf_message_unset_required_field_tags.delete(#{selph.tag}) values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldArray.new(self) values[#{fully_qualified_name_string(selph)}].replace(value) end @@ -231,9 +231,9 @@ def self.define_string_set_field!(selph) def set_field(values, value, ignore_nil_for_repeated, message_instance) if value.nil? values.delete(#{fully_qualified_name_string(selph)}) - message_instance._protobuf_message_required_field_tags << #{selph.tag} + message_instance._protobuf_message_unset_required_field_tags << #{selph.tag} else - message_instance._protobuf_message_required_field_tags.delete(#{selph.tag}) + message_instance._protobuf_message_unset_required_field_tags.delete(#{selph.tag}) values[#{fully_qualified_name_string(selph)}] = if value.is_a?(String) value else @@ -265,9 +265,9 @@ def self.define_base_set_field!(selph) def set_field(values, value, ignore_nil_for_repeated, message_instance) if value.nil? values.delete(#{fully_qualified_name_string(selph)}) - message_instance._protobuf_message_required_field_tags << #{selph.tag} + message_instance._protobuf_message_unset_required_field_tags << #{selph.tag} else - message_instance._protobuf_message_required_field_tags.delete(#{selph.tag}) + message_instance._protobuf_message_unset_required_field_tags.delete(#{selph.tag}) values[#{fully_qualified_name_string(selph)}] = coerce!(value) end end diff --git a/lib/protobuf/message.rb b/lib/protobuf/message.rb index cc73ff6d..a57329dc 100644 --- a/lib/protobuf/message.rb +++ b/lib/protobuf/message.rb @@ -70,7 +70,7 @@ def each_field end def each_field_for_serialization - _protobuf_message_required_field_tags.each do |tag| + _protobuf_message_unset_required_field_tags.each do |tag| fail ::Protobuf::SerializationError, "Required field #{self.class.name}##{_protobuf_message_field[tag].name} does not have a value." end diff --git a/lib/protobuf/message/fields.rb b/lib/protobuf/message/fields.rb index f3c51012..d07e1eff 100644 --- a/lib/protobuf/message/fields.rb +++ b/lib/protobuf/message/fields.rb @@ -27,8 +27,8 @@ def _protobuf_message_field PROTOBUF_MESSAGE_GET_FIELD end - def _protobuf_message_required_field_tags - @_protobuf_message_required_field_tags ||= PROTOBUF_MESSAGE_REQUIRED_FIELD_TAGS.dup + def _protobuf_message_unset_required_field_tags + @_protobuf_message_unset_required_field_tags ||= PROTOBUF_MESSAGE_REQUIRED_FIELD_TAGS.dup end RUBY end From b05b1922439ec6010b9ec7699f8e25f7cf855c4d Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Mon, 14 Jan 2019 19:34:24 -0700 Subject: [PATCH 32/93] build a string keys version of to_hash for protobuf object --- lib/protobuf/field/base_field.rb | 2 ++ .../field/base_field_method_definitions.rb | 16 ++++++++++++++++ lib/protobuf/message.rb | 11 +++++++++++ varint_prof.rb | 4 ++++ 4 files changed, 33 insertions(+) diff --git a/lib/protobuf/field/base_field.rb b/lib/protobuf/field/base_field.rb index a219a462..ae076435 100644 --- a/lib/protobuf/field/base_field.rb +++ b/lib/protobuf/field/base_field.rb @@ -161,8 +161,10 @@ def define_set_field! def define_to_message_hash! if message? || enum? || repeated? || map? ::Protobuf::Field::BaseFieldMethodDefinitions.define_to_hash_value_to_message_hash!(self) + ::Protobuf::Field::BaseFieldMethodDefinitions.define_to_hash_value_to_message_hash_with_string_key!(self) else ::Protobuf::Field::BaseFieldMethodDefinitions.define_base_to_message_hash!(self) + ::Protobuf::Field::BaseFieldMethodDefinitions.define_base_to_message_hash_with_string_key!(self) end end diff --git a/lib/protobuf/field/base_field_method_definitions.rb b/lib/protobuf/field/base_field_method_definitions.rb index e9053919..6a79db7f 100644 --- a/lib/protobuf/field/base_field_method_definitions.rb +++ b/lib/protobuf/field/base_field_method_definitions.rb @@ -10,6 +10,22 @@ def self.fully_qualified_name_string(selph) fully_qualified_name end + def self.define_to_hash_value_to_message_hash_with_string_key!(selph) + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 + def to_message_hash_with_string_key(values, result) + result["#{selph.name}"] = value_from_values(values).to_hash_value + end + RUBY + end + + def self.define_base_to_message_hash_with_string_key!(selph) + selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 + def to_message_hash_with_string_key(values, result) + result["#{selph.name}"] = value_from_values(values) + end + RUBY + end + def self.define_to_hash_value_to_message_hash!(selph) selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 def to_message_hash(values, result) diff --git a/lib/protobuf/message.rb b/lib/protobuf/message.rb index cc73ff6d..b49214f0 100644 --- a/lib/protobuf/message.rb +++ b/lib/protobuf/message.rb @@ -122,6 +122,17 @@ def to_hash result end + def to_hash_with_string_keys + result = {} + + @values.each_key do |field_name| + field = _protobuf_message_field[field_name] + field.to_message_hash_with_string_key(@values, result) + end + + result + end + def to_json(options = {}) to_json_hash.to_json(options) end diff --git a/varint_prof.rb b/varint_prof.rb index dedf95a8..ddd9abbb 100644 --- a/varint_prof.rb +++ b/varint_prof.rb @@ -66,6 +66,10 @@ TO_HASH.to_hash end + x.report("to_hash_with_string_keys") do + TO_HASH.to_hash_with_string_keys + end + x.report("encode") do ss = StringIO.new ::Protobuf::Encoder.encode(ENCODE.to_proto, ss) From faaaca217d00b73e3c5ca68372aad5052f359d34 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Tue, 15 Jan 2019 13:33:14 -0700 Subject: [PATCH 33/93] remove all meta programming --- lib/protobuf/field/base_field.rb | 194 +- .../field/base_field_method_definitions.rb | 386 - .../field/base_field_object_definitions.rb | 504 ++ lib/protobuf/field/varint_field.rb | 14 +- profile.html | 6686 ++++++++--------- 5 files changed, 3682 insertions(+), 4102 deletions(-) delete mode 100644 lib/protobuf/field/base_field_method_definitions.rb create mode 100644 lib/protobuf/field/base_field_object_definitions.rb diff --git a/lib/protobuf/field/base_field.rb b/lib/protobuf/field/base_field.rb index 7054b2e4..66b5076b 100644 --- a/lib/protobuf/field/base_field.rb +++ b/lib/protobuf/field/base_field.rb @@ -1,7 +1,7 @@ require 'active_support/core_ext/hash/slice' require 'protobuf/field/field_array' require 'protobuf/field/field_hash' -require 'protobuf/field/base_field_method_definitions' +require 'protobuf/field/base_field_object_definitions' module Protobuf module Field @@ -12,7 +12,7 @@ class BaseField ## # Constants # - + OBJECT_MODULE = ::Protobuf::Field::BaseFieldObjectDefinitions PACKED_TYPES = [ ::Protobuf::WireType::VARINT, ::Protobuf::WireType::FIXED32, @@ -61,9 +61,20 @@ def initialize(message_class, rule, type_class, fully_qualified_name, tag, simpl define_accessor(simple_name, fully_qualified_name) if simple_name set_repeated_message! set_map! - define_hash_accessor_for_message! - define_field_p! - define_field_and_present_p! + @value_from_values = nil + @value_from_values_for_serialization = nil + @field_predicate = nil + @field_and_present_predicate = nil + @set_field = nil + @set_method = nil + @to_message_hash = nil + @to_message_hash_string_keys = nil + @encode_to_stream = nil + + define_value_from_values! + define_value_from_values_for_serialization! + define_field_predicate! + define_field_and_present_predicate! define_set_field! define_set_method! define_to_message_hash! @@ -104,69 +115,121 @@ def set_default_value! end def define_encode_to_stream! - if repeated? && packed? - ::Protobuf::Field::BaseFieldMethodDefinitions.define_repeated_packed_encode_to_stream_method!(self) - elsif repeated? - ::Protobuf::Field::BaseFieldMethodDefinitions.define_repeated_not_packed_encode_to_stream_method!(self) - elsif message? || type_class == ::Protobuf::Field::BytesField - ::Protobuf::Field::BaseFieldMethodDefinitions.define_bytes_encode_to_stream_method!(self) - elsif type_class == ::Protobuf::Field::StringField - ::Protobuf::Field::BaseFieldMethodDefinitions.define_string_encode_to_stream_method!(self) - else - ::Protobuf::Field::BaseFieldMethodDefinitions.define_base_encode_to_stream_method!(self) - end + @encode_to_stream = if repeated? && packed? + OBJECT_MODULE::RepeatedPackedEncodeToStream.new(self) + elsif repeated? + OBJECT_MODULE::RepeatedNotPackedEncodeToStream.new(self) + elsif message? || type_class == ::Protobuf::Field::BytesField + OBJECT_MODULE::BytesEncodeToStream.new(self) + elsif type_class == ::Protobuf::Field::StringField + OBJECT_MODULE::StringEncodeToStream.new(self) + else + OBJECT_MODULE::BaseEncodeToStream.new(self) + end + end + + def encode_to_stream(value, stream) + @encode_to_stream.call(value, stream) + end + + def define_field_predicate! + @field_predicate = if repeated? + OBJECT_MODULE::RepeatedFieldPredicate.new(self) + else + OBJECT_MODULE::BaseFieldPredicate.new(self) + end end - def define_field_p! - if repeated? - ::Protobuf::Field::BaseFieldMethodDefinitions.define_repeated_field_p!(self) - else - ::Protobuf::Field::BaseFieldMethodDefinitions.define_base_field_p!(self) - end + def field?(values) + @field_predicate.call(values) end - def define_field_and_present_p! - if type_class == ::Protobuf::Field::BoolField # boolean present check - ::Protobuf::Field::BaseFieldMethodDefinitions.define_bool_field_and_present_p!(self) - else - ::Protobuf::Field::BaseFieldMethodDefinitions.define_base_field_and_present_p!(self) - end + def define_field_and_present_predicate! + @field_and_present_predicate = if type_class == ::Protobuf::Field::BoolField # boolean present check + OBJECT_MODULE::BoolFieldAndPresentPredicate.new(self) + else + OBJECT_MODULE::BaseFieldAndPresentPredicate.new(self) + end end - def define_hash_accessor_for_message! - if map? - ::Protobuf::Field::BaseFieldMethodDefinitions.define_map_value_from_values!(self) - elsif repeated? - ::Protobuf::Field::BaseFieldMethodDefinitions.define_repeated_value_from_values!(self) - elsif type_class == ::Protobuf::Field::BoolField # boolean present check - ::Protobuf::Field::BaseFieldMethodDefinitions.define_bool_field_value_from_values!(self) - else - ::Protobuf::Field::BaseFieldMethodDefinitions.define_field_value_from_values!(self) - end + def field_and_present?(values) + @field_and_present_predicate.call(values) + end + + def define_value_from_values! + @value_from_values = if map? + OBJECT_MODULE::MapValueFromValues.new(self) + elsif repeated? + OBJECT_MODULE::RepeatedFieldValueFromValues.new(self) + elsif type_class == ::Protobuf::Field::BoolField # boolean present check + OBJECT_MODULE::BoolFieldValueFromValues.new(self) + else + OBJECT_MODULE::BaseFieldValueFromValues.new(self) + end + end + + def value_from_values(values) + @value_from_values.call(values) + end + + def define_value_from_values_for_serialization! + @value_from_values_for_serialization = if map? + OBJECT_MODULE::MapValueFromValuesForSerialization.new(self) + elsif repeated? + OBJECT_MODULE::RepeatedFieldValueFromValuesForSerialization.new(self) + elsif type_class == ::Protobuf::Field::BoolField # boolean present check + OBJECT_MODULE::BoolFieldValueFromValuesForSerialization.new(self) + else + OBJECT_MODULE::BaseFieldValueFromValuesForSerialization.new(self) + end + end + + def value_from_values_for_serialization(values) + @value_from_values_for_serialization.call(values) end def define_set_field! - if map? - ::Protobuf::Field::BaseFieldMethodDefinitions.define_map_set_field!(self) - elsif repeated? - ::Protobuf::Field::BaseFieldMethodDefinitions.define_repeated_set_field!(self) - elsif type_class == ::Protobuf::Field::StringField - ::Protobuf::Field::BaseFieldMethodDefinitions.define_string_set_field!(self) - else - ::Protobuf::Field::BaseFieldMethodDefinitions.define_base_set_field!(self) - end + @set_field = if map? && required? + OBJECT_MODULE::RequiredMapSetField.new(self) + elsif repeated? && required? + OBJECT_MODULE::RequiredRepeatedSetField.new(self) + elsif type_class == ::Protobuf::Field::StringField && required? + OBJECT_MODULE::RequiredStringSetField.new(self) + elsif required? + OBJECT_MODULE::RequiredBaseSetField.new(self) + elsif map? + OBJECT_MODULE::MapSetField.new(self) + elsif repeated? + OBJECT_MODULE::RepeatedSetField.new(self) + elsif type_class == ::Protobuf::Field::StringField + OBJECT_MODULE::StringSetField.new(self) + else + OBJECT_MODULE::BaseSetField.new(self) + end + end + + def set_field(values, value, ignore_nil_for_repeated, message_instance) + @set_field.call(values, value, ignore_nil_for_repeated, message_instance) end def define_to_message_hash! if message? || enum? || repeated? || map? - ::Protobuf::Field::BaseFieldMethodDefinitions.define_to_hash_value_to_message_hash!(self) - ::Protobuf::Field::BaseFieldMethodDefinitions.define_to_hash_value_to_message_hash_with_string_key!(self) + @to_message_hash = OBJECT_MODULE::ToHashValueToMessageHash.new(self) + @to_message_hash_string_keys = OBJECT_MODULE::ToHashValueToMessageHashWithStringKey.new(self) else - ::Protobuf::Field::BaseFieldMethodDefinitions.define_base_to_message_hash!(self) - ::Protobuf::Field::BaseFieldMethodDefinitions.define_base_to_message_hash_with_string_key!(self) + @to_message_hash = OBJECT_MODULE::BaseToMessageHash.new(self) + @to_message_hash_string_keys = OBJECT_MODULE::BaseToMessageHashWithStringKey.new(self) end end + def to_message_hash(values, result) + @to_message_hash.call(values, result) + end + + def to_message_hash_with_string_key(values, result) + @to_message_hash_string_keys.call(values, result) + end + def deprecated? @deprecated end @@ -221,15 +284,19 @@ def required? end def define_set_method! - if map? - ::Protobuf::Field::BaseFieldMethodDefinitions.define_map_set_method!(self) - elsif repeated? && packed? - ::Protobuf::Field::BaseFieldMethodDefinitions.define_repeated_packed_set_method!(self) - elsif repeated? - ::Protobuf::Field::BaseFieldMethodDefinitions.define_repeated_not_packed_set_method!(self) - else - ::Protobuf::Field::BaseFieldMethodDefinitions.define_base_set_method!(self) - end + @set_method = if map? + OBJECT_MODULE::MapSetMethod.new(self) + elsif repeated? && packed? + OBJECT_MODULE::RepeatedPackedSetMethod.new(self) + elsif repeated? + OBJECT_MODULE::RepeatedNotPackedSetMethod.new(self) + else + OBJECT_MODULE::BaseSetMethod.new(self) + end + end + + def set(message_instance, bytes) + @set_method.call(message_instance, bytes) end def tag_encoded @@ -260,9 +327,10 @@ def fully_qualified_name_only! ## # Recreate all of the meta methods as they may have used the original `name` value # - define_hash_accessor_for_message! - define_field_p! - define_field_and_present_p! + define_value_from_values! + define_value_from_values_for_serialization! + define_field_predicate! + define_field_and_present_predicate! define_set_field! define_set_method! define_to_message_hash! diff --git a/lib/protobuf/field/base_field_method_definitions.rb b/lib/protobuf/field/base_field_method_definitions.rb deleted file mode 100644 index 5c4c9f9a..00000000 --- a/lib/protobuf/field/base_field_method_definitions.rb +++ /dev/null @@ -1,386 +0,0 @@ -module Protobuf - module Field - class BaseFieldMethodDefinitions - - def self.fully_qualified_name_string(selph) - fully_qualified_name = ":" - fully_qualified_name << '"' if selph.fully_qualified_name.to_s.start_with?(".") - fully_qualified_name << selph.fully_qualified_name.to_s - fully_qualified_name << '"' if selph.fully_qualified_name.to_s.start_with?(".") - fully_qualified_name - end - - def self.define_to_hash_value_to_message_hash_with_string_key!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def to_message_hash_with_string_key(values, result) - result["#{selph.name}"] = value_from_values(values).to_hash_value - end - RUBY - end - - def self.define_base_to_message_hash_with_string_key!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def to_message_hash_with_string_key(values, result) - result["#{selph.name}"] = value_from_values(values) - end - RUBY - end - - def self.define_to_hash_value_to_message_hash!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def to_message_hash(values, result) - result[#{selph.name.inspect}] = value_from_values(values).to_hash_value - end - RUBY - end - - def self.define_base_to_message_hash!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def to_message_hash(values, result) - result[#{selph.name.inspect}] = value_from_values(values) - end - RUBY - end - - def self.define_repeated_packed_encode_to_stream_method!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def encode_to_stream(value, stream) - packed_value = value.map { |val| encode(val) }.join - stream << #{selph.tag_encoded.dump} << "\#{::Protobuf::Field::VarintField.encode(packed_value.size)}\#{packed_value}" - end - RUBY - end - - def self.define_bytes_encode_to_stream_method!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def encode_to_stream(value, stream) - value = value.encode if value.is_a?(::Protobuf::Message) - byte_size = ::Protobuf::Field::VarintField.encode(value.bytesize) - - stream << #{selph.tag_encoded.dump} << byte_size << value - end - RUBY - end - - def self.define_string_encode_to_stream_method!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def encode_to_stream(value, stream) - new_value = "" + value - if new_value.encoding != ::Protobuf::Field::StringField::ENCODING - new_value.encode!(::Protobuf::Field::StringField::ENCODING, :invalid => :replace, :undef => :replace, :replace => "") - end - - stream << #{selph.tag_encoded.dump} << ::Protobuf::Field::VarintField.encode(new_value.bytesize) << new_value - end - RUBY - end - - def self.define_base_encode_to_stream_method!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def encode_to_stream(value, stream) - stream << #{selph.tag_encoded.dump} << encode(value) - end - RUBY - end - - def self.define_repeated_not_packed_encode_to_stream_method!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def encode_to_stream(value, stream) - value.each do |val| - stream << #{selph.tag_encoded.dump} << encode(val) - end - end - RUBY - end - - def self.define_base_set_method!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def set(message_instance, bytes) - message_instance.set_field("#{selph.name}", decode(bytes), true, self) - end - RUBY - end - - def self.define_map_set_method!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def set(message_instance, bytes) - hash = message_instance["#{selph.name}"] - entry = decode(bytes) - # decoded value could be nil for an - # enum value that is not recognized - hash[entry.key] = entry.value unless entry.value.nil? - hash[entry.key] - end - RUBY - end - - def self.define_repeated_not_packed_set_method!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def set(message_instance, bytes) - message_instance["#{selph.name}"] << decode(bytes) - end - RUBY - end - - def self.define_repeated_packed_set_method!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def set(message_instance, bytes) - array = message_instance["#{selph.name}"] - stream = ::StringIO.new(bytes) - - if wire_type == ::Protobuf::WireType::VARINT - array << decode(Varint.decode(stream)) until stream.eof? - elsif wire_type == ::Protobuf::WireType::FIXED64 - array << decode(stream.read(8)) until stream.eof? - elsif wire_type == ::Protobuf::WireType::FIXED32 - array << decode(stream.read(4)) until stream.eof? - end - end - RUBY - end - - def self.define_map_set_field!(selph) - if selph.required? - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def set_field(values, value, ignore_nil_for_repeated, message_instance) - unless value.is_a?(Hash) - fail TypeError, <<-TYPE_ERROR - Expected map value - Got '\#{value.class}' for map protobuf field #{selph.name} - TYPE_ERROR - end - - if value.empty? - values.delete(#{fully_qualified_name_string(selph)}) - message_instance._protobuf_message_unset_required_field_tags << #{selph.tag} - else - message_instance._protobuf_message_unset_required_field_tags.delete(#{selph.tag}) - values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldHash.new(self) - values[#{fully_qualified_name_string(selph)}].replace(value) - end - end - RUBY - else - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def set_field(values, value, ignore_nil_for_repeated, message_instance) - unless value.is_a?(Hash) - fail TypeError, <<-TYPE_ERROR - Expected map value - Got '\#{value.class}' for map protobuf field #{selph.name} - TYPE_ERROR - end - - if value.empty? - values.delete(#{fully_qualified_name_string(selph)}) - else - values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldHash.new(self) - values[#{fully_qualified_name_string(selph)}].replace(value) - end - end - RUBY - end - end - - def self.define_required_repeated_set_field!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def set_field(values, value, ignore_nil_for_repeated, message_instance) - if value.nil? && ignore_nil_for_repeated - ::Protobuf.deprecator.deprecation_warning("['#{fully_qualified_name_string(selph)}']=nil", "use an empty array instead of nil") - return - end - - unless value.is_a?(Array) - fail TypeError, <<-TYPE_ERROR - Expected repeated value of type '#{selph.type_class}' - Got '\#{value.class}' for repeated protobuf field #{selph.name} - TYPE_ERROR - end - - value = value.compact - - if value.empty? - values.delete(#{fully_qualified_name_string(selph)}) - message_instance._protobuf_message_unset_required_field_tags << #{selph.tag} - else - message_instance._protobuf_message_unset_required_field_tags.delete(#{selph.tag}) - values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldArray.new(self) - values[#{fully_qualified_name_string(selph)}].replace(value) - end - end - RUBY - end - - def self.define_repeated_set_field!(selph) - if selph.required? - define_required_repeated_set_field!(selph) - else - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def set_field(values, value, ignore_nil_for_repeated, message_instance) - if value.nil? && ignore_nil_for_repeated - ::Protobuf.deprecator.deprecation_warning("['#{fully_qualified_name_string(selph)}']=nil", "use an empty array instead of nil") - return - end - - unless value.is_a?(Array) - fail TypeError, <<-TYPE_ERROR - Expected repeated value of type '#{selph.type_class}' - Got '\#{value.class}' for repeated protobuf field #{selph.name} - TYPE_ERROR - end - - value = value.compact - - if value.empty? - values.delete(#{fully_qualified_name_string(selph)}) - else - values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldArray.new(self) - values[#{fully_qualified_name_string(selph)}].replace(value) - end - end - RUBY - end - end - - def self.define_string_set_field!(selph) - if selph.required? - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def set_field(values, value, ignore_nil_for_repeated, message_instance) - if value.nil? - values.delete(#{fully_qualified_name_string(selph)}) - message_instance._protobuf_message_unset_required_field_tags << #{selph.tag} - else - message_instance._protobuf_message_unset_required_field_tags.delete(#{selph.tag}) - values[#{fully_qualified_name_string(selph)}] = if value.is_a?(String) - value - else - coerce!(value) - end - end - end - RUBY - else - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def set_field(values, value, ignore_nil_for_repeated, message_instance) - if value.nil? - values.delete(#{fully_qualified_name_string(selph)}) - else - values[#{fully_qualified_name_string(selph)}] = if value.is_a?(String) - value - else - coerce!(value) - end - end - end - RUBY - end - end - - def self.define_base_set_field!(selph) - if selph.required? - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def set_field(values, value, ignore_nil_for_repeated, message_instance) - if value.nil? - values.delete(#{fully_qualified_name_string(selph)}) - message_instance._protobuf_message_unset_required_field_tags << #{selph.tag} - else - message_instance._protobuf_message_unset_required_field_tags.delete(#{selph.tag}) - values[#{fully_qualified_name_string(selph)}] = coerce!(value) - end - end - RUBY - else - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def set_field(values, value, ignore_nil_for_repeated, message_instance) - if value.nil? - values.delete(#{fully_qualified_name_string(selph)}) - else - values[#{fully_qualified_name_string(selph)}] = coerce!(value) - end - end - RUBY - end - end - - def self.define_base_field_and_present_p!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def field_and_present?(values) - values[#{fully_qualified_name_string(selph)}].present? - end - RUBY - end - - def self.define_bool_field_and_present_p!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - BOOL_VALUES = [true, false].freeze unless defined?(BOOL_VALUES) - - def field_and_present?(values) - BOOL_VALUES.include?(values[#{fully_qualified_name_string(selph)}]) - end - RUBY - end - - def self.define_base_field_p!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def field?(values) - values.key?(#{fully_qualified_name_string(selph)}) - end - RUBY - end - - def self.define_repeated_field_p!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def field?(values) - values.key?(#{fully_qualified_name_string(selph)}) && values[#{fully_qualified_name_string(selph)}].present? - end - RUBY - end - - def self.define_bool_field_value_from_values!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def value_from_values(values) - values.fetch(#{fully_qualified_name_string(selph)}) { default_value } - end - alias :value_from_values_for_serialization value_from_values - RUBY - end - - def self.define_field_value_from_values!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def value_from_values(values) - values[#{fully_qualified_name_string(selph)}] || default_value - end - alias :value_from_values_for_serialization value_from_values - RUBY - end - - def self.define_map_value_from_values!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def value_from_values(values) - values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldHash.new(self) - end - - def value_from_values_for_serialization(values) - value = value_from_values(values) - - array = [] - value.each do |k, v| - array << type_class.new(:key => k, :value => v) - end - - array - end - RUBY - end - - def self.define_repeated_value_from_values!(selph) - selph.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 - def value_from_values(values) - values[#{fully_qualified_name_string(selph)}] ||= ::Protobuf::Field::FieldArray.new(self) - end - alias :value_from_values_for_serialization value_from_values - RUBY - end - - end - end -end diff --git a/lib/protobuf/field/base_field_object_definitions.rb b/lib/protobuf/field/base_field_object_definitions.rb new file mode 100644 index 00000000..93a93226 --- /dev/null +++ b/lib/protobuf/field/base_field_object_definitions.rb @@ -0,0 +1,504 @@ +module Protobuf + module Field + module BaseFieldObjectDefinitions + + class ToHashValueToMessageHashWithStringKey + def initialize(selph) + @selph = selph + @name = selph.name.to_s + end + + def call(values, result) + result[@name] = @selph.value_from_values(values).to_hash_value + end + end + + class BaseToMessageHashWithStringKey + def initialize(selph) + @selph = selph + @name = selph.name.to_s + end + + def call(values, result) + result[@name] = @selph.value_from_values(values) + end + end + + class ToHashValueToMessageHash + def initialize(selph) + @selph = selph + @name = selph.name.to_sym + end + + def call(values, result) + result[@name] = @selph.value_from_values(values).to_hash_value + end + end + + class BaseToMessageHash + def initialize(selph) + @selph = selph + @name = selph.name.to_sym + end + + def call(values, result) + result[@name] = @selph.value_from_values(values) + end + end + + class RepeatedPackedEncodeToStream + def initialize(selph) + @selph = selph + @tag_encoded = selph.tag_encoded + end + + def call(value, stream) + packed_value = value.map { |val| @selph.encode(val) }.join + stream << @tag_encoded << "#{::Protobuf::Field::VarintField.encode(packed_value.size)}#{packed_value}" + end + end + + class BytesEncodeToStream + def initialize(selph) + @selph = selph + @tag_encoded = selph.tag_encoded + end + + def call(value, stream) + value = value.encode if value.is_a?(::Protobuf::Message) + byte_size = ::Protobuf::Field::VarintField.encode(value.bytesize) + + stream << @tag_encoded << byte_size << value + end + end + + class StringEncodeToStream + def initialize(selph) + @selph = selph + @tag_encoded = selph.tag_encoded + end + + def call(value, stream) + new_value = "" + value + if new_value.encoding != ::Protobuf::Field::StringField::ENCODING + new_value.encode!(::Protobuf::Field::StringField::ENCODING, :invalid => :replace, :undef => :replace, :replace => "") + end + + stream << @tag_encoded << ::Protobuf::Field::VarintField.encode(new_value.bytesize) << new_value + end + end + + class BaseEncodeToStream + def initialize(selph) + @selph = selph + @tag_encoded = selph.tag_encoded + end + + def call(value, stream) + stream << @tag_encoded << @selph.encode(value) + end + end + + class RepeatedNotPackedEncodeToStream + def initialize(selph) + @selph = selph + @tag_encoded = selph.tag_encoded + end + + def call(value, stream) + value.each do |val| + stream << @tag_encoded << @selph.encode(val) + end + end + end + + class BaseSetMethod + def initialize(selph) + @selph = selph + @name = selph.name + end + + def call(message_instance, bytes) + message_instance.set_field(@name, @selph.decode(bytes), true, @selph) + end + end + + class MapSetMethod + def initialize(selph) + @selph = selph + @name = selph.name + end + + def call(message_instance, bytes) + hash = message_instance[@name] + entry = @selph.decode(bytes) + # decoded value could be nil for an + # enum value that is not recognized + hash[entry.key] = entry.value unless entry.value.nil? + hash[entry.key] + end + end + + class RepeatedNotPackedSetMethod + def initialize(selph) + @selph = selph + @name = selph.name + end + + def call(message_instance, bytes) + message_instance[@name] << @selph.decode(bytes) + end + end + + class RepeatedPackedSetMethod + def initialize(selph) + @selph = selph + @name = selph.name + @wire_type = selph.wire_type + end + + def call(message_instance, bytes) + array = message_instance[@name] + stream = ::StringIO.new(bytes) + + if @wire_type == ::Protobuf::WireType::VARINT + array << @selph.decode(Varint.decode(stream)) until stream.eof? + elsif @wire_type == ::Protobuf::WireType::FIXED64 + array << @selph.decode(stream.read(8)) until stream.eof? + elsif @wire_type == ::Protobuf::WireType::FIXED32 + array << @selph.decode(stream.read(4)) until stream.eof? + end + end + end + + class RequiredMapSetField + def initialize(selph) + @selph = selph + @tag = selph.tag + @fully_qualified_name = selph.fully_qualified_name + end + + def call(values, value, _ignore_nil_for_repeated, message_instance) + unless value.is_a?(Hash) + fail TypeError, <<-TYPE_ERROR + Expected map value + Got '#{value.class}' for map protobuf field #{@selph.name} + TYPE_ERROR + end + + if value.empty? + values.delete(@fully_qualified_name) + message_instance._protobuf_message_unset_required_field_tags << @tag + else + message_instance._protobuf_message_unset_required_field_tags.delete(@tag) + values[@fully_qualified_name] ||= ::Protobuf::Field::FieldHash.new(@selph) + values[@fully_qualified_name].replace(value) + end + end + end + + class MapSetField + def initialize(selph) + @selph = selph + @tag = selph.tag + @fully_qualified_name = selph.fully_qualified_name + end + + def call(values, value, _ignore_nil_for_repeated, _message_instance) + unless value.is_a?(Hash) + fail TypeError, <<-TYPE_ERROR + Expected map value + Got '#{value.class}' for map protobuf field #{@selph.name} + TYPE_ERROR + end + + if value.empty? + values.delete(@fully_qualified_name) + else + values[@fully_qualified_name] ||= ::Protobuf::Field::FieldHash.new(@selph) + values[@fully_qualified_name].replace(value) + end + end + end + + class RequiredRepeatedSetField + def initialize(selph) + @selph = selph + @tag = selph.tag + @fully_qualified_name = selph.fully_qualified_name + end + + def call(values, value, ignore_nil_for_repeated, message_instance) + if value.nil? && ignore_nil_for_repeated + ::Protobuf.deprecator.deprecation_warning("['#{@fully_qualified_name}']=nil", "use an empty array instead of nil") + return + end + + unless value.is_a?(Array) + fail TypeError, <<-TYPE_ERROR + Expected repeated value of type '#{@selph.type_class}' + Got '#{value.class}' for repeated protobuf field #{@selph.name} + TYPE_ERROR + end + + value = value.compact + + if value.empty? + values.delete(@fully_qualified_name) + message_instance._protobuf_message_unset_required_field_tags << @tag + else + message_instance._protobuf_message_unset_required_field_tags.delete(@tag) + values[@fully_qualified_name] ||= ::Protobuf::Field::FieldArray.new(@selph) + values[@fully_qualified_name].replace(value) + end + end + end + + class RepeatedSetField + def initialize(selph) + @selph = selph + @tag = selph.tag + @fully_qualified_name = selph.fully_qualified_name + end + + def call(values, value, ignore_nil_for_repeated, _message_instance) + if value.nil? && ignore_nil_for_repeated + ::Protobuf.deprecator.deprecation_warning("['#{@fully_qualified_name}']=nil", "use an empty array instead of nil") + return + end + + unless value.is_a?(Array) + fail TypeError, <<-TYPE_ERROR + Expected repeated value of type '#{@selph.type_class}' + Got '#{value.class}' for repeated protobuf field #{@selph.name} + TYPE_ERROR + end + + value = value.compact + + if value.empty? + values.delete(@fully_qualified_name) + else + values[@fully_qualified_name] ||= ::Protobuf::Field::FieldArray.new(@selph) + values[@fully_qualified_name].replace(value) + end + end + end + + class RequiredStringSetField + def initialize(selph) + @selph = selph + @tag = selph.tag + @fully_qualified_name = selph.fully_qualified_name + end + + def call(values, value, _ignore_nil_for_repeated, message_instance) + if value + message_instance._protobuf_message_unset_required_field_tags.delete(@tag) + values[@fully_qualified_name] = if value.is_a?(String) + value + else + @selph.coerce!(value) + end + else + values.delete(@fully_qualified_name) + message_instance._protobuf_message_unset_required_field_tags << @tag + end + end + end + + class StringSetField + def initialize(selph) + @selph = selph + @tag = selph.tag + @fully_qualified_name = selph.fully_qualified_name + end + + def call(values, value, _ignore_nil_for_repeated, _message_instance) + if value + values[@fully_qualified_name] = if value.is_a?(String) + value + else + @selph.coerce!(value) + end + else + values.delete(@fully_qualified_name) + end + end + end + + class RequiredBaseSetField + def initialize(selph) + @selph = selph + @tag = selph.tag + @fully_qualified_name = selph.fully_qualified_name + end + + def call(values, value, _ignore_nil_for_repeated, message_instance) + if value.nil? + values.delete(@fully_qualified_name) + message_instance._protobuf_message_unset_required_field_tags << @tag + else + message_instance._protobuf_message_unset_required_field_tags.delete(@tag) + values[@fully_qualified_name] = @selph.coerce!(value) + end + end + end + + class BaseSetField + def initialize(selph) + @selph = selph + @tag = selph.tag + @fully_qualified_name = selph.fully_qualified_name + end + + def call(values, value, _ignore_nil_for_repeated, _message_instance) + if value.nil? + values.delete(@fully_qualified_name) + else + values[@fully_qualified_name] = @selph.coerce!(value) + end + end + end + + class BaseFieldAndPresentPredicate + def initialize(selph) + @fully_qualified_name = selph.fully_qualified_name + end + + def call(values) + values[@fully_qualified_name].present? + end + end + + class BoolFieldAndPresentPredicate + BOOL_VALUES = [true, false].freeze + + def initialize(selph) + @fully_qualified_name = selph.fully_qualified_name + end + + def call(values) + BOOL_VALUES.include?(values[@fully_qualified_name]) + end + end + + class BaseFieldPredicate + def initialize(selph) + @fully_qualified_name = selph.fully_qualified_name + end + + def call(values) + values.key?(@fully_qualified_name) + end + end + + class RepeatedFieldPredicate + def initialize(selph) + @fully_qualified_name = selph.fully_qualified_name + end + + def call(values) + values.key?(@fully_qualified_name) && + values[@fully_qualified_name].present? + end + end + + class BoolFieldValueFromValues + def initialize(selph) + @selph = selph + @fully_qualified_name = selph.fully_qualified_name + end + + def call(values) + values.fetch(@fully_qualified_name) { @selph.default_value } + end + end + + class BoolFieldValueFromValuesForSerialization + def initialize(selph) + @selph = selph + @fully_qualified_name = selph.fully_qualified_name + end + + def call(values) + values.fetch(@fully_qualified_name) { @selph.default_value } + end + end + + class BaseFieldValueFromValues + def initialize(selph) + @selph = selph + @fully_qualified_name = selph.fully_qualified_name + end + + def call(values) + values[@fully_qualified_name] || @selph.default_value + end + end + + class BaseFieldValueFromValuesForSerialization + def initialize(selph) + @selph = selph + @fully_qualified_name = selph.fully_qualified_name + end + + def call(values) + values[@fully_qualified_name] || @selph.default_value + end + end + + class MapValueFromValues + def initialize(selph) + @selph = selph + @fully_qualified_name = selph.fully_qualified_name + end + + def call(values) + values[@fully_qualified_name] ||= ::Protobuf::Field::FieldHash.new(@selph) + end + end + + class MapValueFromValuesForSerialization + def initialize(selph) + @selph = selph + @fully_qualified_name = selph.fully_qualified_name + @type_class = selph.type_class + end + + def call(values) + value = values[@fully_qualified_name] ||= ::Protobuf::Field::FieldHash.new(@selph) + + array = [] + value.each do |k, v| + array << @type_class.new(:key => k, :value => v) + end + + array + end + end + + class RepeatedFieldValueFromValues + def initialize(selph) + @selph = selph + @fully_qualified_name = selph.fully_qualified_name + end + + def call(values) + values[@fully_qualified_name] ||= ::Protobuf::Field::FieldArray.new(@selph) + end + end + + class RepeatedFieldValueFromValuesForSerialization + def initialize(selph) + @selph = selph + @fully_qualified_name = selph.fully_qualified_name + end + + def call(values) + values[@fully_qualified_name] ||= ::Protobuf::Field::FieldArray.new(@selph) + end + end + end + end +end diff --git a/lib/protobuf/field/varint_field.rb b/lib/protobuf/field/varint_field.rb index 3372094e..0a183f0f 100644 --- a/lib/protobuf/field/varint_field.rb +++ b/lib/protobuf/field/varint_field.rb @@ -45,9 +45,17 @@ def acceptable?(val) end def coerce!(val) - fail TypeError, "Expected value of type '#{type_class}' for field #{name}, but got '#{val.class}'" unless acceptable?(val) - return val.to_i if val.is_a?(Numeric) - Integer(val, 10) + if val.is_a?(Integer) && val >= 0 && val <= INT32_MAX + val + else + fail TypeError, "Expected value of type '#{type_class}' for field #{name}, but got '#{val.class}'" unless acceptable?(val) + + if val.is_a?(Integer) || val.is_a?(Numeric) + val.to_i + else + Integer(val, 10) + end + end rescue ArgumentError fail TypeError, "Expected value of type '#{type_class}' for field #{name}, but got '#{val.class}'" end diff --git a/profile.html b/profile.html index cdc0569d..6ac4b900 100644 --- a/profile.html +++ b/profile.html @@ -52,7 +52,7 @@

Profile Report: main

-

Total time: 63.34

+

Total time: 123.51

%Total
100% 0%63.2263.34 0.0063.2263.34 0 (top)
60.08 1/1 Benchmark::IPS.ips
1.050.95 0.001.052/1150.952/112 Kernel.require
0.910.000.916/1886Kernel.require0.900.040.861/5##times
0.650.040.611/5##times0.890.000.896/1865Kernel.require
0.52 17/19 Kernel.load
0.120.000.121/1292879Gem::Specification.each_gemspec0.900.040.861/5(top)
0.2360.08 0.000.2219/1292879Kernel.require60.082/5Benchmark::IPS::Job#run
96%0%61.000.0560.955##times
40.080.0040.081/1Benchmark::IPS::Job#run_benchmark
20.001.7718.241/12928790.0020.001/1 Benchmark::IPS::Job#run_warmup
40.080.42 0.0140.071/1292879Benchmark::IPS::Job#run_benchmark
96%2%60.851.8159.041292879##each0.4210000/761459Protobuf::Message::Serialization::ClassMethods.decode_from
57.023.0653.963681351/3681351Benchmark::IPS::Job::Entry#call_times0.270.010.2610000/761459Protobuf::Encoder.encode
0.950.470.493681900/3681900Benchmark::Timing.now0.110.000.1010000/1524359Class#new
0.170.170.12 0.003681355/3681355##<0.121/762970##flat_map
0.140.00 0.141/762970Gem::Specification.each_gemspec
0.23 0.003681365/18790704##+0.2319/762970Kernel.require
0.650.040.611/5(top)20.001.6918.321/762970Benchmark::IPS::Job#run_warmup
60.0840.08 0.0060.082/5Benchmark::IPS::Job#run40.071/762970Benchmark::IPS::Job#run_benchmark
96%0%60.760.0660.705##times2%60.891.7259.17762970##each
40.0857.312.6854.623368410/3368410Benchmark::IPS::Job::Entry#call_times
0.740.310.443368939/3368939Benchmark::Timing.now
0.180.18 0.0040.081/1Benchmark::IPS::Job#run_benchmark3368414/3368414##<
20.000.140.14 0.0020.001/1Benchmark::IPS::Job#run_warmup3368424/23728693##+
0.290.12 0.000.2810000/1291320Protobuf::Message::Serialization::ClassMethods.decode_from0.122/3Gem::Specification.gemspec_stubs_in
0.190.010.1810000/1291320Protobuf::Encoder.encode0.110.000.1013/14Gem::Specification.load
(top)
95%94% 0% 60.08 0.00 1 Benchmark::IPS.ips
60.08 1/1 Benchmark::IPS::Job#run
Benchmark::IPS.ips
95%94% 0% 60.08 0.00 1 Benchmark::IPS::Job#run
60.08 0.00 60.08 2/5##times##times
57.023.0653.963681351/3681351##each57.312.6854.623368410/3368410##each
90% 4%57.023.0653.96368135157.312.6854.623368410 Benchmark::IPS::Job::Entry#call_times
52.582.3150.2615108256/1510880453.422.1651.2613506055/13506589 Proc#call
0.710.710.650.65 0.0018789607/18789624##<16874465/19924325##<
0.670.670.560.56 0.0015108256/18790704##+13506055/23728693##+
52.582.3150.2615108256/1510880453.422.1651.2613506055/13506589 Benchmark::IPS::Job::Entry#call_times
83%84% 3%52.612.3250.291510880453.452.1751.2813506589 Proc#call
22.112.3719.7413826936/1382693622.462.3520.1112754596/12754596 Protobuf::Message#to_hash
12.920.3312.591281320/129132015.050.2014.85751459/761459 Protobuf::Message::Serialization::ClassMethods.decode_from
9.100.358.751281320/12913208.850.278.58751459/761459 Protobuf::Encoder.encode
3.530.173.361281320/25841643.220.123.09751459/1524359 Class#new
2.170.311.871281320/12913201.360.211.15751459/761459 Test::Resource#status=
0.280.170.20 0.111281320/12913200.09751459/761459 StringIO.new
0.110.110.001281320/1291320Protobuf::Message#to_proto
0.00 40.08 1/1##times##times
63% 1 Benchmark::IPS::Job#run_benchmark
40.080.010.00 40.071/1292879##each1/762970##each
8.231.646.601291320/151182578.371.057.32761459/13516056 Protobuf::Message#each_field_for_serialization
19.745.9313.8113826936/1511825720.115.3814.7312754596/13516056 Protobuf::Message#to_hash
44%11%27.987.5720.4115118257##each_key10%28.486.4322.0413516056##each_key
5.462.323.1513826936/138269365.572.243.3312754596/12754596 Protobuf::Field::StringField(singleton)#to_message_hash
5.342.273.0613826936/138269365.182.133.0412754596/12754596 Protobuf::Field::Int64Field(singleton)#to_message_hash
2.300.741.571291320/1291320Protobuf::Field::StringField(singleton)#encode_to_stream2.590.212.38761459/761459Protobuf::Field::Int64Field(singleton)#encode_to_stream
1.991.992.422.42 0.0031527832/73391217##[]27793569/32362325Protobuf::Message#_protobuf_message_field
1.551.552.012.01 0.0031527832/39275754Test::Resource#_protobuf_message_field27793569/63970204##[]
1.440.321.121291320/1291320Protobuf::Field::EnumField(singleton)#encode_to_stream1.890.511.38761459/761459Protobuf::Field::StringField(singleton)#encode_to_stream
1.180.320.861291320/1291320Protobuf::Field::Int64Field(singleton)#encode_to_stream1.660.211.46761459/761459Protobuf::Field::EnumField(singleton)#encode_to_stream
0.410.110.301291320/164095760.260.070.19761459/14277514 Protobuf::Field::StringField(singleton)#value_from_values
0.370.110.271291320/2582640Protobuf::Field::EnumField(singleton)#value_from_values0.250.070.18761459/14277514Protobuf::Field::Int64Field(singleton)#value_from_values
0.360.110.261291320/16409576Protobuf::Field::Int64Field(singleton)#value_from_values0.230.070.16761459/1522918Protobuf::Field::EnumField(singleton)#value_from_values
22.112.3719.7413826936/1382693622.462.3520.1112754596/12754596 Proc#call
34%35% 3%22.112.3719.741382693622.462.3520.1112754596 Protobuf::Message#to_hash
19.745.9313.8113826936/15118257##each_key20.115.3814.7312754596/13516056##each_key
0.00 20.00 1/1##times##times
31% 1 Benchmark::IPS::Job#run_warmup
20.001.7718.241/1292879##each1.6918.321/762970##each
0.290.000.2810000/1291320##times0.420.010.4210000/761459##times
12.920.3312.591281320/129132015.050.2014.85751459/761459 Proc#call
20%24% 0%13.200.3312.87129132015.470.2115.27761459 Protobuf::Message::Serialization::ClassMethods.decode_from
12.110.3211.781291320/129132014.760.2214.54761459/761459 Protobuf::Message::Serialization.decode_from
0.760.170.591291320/25841640.510.110.40761459/1524359 Class#new
12.110.3211.781291320/129132014.760.2214.54761459/761459 Protobuf::Message::Serialization::ClassMethods.decode_from
19%23% 0%12.110.3211.78129132014.760.2214.54761459 Protobuf::Message::Serialization.decode_from
11.782.059.741291320/129132014.541.3113.23761459/761459 Protobuf::Decoder.decode_each_field
11.782.059.741291320/129132014.541.3113.23761459/761459 Protobuf::Message::Serialization.decode_from
18%3%11.782.059.74129132022%2%14.541.3113.23761459 Protobuf::Decoder.decode_each_field
7.401.166.243873960/38739607.130.816.312284377/2284377 Protobuf::Message::Serialization.set_field_bytes
1.420.850.577747920/7747920Protobuf::Varint.decode5.562.882.694568754/4568754Protobuf::VarintPure.decode
0.240.240.150.15 0.005165280/51652803045836/3045836 StringIO#eof
0.200.200.130.13 0.005165280/5168510##==3045836/3048922##==
0.170.170.100.10 0.003873960/3873960##>>761459/761459StringIO#read
0.170.170.003873960/3873960##&0.270.010.2610000/761459##times
0.130.130.001291320/1291320StringIO#read
0.190.010.1810000/1291320##times
9.100.358.751281320/12913208.850.278.58751459/761459 Proc#call
14% 0%9.280.368.9312913209.120.288.84761459 Protobuf::Encoder.encode
8.930.458.481291320/12913208.840.328.52761459/761459 Protobuf::Message#each_field_for_serialization
8.930.458.481291320/12913208.840.328.52761459/761459 Protobuf::Encoder.encode
14%13% 0%8.930.458.4812913208.840.328.52761459 Protobuf::Message#each_field_for_serialization
8.231.646.601291320/15118257##each_key8.371.057.32761459/13516056##each_key
0.180.180.110.11 0.001291320/3873961Test::Resource#_protobuf_message_required_field_tags761459/2284378Protobuf::Message#_protobuf_message_required_field_tags
0.690.170.521291320/77479227.130.816.312284377/2284377Protobuf::Decoder.decode_each_field
11%1%7.130.816.312284377Protobuf::Message::Serialization.set_field_bytes
2.460.192.27761459/761459Protobuf::Field::EnumField(singleton)#set
1.710.211.49761459/761459 Protobuf::Field::Int64Field(singleton)#set
1.341.40 0.191.151291320/77479221.21761459/761459 Protobuf::Field::StringField(singleton)#set
0.530.400.132284377/32362325Protobuf::Message#_protobuf_message_field
0.210.210.002284377/63970204##[]
1.730.161.571291320/77479220.940.120.82761459/4568756 Protobuf::Field::EnumField(singleton)#set
1.890.311.591291320/77479221.000.160.84761459/4568756Protobuf::Field::StringField(singleton)#set
1.070.120.95761459/4568756Protobuf::Field::Int64Field(singleton)#set
1.180.190.98761459/4568756 Test::Resource#status=
2.570.641.932582642/7747922##each2.550.412.151522920/4568756##each
13%2%8.221.476.75774792210%1%6.741.005.744568756 Protobuf::Message#set_field
2.980.602.392582640/2582640Protobuf::Field::EnumField(singleton)#set_field1.800.391.421522919/1522919Protobuf::Field::Int64Field(singleton)#set_field
2.210.941.272582641/2582641Protobuf::Field::StringField(singleton)#set_field1.660.351.311522918/1522918Protobuf::Field::EnumField(singleton)#set_field
0.971.60 0.600.372582641/2582641Protobuf::Field::Int64Field(singleton)#set_field1.001522919/1522919Protobuf::Field::StringField(singleton)#set_field
0.320.320.003873962/73391217##[]0.470.340.132284379/32362325Protobuf::Message#_protobuf_message_field
0.260.260.200.20 0.003873962/39275754Test::Resource#_protobuf_message_field2284379/63970204##[]
7.401.166.243873960/3873960Protobuf::Decoder.decode_each_field5.572.243.3312754596/12754596##each_key
11%1%7.401.166.243873960Protobuf::Message::Serialization.set_field_bytes8%3%5.572.243.3312754596Protobuf::Field::StringField(singleton)#to_message_hash
2.250.271.971291320/1291320Protobuf::Field::EnumField(singleton)#set2.371.530.8412754596/14277514Protobuf::Field::StringField(singleton)#value_from_values
2.120.281.851291320/1291320Protobuf::Field::StringField(singleton)#set0.960.960.0012754596/30084503##[]=
1.240.270.971291320/1291320Protobuf::Field::Int64Field(singleton)#set5.562.882.694568754/4568754Protobuf::Decoder.decode_each_field
8%4%5.562.882.694568754Protobuf::VarintPure.decode
0.340.340.890.660.226853131/6853131IO::GenericReadable.readbyte
0.470.47 0.003873960/73391217##[]13706262/21322798##&
0.290.290.280.28 0.003873960/39275754Test::Resource#_protobuf_message_field6853131/6853284##<<
5.462.323.1513826936/13826936##each_key0.270.270.006853131/8376374Numeric#nonzero?
8%3%5.462.323.1513826936Protobuf::Field::StringField(singleton)#to_message_hash
0.270.270.006853131/23728693##+
2.341.660.6813826936/16409576Protobuf::Field::StringField(singleton)#value_from_values0.260.260.006853131/9139607##|
0.810.810.260.26 0.0013826936/35406351##[]=6853131/6853756##*
5.342.273.0613826936/13826936##each_key5.182.133.0412754596/12754596##each_key
8% 3%5.342.273.06138269365.182.133.0412754596 Protobuf::Field::Int64Field(singleton)#to_message_hash
2.241.590.6513826936/164095762.141.480.6612754596/14277514 Protobuf::Field::Int64Field(singleton)#value_from_values
0.820.820.900.90 0.0013826936/35406351##[]=12754596/30084503##[]=
0.110.00 0.1010000/1524359##times
0.11 0.020.0816/25841640.0915/1524359 Kernel.eval
0.170.15 0.010.16153/25841640.14153/1524359 Protobuf::Field.build
0.300.24 0.010.291/25841640.231/1524359 Bundler::Dsl#to_definition
0.760.170.591291320/25841640.510.110.40761459/1524359 Protobuf::Message::Serialization::ClassMethods.decode_from
3.530.173.361281320/25841643.220.123.09751459/1524359 Proc#call
8%7% 0%5.120.464.6625841644.590.354.251524359 Class#new
4.020.813.212582641/25826413.600.593.001522919/1522919 Protobuf::Message#initialize
0.290.23 0.000.290.23 1/1 Bundler::Definition#initialize
0.160.14 0.010.150.14 153/153 Protobuf::Field::BaseField#initialize
0.150.150.140.14 0.002582640/733912172284377/63970204 Protobuf::Enum.enum_for_tag_integer
0.320.320.170.170.001525107/63970204Protobuf::Field::VarintField.cached_varint
0.200.20 0.003873962/733912172284379/63970204 Protobuf::Message#set_field
0.340.340.210.21 0.003873960/733912172284377/63970204 Protobuf::Message::Serialization.set_field_bytes
0.720.720.710.71 0.0015118256/7339121713516055/63970204 Protobuf::Field::Int64Field(singleton)#value_from_values
0.760.760.900.90 0.0015118256/7339121713516055/63970204 Protobuf::Field::StringField(singleton)#value_from_values
1.991.992.012.01 0.0031527832/73391217##each_key27793569/63970204##each_key
6% 6%4.404.374.424.39 0.0373391217##[]63970204##[]
4.020.813.212582641/25826413.600.593.001522919/1522919 Class#new
6%1%4.020.813.2125826415%0%3.600.593.001522919 Protobuf::Message#initialize
3.000.432.572582641/2582855##each2.870.322.551522919/1523130##each
0.110.110.470.340.132284379/32362325Protobuf::Message#set_field
0.530.400.132284377/32362325Protobuf::Message::Serialization.set_field_bytes
2.422.42 0.002582641/2582814Kernel.block_given?27793569/32362325##each_key
5%4%3.433.160.2632362325Protobuf::Message#_protobuf_message_field
0.110.110.200.20 0.002582641/2582642##to_hash1522919/1523730Protobuf::Message::Fields::ClassMethods.field_store
3.000.432.572582641/25828552.870.322.551522919/1523130 Protobuf::Message#initialize
4% 0%3.020.442.582582855##each2.890.332.561523130##each
2.570.641.932582642/77479222.550.412.151522920/4568756 Protobuf::Message#set_field
2.980.602.392582640/2582640Protobuf::Message#set_field0.540.160.38761459/2286579Protobuf::Field::EnumField#encode
0.580.170.41761459/2286579Protobuf::Field::StringField(singleton)#encode_to_stream
1.630.840.79761459/2286579Protobuf::Field::IntegerField#encode
4%0%2.980.602.392582640Protobuf::Field::EnumField(singleton)#set_field1%2.771.181.592286579Protobuf::Field::VarintField.encode
2.110.491.622582640/2582640Protobuf::Field::EnumField#coerce!0.660.390.271523058/1525107Protobuf::Field::VarintField.cached_varint
0.170.170.210.21 0.002582640/35406351##[]=3049844/3051803##<<
0.410.120.120.00763521/763523##pack
0.120.120.003049844/19924325##<
0.110.110.002284530/3809398##<=
0.11 0.110.301291320/16409576##each_key0.002286323/4570700##>>
2.341.660.6813826936/164095760.260.070.19761459/14277514##each_key
2.371.530.8412754596/14277514 Protobuf::Field::StringField(singleton)#to_message_hash
4% 2%2.751.770.98164095762.621.591.0314277514 Protobuf::Field::StringField(singleton)#value_from_values
0.760.760.900.90 0.0015118256/73391217##[]13516055/63970204##[]
0.360.110.261291320/16409576##each_key2.590.212.38761459/761459##each_key
4%0%2.590.212.38761459Protobuf::Field::Int64Field(singleton)#encode_to_stream
2.060.341.73761459/761459Protobuf::Field::IntegerField#encode
0.320.150.171522918/5330213IO::GenericWritable.<<
2.241.590.6513826936/164095762.460.192.27761459/761459Protobuf::Message::Serialization.set_field_bytes
3%0%2.460.192.27761459Protobuf::Field::EnumField(singleton)#set
1.330.331.00761459/761459Protobuf::Field::EnumField#decode
0.940.120.82761459/4568756Protobuf::Message#set_field
0.250.070.18761459/14277514##each_key
2.141.480.6612754596/14277514 Protobuf::Field::Int64Field(singleton)#to_message_hash
4%3% 2%2.611.700.91164095762.381.550.8414277514 Protobuf::Field::Int64Field(singleton)#value_from_values
0.720.720.710.71 0.0015118256/73391217##[]13516055/63970204##[]
0.42 0.03 0.392/18862/1865 Kernel.load
0.910.89 0.000.916/18860.896/1865 (top)
1.050.95 0.001.05115/18860.95112/1865 Kernel.require
3% 0%2.372.26 0.032.3418862.231865 Kernel.require
0.880.81 0.000.880.81 1/1 Bundler.setup
0.23 0.000.2219/1292879##each0.2319/762970##each
0.130.14 0.000.130.14 1/1 Gem::Specification.load_defaults
0.120.11 0.000.120.11 109/109 Protobuf::Message::Fields::ClassMethods.optional
2.300.741.571291320/1291320##each_key
3%1%2.300.741.571291320Protobuf::Field::StringField(singleton)#encode_to_stream0.120.120.001522919/30084503Protobuf::Field::Int64Field(singleton)#set_field
0.740.350.393873960/9039240IO::GenericWritable.<<0.120.120.001522918/30084503Protobuf::Field::EnumField(singleton)#set_field
0.340.220.121291320/1291473Protobuf::Field::VarintField.encode0.130.130.001522919/30084503Protobuf::Field::StringField(singleton)#set_field
0.240.170.071291320/1292131BasicObject#!=0.900.900.0012754596/30084503Protobuf::Field::Int64Field(singleton)#to_message_hash
0.120.120.960.96 0.001291320/2582782##+12754596/30084503Protobuf::Field::StringField(singleton)#to_message_hash
3%3%2.242.240.0130084503##[]=
2.250.271.971291320/1291320Protobuf::Message::Serialization.set_field_bytes2.060.341.73761459/761459Protobuf::Field::Int64Field(singleton)#encode_to_stream
3% 0%2.250.271.971291320Protobuf::Field::EnumField(singleton)#set2.060.341.73761459Protobuf::Field::IntegerField#encode
1.730.161.571291320/7747922Protobuf::Message#set_field1.630.840.79761459/2286579Protobuf::Field::VarintField.encode
0.240.190.051291320/1291320Protobuf::Field::EnumField#decode0.100.100.00761459/21322798##&
2.170.311.871281320/1291320Proc#call1.890.511.38761459/761459##each_key
3%2% 0%2.210.32 1.891291320Test::Resource#status=0.511.38761459Protobuf::Field::StringField(singleton)#encode_to_stream
1.890.311.591291320/7747922Protobuf::Message#set_field0.580.170.41761459/2286579Protobuf::Field::VarintField.encode
0.470.230.242284377/5330213IO::GenericWritable.<<
0.140.100.04761459/762229BasicObject#!=
2.210.941.272582641/25826411.800.391.421522919/1522919 Protobuf::Message#set_field
3%1%2.210.941.272582641Protobuf::Field::StringField(singleton)#set_field2%0%1.800.391.421522919Protobuf::Field::Int64Field(singleton)#set_field
0.680.530.152582641/3873961Test::Resource#_protobuf_message_required_field_tags1.240.440.801522919/1522919Protobuf::Field::VarintField#coerce!
0.200.200.120.12 0.002582641/2582825##delete1522919/30084503##[]=
0.180.180.002582641/35406351##[]=1.710.211.49761459/761459Protobuf::Message::Serialization.set_field_bytes
2%0%1.710.211.49761459Protobuf::Field::Int64Field(singleton)#set
0.100.100.002582641/7748887Kernel.nil?1.070.120.95761459/4568756Protobuf::Message#set_field
0.100.100.002582641/2583806##to_s0.430.320.11761459/761459Protobuf::Field::IntegerField#decode
0.160.160.002582641/35406351Protobuf::Field::Int64Field(singleton)#set_field1.660.211.46761459/761459##each_key
2%0%1.660.211.46761459Protobuf::Field::EnumField(singleton)#encode_to_stream
0.170.170.002582640/35406351Protobuf::Field::EnumField(singleton)#set_field1.180.340.84761459/761459Protobuf::Field::EnumField#encode
0.180.180.002582641/35406351Protobuf::Field::StringField(singleton)#set_field0.280.150.131522918/5330213IO::GenericWritable.<<
0.810.811.660.351.311522918/1522918Protobuf::Message#set_field
2%0%1.660.351.311522918Protobuf::Field::EnumField(singleton)#set_field
1.130.270.861522918/1522918Protobuf::Field::EnumField#coerce!
0.120.12 0.0013826936/35406351Protobuf::Field::StringField(singleton)#to_message_hash1522918/30084503##[]=
0.820.820.0013826936/35406351Protobuf::Field::Int64Field(singleton)#to_message_hash1.600.601.001522919/1522919Protobuf::Message#set_field
3%3%2.152.140.0135406351##[]=2%0%1.600.601.001522919Protobuf::Field::StringField(singleton)#set_field
0.660.410.251522919/2284378Protobuf::Message#_protobuf_message_required_field_tags
0.130.130.001522919/30084503##[]=
2.120.281.851291320/12913201.400.191.21761459/761459 Protobuf::Message::Serialization.set_field_bytes
3%2% 0%2.120.281.8512913201.400.191.21761459 Protobuf::Field::StringField(singleton)#set
1.340.191.151291320/77479221.000.160.84761459/4568756 Protobuf::Message#set_field
0.500.300.201291320/12913200.210.140.07761459/761459 Protobuf::Field::StringField#decode
2.110.491.622582640/2582640Protobuf::Field::EnumField(singleton)#set_field1.360.211.15751459/761459Proc#call
3%2% 0%2.110.491.622582640Protobuf::Field::EnumField#coerce!1.400.221.18761459Test::Resource#status=
1.380.460.922582640/2582649Protobuf::Enum.fetch1.180.190.98761459/4568756Protobuf::Message#set_field
0.240.240.002582640/2583314Protobuf::Field::BaseField#type_class1.330.331.00761459/761459Protobuf::Field::EnumField(singleton)#set
2%0%1.330.331.00761459Protobuf::Field::EnumField#decode
0.880.280.60761459/761459Protobuf::Field::EnumField#acceptable?
1.240.440.801522919/1522919Protobuf::Field::Int64Field(singleton)#set_field
1%0%1.240.440.801522919Protobuf::Field::VarintField#coerce!
0.650.420.221522919/1522919Protobuf::Field::Int64Field#acceptable?
0.450.160.28761459/2284386Protobuf::Field::EnumField#acceptable?
0.760.270.501522918/2284386Protobuf::Field::EnumField#coerce!
1%0%1.210.430.782284386Protobuf::Enum.fetch
0.670.41 0.260.262284377/2284377Protobuf::Enum.enum_for_tag_integer
0.110.11 0.003873962/39275754Protobuf::Message#set_field2284386/5331568Kernel.kind_of?
0.290.291.180.340.84761459/761459Protobuf::Field::EnumField(singleton)#encode_to_stream
1%0%1.180.340.84761459Protobuf::Field::EnumField#encode
0.540.160.38761459/2286579Protobuf::Field::VarintField.encode
0.180.110.07761459/761727Protobuf::Enum#to_i
0.110.11 0.003873960/39275754Protobuf::Message::Serialization.set_field_bytes761459/21322798##&
1.551.550.0031527832/39275754##each_key1.130.270.861522918/1522918Protobuf::Field::EnumField(singleton)#set_field
3%3%2.092.091%0%1.130.270.861522918Protobuf::Field::EnumField#coerce!
0.760.270.501522918/2284386Protobuf::Enum.fetch
0.100.10 0.0039275754Test::Resource#_protobuf_message_field1522918/2285051Protobuf::Field::BaseField#type_class
0.440.230.212582640/90392400.280.150.131522918/5330213 Protobuf::Field::EnumField(singleton)#encode_to_stream
0.480.230.252582640/90392400.320.150.171522918/5330213 Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.740.350.393873960/90392400.470.230.242284377/5330213 Protobuf::Field::StringField(singleton)#encode_to_stream
2% 1%1.670.820.8590392400%1.060.520.545330213 IO::GenericWritable.<<
0.850.850.540.54 0.009039240/90392405330213/5330213 StringIO#write
1.440.321.121291320/1291320##each_key
2%0%1.440.321.121291320Protobuf::Field::EnumField(singleton)#encode_to_stream0.100.100.00761459/21322798Protobuf::Field::IntegerField#encode
0.680.270.421291320/12913200.110.110.00761459/21322798 Protobuf::Field::EnumField#encode
0.440.230.212582640/9039240IO::GenericWritable.<<
1.420.850.577747920/7747920Protobuf::Decoder.decode_each_field0.470.470.0013706262/21322798Protobuf::VarintPure.decode
2% 1%1.420.850.577747920Protobuf::Varint.decode
0.570.571%1.001.00 0.007747920/7747920ProtobufJavaHelpers::Varinter.read_varint21322798##&
1.380.460.922582640/2582649Protobuf::Field::EnumField#coerce!
2%0%1.380.460.922582649Protobuf::Enum.fetch
0.780.510.282582640/2582640Protobuf::Enum.enum_for_tag_integer
0.14 0.14 0.002582649/2584139Kernel.kind_of?3368424/23728693##each
1.24 0.270.971291320/1291320Protobuf::Message::Serialization.set_field_bytes
1%0%1.24 0.270.971291320Protobuf::Field::Int64Field(singleton)#set
0.690.170.521291320/7747922Protobuf::Message#set_field
0.280.220.061291320/1291320Protobuf::Field::Int64Field#decode0.006853131/23728693Protobuf::VarintPure.decode
1.180.320.861291320/1291320##each_key0.560.560.0013506055/23728693Benchmark::IPS::Job::Entry#call_times
1%0%1.180.320.861291320Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.480.230.252582640/9039240IO::GenericWritable.<<
0.380.240.141291320/1291320Protobuf::Field::Int64Field#encode1%0.970.970.0023728693##+
1.050.95 0.001.052/1150.952/112 (top)
1% 0%1.050.95 0.001.051150.95112 Kernel.require
1.050.95 0.001.05115/18860.95112/1865 Kernel.require
0.970.600.372582641/2582641Protobuf::Message#set_field0.890.660.226853131/6853131Protobuf::VarintPure.decode
1%0%0.970.600.372582641Protobuf::Field::Int64Field(singleton)#set_field
0.160.160.002582641/35406351##[]=
0.110.110.002582641/2582641ProtobufJavaHelpers::Int64ProtobufField.coerce!1%0.890.660.226853131IO::GenericReadable.readbyte
0.100.100.220.22 0.002582641/7748887Kernel.nil?6853131/6853131StringIO#getbyte
0.950.470.493681900/3681900##each0.880.280.60761459/761459Protobuf::Field::EnumField#decode
1% 0%0.950.470.493681900Benchmark::Timing.now0.880.280.60761459Protobuf::Field::EnumField#acceptable?
0.490.490.003681900/3681901Process.clock_gettime0.450.160.28761459/2284386Protobuf::Enum.fetch
0.880.81 0.000.880.81 1/1 Kernel.require
1% 0%0.880.81 0.000.880.81 1 Bundler.setup
0.520.44 0.010.510.43 1/2 Bundler.definition
0.350.36 0.000.350.36 1/1 Bundler::Runtime#setup
0.180.180.110.11 0.001291320/3873961761459/2284378 Protobuf::Message#each_field_for_serialization
0.680.530.152582641/38739610.660.410.251522919/2284378 Protobuf::Field::StringField(singleton)#set_field
1%1%0.860.710.153873961Test::Resource#_protobuf_message_required_field_tags
0.150.150.002582641/2583673Kernel.dup0%0.770.520.252284378Protobuf::Message#_protobuf_message_required_field_tags
0.850.850.009039240/9039240IO::GenericWritable.<<
1%1%0.850.850.200.20 0.009039240StringIO#write1522919/1522926Protobuf::Message::Fields::ClassMethods.required_field_tags
0.140.140.120.12 0.003681365/18790704##each3049844/19924325Protobuf::Field::VarintField.encode
0.670.670.650.65 0.0015108256/1879070416874465/19924325 Benchmark::IPS::Job::Entry#call_times
1% 1%0.810.810.760.76 0.0018790704##+19924325##<
0.780.510.282582640/2582640Protobuf::Enum.fetch0.740.310.443368939/3368939##each
1% 0%0.780.510.282582640Protobuf::Enum.enum_for_tag_integer
0.150.150.002582640/73391217##[]0.740.310.443368939Benchmark::Timing.now
0.130.130.440.44 0.002582640/2583129##first3368939/3368940Process.clock_gettime
0.710.710.0018789607/18789624Benchmark::IPS::Job::Entry#call_times0.660.390.271523058/1525107Protobuf::Field::VarintField.encode
1%1%0.710.710%0.680.390.281525107Protobuf::Field::VarintField.cached_varint
0.170.17 0.0018789624##<1525107/63970204##[]
0.680.270.421291320/1291320Protobuf::Field::EnumField(singleton)#encode_to_stream0.670.410.262284377/2284377Protobuf::Enum.fetch
1% 0%0.680.270.421291320Protobuf::Field::EnumField#encode0.670.410.262284377Protobuf::Enum.enum_for_tag_integer
0.310.18 0.141291320/1291588Protobuf::Enum#to_i0.140.002284377/63970204##[]
0.100.100.120.12 0.001291320/2582640ProtobufJavaHelpers::Varinter.to_varint_642284377/2284829##first
0.570.570.650.420.221522919/1522919Protobuf::Field::VarintField#coerce!
1%0%0.650.420.221522919Protobuf::Field::Int64Field#acceptable?
0.540.54 0.007747920/7747920Protobuf::Varint.decode5330213/5330213IO::GenericWritable.<<
0% 0%0.570.570.540.54 0.007747920ProtobufJavaHelpers::Varinter.read_varint5330213StringIO#write
19 Kernel.load
0.42 0.03 0.392/18862/1865 Kernel.require
0.520.44 0.010.510.43 1/2 Bundler.setup
0% 0%0.520.44 0.010.510.43 2 Bundler.definition
0.420.35 0.000.420.34 1/1 Bundler::Definition.build
0.500.300.201291320/1291320Protobuf::Field::StringField(singleton)#set
0%0%0.500.300.201291320Protobuf::Field::StringField#decode
0.130.130.001291320/2582782##+
0.490.490.440.44 0.003681900/36819013368939/3368940 Benchmark::Timing.now
0% 0%0.490.490.440.44 0.0036819013368940 Process.clock_gettime
0.420.000.421/1Bundler.definition0.430.320.11761459/761459Protobuf::Field::Int64Field(singleton)#set
0% 0%0.420.000.421Bundler::Definition.build
0.400.000.401/1Bundler::Dsl.evaluate0.430.320.11761459Protobuf::Field::IntegerField#decode
0.33 0.00 0.331/8731/822 Bundler::Runtime#requested_specs
0.41 0.00 0.41873822 Kernel.send
0.33 1/1 Bundler::Definition#requested_specs
0.400.36 0.000.400.36 1/1Bundler::Definition.buildBundler.setup
0% 0%0.400.36 0.000.400.36 1Bundler::Dsl.evaluateBundler::Runtime#setup
0.300.33 0.000.300.33 1/1Bundler::Dsl#to_definitionBundler::Runtime#requested_specs
0.380.240.141291320/1291320Protobuf::Field::Int64Field(singleton)#encode_to_stream0.260.260.006853131/9139607Protobuf::VarintPure.decode
0% 0%0.380.240.141291320Protobuf::Field::Int64Field#encode
0.140.140.350.35 0.001291320/2582640ProtobufJavaHelpers::Varinter.to_varint_649139607##|
0.370.110.271291320/2582640##each_key
0%0%0.370.110.272582640Protobuf::Field::EnumField(singleton)#value_from_values
0.35 0.000.350.34 1/1Bundler.setupBundler.definition
0% 0% 0.35 0.000.350.34 1Bundler::Runtime#setupBundler::Definition.build
0.33 0.00 0.33 1/1Bundler::Runtime#requested_specsBundler::Dsl.evaluate
0.340.220.121291320/1291473Protobuf::Field::StringField(singleton)#encode_to_stream0.330.000.331/1Bundler::Definition.build
0% 0%0.340.220.121291473Protobuf::Field::VarintField.encode0.330.000.331Bundler::Dsl.evaluate
0.120.120.24 0.001291473/1291473ProtobufJavaHelpers::Varinter.to_varint0.241/1Bundler::Dsl#to_definition
1 Bundler::Runtime#requested_specs
0.33 0.00 0.331/8731/822 Kernel.send
1 Bundler::Definition#requested_specs
0.33 1/1 Bundler::Definition#specs_for
1 Bundler::Definition#specs_for
0.32 1/1 Bundler::Definition#specs
0.270.270.006853131/8376374Protobuf::VarintPure.decode
0%0%0.330.330.008376374Numeric#nonzero?
1 Bundler::Definition#specs
0.200.21 0.000.200.21 1/1 Bundler::SpecSet#materialize
0.100.000.101/1Bundler::Definition#resolve
0.310.180.141291320/1291588Protobuf::Field::EnumField#encode0.280.280.006853131/6853284Protobuf::VarintPure.decode
0%0%0.310.180.141291588Protobuf::Enum#to_i
0.140.140%0%0.280.28 0.001291588/1291588Protobuf::Enum#tag6853284##<<
0.100.100.110.11 0.002582641/7748887Protobuf::Field::Int64Field(singleton)#set_field2284386/5331568Protobuf::Enum.fetch
0%0%0.270.270.005331568Kernel.kind_of?
0.100.100.260.26 0.002582641/7748887Protobuf::Field::StringField(singleton)#set_field6853131/6853756Protobuf::VarintPure.decode
0% 0%0.300.300.260.26 0.007748887Kernel.nil?6853756##*
0.300.24 0.000.300.24 1/1 Bundler::Dsl.evaluate
0% 0%0.300.24 0.000.300.24 1 Bundler::Dsl#to_definition
0.300.24 0.010.291/25841640.231/1524359 Class#new
0.290.23 0.000.290.23 1/1 Class#new
0% 0%0.290.23 0.000.290.23 1 Bundler::Definition#initialize
0.110.000.111/1Bundler::Definition#converge_paths0.230.070.16761459/1522918##each_key
0%0%0.230.070.161522918Protobuf::Field::EnumField(singleton)#value_from_values
0.280.170.111281320/1291320Proc#call0.190.000.191/392Bundler::SpecSet#materialize
0% 0%0.290.170.111291320StringIO.new0.230.020.21392##map!
0.110.110.19 0.001291320/1291320StringIO#initialize0.1938/38Bundler::LazySpecification#__materialize__
0.28 0.220.061291320/1291320Protobuf::Field::Int64Field(singleton)#set0.220.006853131/6853131IO::GenericReadable.readbyte
0% 0%0.28 0.220.061291320Protobuf::Field::Int64Field#decode
0.120.120.001291320/2582782Protobuf::Field::StringField(singleton)#encode_to_stream
0.130.130.22 0.001291320/2582782Protobuf::Field::StringField#decode6853131StringIO#getbyte
0% 0%0.250.250.220.22 0.002582782##+5331092Kernel.nil?
0.240.170.210.14 0.071291320/1292131Protobuf::Field::StringField(singleton)#encode_to_stream761459/761459Protobuf::Field::StringField(singleton)#set
0% 0%0.240.170.081292131BasicObject#!=0.210.140.07761459Protobuf::Field::StringField#decode
0.240.190.051291320/1291320Protobuf::Field::EnumField(singleton)#set0.210.000.211/1Bundler::Definition#specs
0% 0%0.240.210.000.211Bundler::SpecSet#materialize
0.190.051291320Protobuf::Field::EnumField#decode0.000.191/392##map!
0.240.240.210.21 0.002582640/2583314Protobuf::Field::EnumField#coerce!3049844/3051803Protobuf::Field::VarintField.encode
0% 0%0.240.240.210.21 0.002583314Protobuf::Field::BaseField#type_class3051803##<<
0.100.100.001291320/2582640Protobuf::Field::EnumField#encode0.200.110.09751459/761459Proc#call
0%0%0.210.110.09761459StringIO.new
0.140.140.200.20 0.001291320/2582640Protobuf::Field::Int64Field#encode1522919/1523730Protobuf::Message#_protobuf_message_field
0% 0%0.240.240.200.20 0.002582640ProtobufJavaHelpers::Varinter.to_varint_641523730Protobuf::Message::Fields::ClassMethods.field_store
0.240.240.110.11 0.005165280/5165280Protobuf::Decoder.decode_each_field2286323/4570700Protobuf::Field::VarintField.encode
0% 0%0.240.240.200.20 0.005165280StringIO#eof4570700##>>
0.20 0.20 0.005165280/5168510Protobuf::Decoder.decode_each_field1522919/1522926Protobuf::Message#_protobuf_message_required_field_tags
0% 0.20 0.20 0.005168510##==1522926Protobuf::Message::Fields::ClassMethods.required_field_tags
0.200.200.19 0.002582641/2582825Protobuf::Field::StringField(singleton)#set_field0.1938/38##map!
0% 0%0.200.200.19 0.002582825##delete0.1938Bundler::LazySpecification#__materialize__
0.200.15 0.000.201/1Bundler::Definition#specs0.1537/37Bundler::Source::Rubygems#specs
0.180.110.07761459/761727Protobuf::Field::EnumField#encode
0% 0%0.200.000.201Bundler::SpecSet#materialize0.180.110.07761727Protobuf::Enum#to_i
0.120.100.10 0.000.12109/153Protobuf::Message::Fields::ClassMethods.optional1522918/2285051Protobuf::Field::EnumField#coerce!
0% 0% 0.180.00 0.18153Protobuf::Message::Fields::ClassMethods.define_field0.002285051Protobuf::Field::BaseField#type_class
0.170.180.18 0.000.17153/153Protobuf::Field.build3368414/3368414##each
0%0%0.180.180.003368414##<
0.170.170.110.11 0.003873960/3873960Protobuf::Decoder.decode_each_field2284530/3809398Protobuf::Field::VarintField.encode
0%0%0.170.170%0.180.18 0.003873960##>>3809398##<=
0.170.11 0.000.17153/153Protobuf::Message::Fields::ClassMethods.define_field0.11109/153Protobuf::Message::Fields::ClassMethods.optional
0% 0%0.170.16 0.000.170.16 153Protobuf::Field.buildProtobuf::Message::Fields::ClassMethods.define_field
0.170.01 0.16153/2584164Class#new0.000.15153/153Protobuf::Field.build
0.170.170.12 0.003681355/3681355##each0.123/285Gem::Specification.gemspec_stubs_in
0% 0%0.170.170.003681355##<0.160.020.15285##select
0.170.170.003873960/3873960Protobuf::Decoder.decode_each_field
0%0%0.170.170.12 0.003873960##&0.1268/68Gem::StubSpecification#valid?
0% 0% 0.160.000.166Bundler::SpecSet#for
0.160.01 0.166/6Kernel.loop0.003807453##>=
0.160.010.166/6Bundler::SpecSet#for0.150.000.151/2Bundler::Source::Rubygems#installed_specs
0% 0% 0.160.010.00 0.166Kernel.loop2Bundler::Index.build
0.14 0.00 0.14215/215Bundler::SpecSet#spec_for_dependency1/1Bundler::RubygemsIntegration::MoreFuture#all_specs
0.160.010.00 0.15 153/153Class#newProtobuf::Message::Fields::ClassMethods.define_field
0% 0% 0.160.010.00 0.15 153Protobuf::Field::BaseField#initializeProtobuf::Field.build
0%0%
0.150.060.091137BasicObject#instance_eval0.010.14153/1524359Class#new
0.150.15 0.002582641/2583673Test::Resource#_protobuf_message_required_field_tags0.1537/37Bundler::LazySpecification#__materialize__
0% 0% 0.150.000.1537Bundler::Source::Rubygems#specs
0.150.000.151/1Bundler::Source::Rubygems#installed_specs
0.15 0.002583673Kernel.dup0.151/1Bundler::Source::Rubygems#specs
0% 0%0.140.030.1161Kernel.eval0.150.000.151Bundler::Source::Rubygems#installed_specs
0.100.020.0816/2584164Class#new0.150.000.151/2Bundler::Index.build
0.140.140.002582649/2584139Protobuf::Enum.fetch0.100.04761459/762229Protobuf::Field::StringField(singleton)#encode_to_stream
0% 0%0.140.140.002584139Kernel.kind_of?0.150.100.05762229BasicObject#!=
0.140.150.15 0.000.14215/215Kernel.loop3045836/3045836Protobuf::Decoder.decode_each_field
0% 0%0.140.150.15 0.000.14215Bundler::SpecSet#spec_for_dependency3045836StringIO#eof
0.140.01 0.140.001291588/1291588Protobuf::Enum#to_i153/153Class#new
0% 0% 0.140.01 0.140.001291588Protobuf::Enum#tag153Protobuf::Field::BaseField#initialize
0.130.130.14 0.002582640/2583129Protobuf::Enum.enum_for_tag_integer0.141/1Bundler::Index.build
0% 0%0.130.130.14 0.002583129##first0.141Bundler::RubygemsIntegration::MoreFuture#all_specs
0.130.130.001291320/1291320Protobuf::Decoder.decode_each_field
0%0%0.130.130.14 0.001291320StringIO#read0.141/1Gem::Specification.stubs
0% 0%0.130.020.11412##map!0.140.060.081136BasicObject#instance_eval
0.130.14 0.000.130.14 1/1 Kernel.require
0% 0%0.130.14 0.000.130.14 1 Gem::Specification.load_defaults
0.120.14 0.000.120.14 1/1 Gem::Specification.each_spec
0.120.000.121/1Gem::Specification.load_defaults
0% 0%0.120.000.121Gem::Specification.each_spec0.140.030.1160Kernel.eval
0.120.000.121/1Gem::Specification.each_gemspec0.110.020.0915/1524359Class#new
0.120.14 0.000.12109/109Kernel.require0.141/1Gem::Specification.load_defaults
0% 0%0.120.14 0.000.12109Protobuf::Message::Fields::ClassMethods.optional0.141Gem::Specification.each_spec
0.120.14 0.000.12109/153Protobuf::Message::Fields::ClassMethods.define_field0.141/1Gem::Specification.each_gemspec
0.120.14 0.000.120.14 1/1 Gem::Specification.each_spec
0% 0%0.120.14 0.000.120.14 1 Gem::Specification.each_gemspec
0.120.14 0.000.121/1292879##each0.141/762970##each
0.110.14 0.000.111/172Bundler::Definition#converge_paths0.141/1Bundler::RubygemsIntegration::MoreFuture#all_specs
0% 0%0.120.14 0.000.12172##any?0.141Gem::Specification.stubs
0.110.12 0.000.112/2Bundler::Definition#specs_changed?0.121/1Gem::Specification.installed_stubs
0.120.120.130.13 0.001291473/1291473Protobuf::Field::VarintField.encode3045836/3048922Protobuf::Decoder.decode_each_field
0% 0%0.120.120.130.13 0.001291473ProtobufJavaHelpers::Varinter.to_varint3048922##==
0.110.110.12 0.001291320/1291320StringIO.new0.122/3##each
0% 0%0.110.110.130.000.133Gem::Specification.gemspec_stubs_in
0.12 0.001291320StringIO#initialize0.123/285##select
0.110.110.120.12 0.002582641/2582641Protobuf::Field::Int64Field(singleton)#set_field763521/763523Protobuf::Field::VarintField.encode
0% 0%0.110.110.120.12 0.002582641ProtobufJavaHelpers::Int64ProtobufField.coerce!763523##pack
0.110.120.12 0.000.111/1Bundler::Definition#initialize2284377/2284829Protobuf::Enum.enum_for_tag_integer
0% 0%0.110.000.111Bundler::Definition#converge_paths
0.110.120.12 0.000.111/172##any?2284829##first
0.110.12 0.000.112/2##any?0.1268/1220Gem::StubSpecification#valid?
0% 0%0.110.12 0.000.112Bundler::Definition#specs_changed?0.121220Gem::StubSpecification#data
0.120.01 0.110.000.112/2Bundler::Definition#specs_for_source_changed?68/68Kernel.open
0% 0%0.110.110.120.12 0.002582640ProtobufJavaHelpers::IntegerProtobufField.decode_varint_643046840Kernel.class
0.100.12 0.000.102/5Bundler::Definition#specs_for_source_changed?0.1268/68##select
0% 0%0.110.12 0.000.115Bundler::Source::Path#specs0.1268Gem::StubSpecification#valid?
0.110.12 0.000.115/5Bundler::Source::Path#local_specs0.1268/1220Gem::StubSpecification#data
0.110.12 0.000.112/2Bundler::Definition#specs_changed?0.121/1Gem::Specification.stubs
0% 0%0.110.12 0.000.112Bundler::Definition#specs_for_source_changed?0.121Gem::Specification.installed_stubs
0.100.12 0.000.102/5Bundler::Source::Path#specs0.121/1Gem::Specification.map_stubs
0.110.110.12 0.002582641/2582814Protobuf::Message#initialize0.121/1Gem::Specification.installed_stubs
0% 0%0.110.110.12 0.002582814Kernel.block_given?0.121Gem::Specification.map_stubs
0.120.000.121/1##flat_map
0.110.12 0.000.115/5Bundler::Source::Path#specs0.121/1Gem::Specification.map_stubs
0% 0%0.110.12 0.000.115Bundler::Source::Path#local_specs0.121##flat_map
0.110.12 0.000.113/3Bundler::Source::Path#load_spec_files0.121/762970##each
0.120.01 0.110.000.113/3Bundler::Source::Path#local_specs68/68Gem::StubSpecification#data
0% 0%0.120.01 0.110.000.113Bundler::Source::Path#load_spec_files68Kernel.open
0.110.11 0.001281320/1291320Proc#call0.11109/109Kernel.require
0% 0% 0.110.11 0.001291320Protobuf::Message#to_proto
0%0% 0.110.090.02449##reverse_each109Protobuf::Message::Fields::ClassMethods.optional
0.110.11 0.002582641/2582642Protobuf::Message#initialize
0%0%0.11 0.110.002582642##to_hash109/153Protobuf::Message::Fields::ClassMethods.define_field
0.100.11 0.00 0.101/1Bundler::Definition#specs13/14##each
0% 0%0.100.11 0.000.101Bundler::Definition#resolve0.1114Gem::Specification.load
0.10 0.10 0.002582641/2583806Protobuf::Field::StringField(singleton)#set_field761459/761459Protobuf::Decoder.decode_each_field
0% 0.10 0.10 0.002583806##to_s761459StringIO#read
0%0%0.100.000.1014Gem::Specification.load
@@ -67,4074 +67,3430 @@

Total time: 63.34

- + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - - + + - - - - - - - - - - + - - - - - - - - - - + - - - - + + + + - - - - + + + + - - - - + + + + - + - - - - - + + + + + - + - - - - + + + + - + - - - - + + + + - - - - - - - - - - - - - - - - - - - + - + + - - - + + - + - + + - - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - + + + + + - + - - - - + + + + - + - - - - + + + + - + - - + + - - + + - + - - + + - - + + - - - - + + + + - - - - - - + + + + + + - - - - - - - - - - + - - - - + + + + - + - - - - + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - + + + + - + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - - - - - + - - - - - + + + + + + - - - - + + + + - - - - - - - - - - + - - - - - + + + + + - + - - - - - + + + + + - - - - - - - - + + + + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - + - + - + - + - + - + - + - + - - - - - + + + + + - + - - - + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - - - + + + + - - - - - - + + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - + + - + - + - - + + - - + + - + - - + + - + - + + + + + + + + + + + + + + + + + + + - + - - - + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - - - + + + + - - - - - - + + + + + + - + - - - - - + + + + + - + - - + + - - + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + + - - - - - + + + + + + + + + + + + + + - + - - - - - + + + + + - + + - - - - - + + + + + - + + + + + + + + + + - - - - - + + + + + - - - - - + + + + + - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + + - - - - - + + + + + - + - - - - - + + + + + - + + + + + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - - + + + + + + + - + - - - - - + + + + + - + - - + + - - + + - - - - + + + + - + - - - - - + + + + + - + - + + - - + - + - - + + - - + + - + - - + + - - + + - + - - + + - - + + - + - - + + - - + + - + - - + + - - + + - + - - + + - - + + - - - - - + + + + + - - - - - - - + + + + + + + - + - - - - - + + + + + - + - - + + - - + + - - - - - + + + + + - + + + + + + + + + + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + + + + + + + + + + - - + + + - - + + + + + + + + + + + + + + + + + + + + - - + + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - - - + + + + - - + + - + - - - - - + + + + + - + - - - - - - - - - - - - - - + + + + + - - + - - - - - + + + + + - + - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - - + - - - - - + + + + + + - - - - - + + + + + - - - - - + + + + + - + - - - - - - - - - - - - - - + + + + + - + - - + + - - + + - + + - - + + - - + + - + - - + + - - + + - + - - + + - - + + - + - - + + - - + + - - - - - - - - - + + + + + + + + + - - - - - + + + + + - - - - - - + + + + + + - + - - + + + + + + + + + + + - - + + - + - - - - - + + + + + - - - - - - - + + + + + + + - + - - - - - + + + + + - + + - - - - - + + + + + - - - - - - + + + + + - + - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - - - - - - - + + + - - + + - + - + - - + + - + - - + + - + - - + + - + - + - - + + - + - + - + - + - - - - - + + + + + - + - + - + - + + - - - - - + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - - + + + + + + + + + + + + + + + + + + + + - - + + + - - + + + + + + + + + + + - - + + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - + + + + + - - - - - - - + + + + + + + - + + - - - - + + + + - + + + + + + + + + + - - + + - - + + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - + - - + + - - + + - - + - - - - - - - - - - - - - - + + + + + - + - - - - + + + + - + + - - - - - + + + + + - - - - - - - - - - - - - + + + - + - - - - - + + + + + - + - - - - - + + + + + + + + + + + + + + - - - - - + + + + + - + - - - - - - - - - - - + + - - + + - + - - + + - - + + - + - - - - - + + + + + - + - - - - - - - - - - - - - - + + + + + - + - - + + - - + + - + - - - - - + + + + + - - - - - - - - - - - - - - - - + + + + + + + - + + - - - - - + + + + + - - - - - - + + + + + - - - + - - + + + + - + - - - - - + + + + + - - - - - + + + + + - - - - - - + + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - - - - - - - - - - - - - - - + + + + + + - - + - - - - - + + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - + + + + + + - + - - + - - + + + - + - + + - - - + + - - + + + - - - + + - + - - - - + + + + - + + - - - - - + + + + + + + + + + + + + + - + - - + + - + - - - - - + + + + + - - - - - - + + + + + + - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - - - - - + + + + + - - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + - - - + + - - - - - - - - - - + + - - - + + - + - - + + - - + + - - + + - - + + - - - - - + + + + + - - - - - + + + + + - + - + + - - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + - + - - - - - + + + + + - - - - - + + + + + - - + - - - - - - - - - - - - - - + + + + + - + - - - - - + + + + + - - - - - + + + + + - + - + + - - - + + - + - - + - - + + + - - + - - + + + - - - - - - + + + + - - + + + - + - - - - - + + + + + - - - - - + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - - - + + + - + - - + + - - + + - - + + - - + + - - - - - + + + + + - - - - - + + + + + - - + - - + - - + + + - - - - - + + + + + + - - + + - - - + + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - - - - - + + + + + - - - - - + + + + + - - + - - - - - - - - - - - + - - + + + - + - - + - - + + + - - + - - + + + - - + - - - - - - - - - - - + - - + + + - + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - + + - - - + + - - - - - + + + + + - + + - + + - - - + + - - - + + - - + + - + + - - - + + - - - - - - - - - - + + - - - + + - + - + - - - + + + - + - - - + + + - + - + - - + + - + - + - - - + + + - + - - - + + + - + - + - + - + - + - + + - - - + + - + + - - - + + - + + - + + - - - + + + + + + + + + + + - - - - - + + + + + - - - - - + + + + + - - + - - + - - + + + - - - - - + + + + + + - - + + - - - - - - + + + + + - - - - - + + + + + - + - + - + - + - + - + - + - + - + - - - + + + + + + + + + + + + + - - - - - - + + + + + - + - + - - - + + + - + - - - + + + - + - + - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + - + - + + - - - + + - + + - - - + + + + + + + + + + + + - + + - + + - - - + + + + + + + + + + + - + + - - - + + - - - - - - - - - - + + - - - + + - + - - - + + + - + - - - + + + - + - + - + - + - + - - + + - - + + - - + + - - + + - + - + + - - - + + - - - - - - - - - - + + - - - + + - + - - + - - + + + - - + + + + + + + + + + - - + + + - + - - + - - + + + - - + + + + + + + + + + - - + + + - + - - - + + + - + - - - + + + - + - - - - - - - - - - - - + - - + + + - + - + - - - + + + - + - - - + + + - - - - + + + + + + + + + + + + + + + - - - + + + - + @@ -4142,7 +3498,7 @@

Total time: 63.34

- + @@ -4151,18 +3507,18 @@

Total time: 63.34

- + - + - + - + @@ -4170,7 +3526,7 @@

Total time: 63.34

- + @@ -4179,16 +3535,16 @@

Total time: 63.34

- + - + - + @@ -4198,7 +3554,7 @@

Total time: 63.34

- + @@ -4207,1334 +3563,1362 @@

Total time: 63.34

- + - + - - + + - - - - - + + + + + - - - - + + + + + + + + + + + + + - + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - + - - + + - - - - - - - - - - - - - + + + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + - - - + + + + - - + + + + - - - - - - - - - - + + + + + + + - - - + + - - - - - - + + + + + + + + - - + + + - + + + + + + - - - - + + + + + + - - - - - - + + - - - - - - + - + + - - - - - + + + + + + + + + + + - - - - - - - + + + + + - - + + + + + + + + + + + + - - - - - - + + + + + - - + + + - - + + + + + + + - - - + + - - + + - - + + + + + + - - + + - + - - + + - - - - - - - - - + - - - - - - - - + - - - - - + + - + + + - + + + + + + + + + + - - - - - + + + + + + - - - - - - + + + + + + + + + + + + - - - + - - - + + + + + + - - - + + + + + + - + - - - - - - - - - - - - - - + + - - + + - - + + + + + + + + + + - - - - - - + + + + - - - - - - - + + + - - + - - - - - - - - + + + - + + + + + + + - - - + + + + + + + + + + + + + - - - - - + + - - + - + - - - - + + - - + + + + + + - - + + + + - - - - + - - - - - + + - - - + + + - - + + + + + + + + + + + - - - - + + + + + + - + + + - - - - - - + + + + - - - - - - - - - + + + - - - - - - + - - - - - + - - - - - - - + - - - + - - + + + + + + + + - + + + + - - + + + + - - - - - + + - - - - + + + + + + + - - - + - + + - - - - - - + + + + - - - - + + + + - - - - - - - - - + + + - - - - + + + + + + + + + + - + + - - + + - - - - + - + + + - + + - - - + - - - + + + + + + + + + + + + + - - - - + + + + + + + + - + - - + - - - - + + - - + + + - + + - - - - - + + + - + + + - - - - - + + + + + + - - - + + + - - - + + - + - - - - + - - - + + + + + + + + - + + + + - - - - + + + - + - + + + + + + - + - - - - - + + + + - - - - - - - - - - - - + + + + + + + + + + + + + - + + - - - - + + + + + + - + - - - - + + + + - + + + - + - + - - + + + - - - - - - - - + - - + + + + + + + + + + + - - + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + - - + + + - - - + + + - + - - - - - - - - + + + + + - + - - - - - - - + + + + - + + - + - - + + - - - + - - + + + + + - - - + + + + - + + - - - - + + - - @@ -5546,36 +4930,39 @@

Total time: 63.34

+ - + - - + + + + - + @@ -5586,11 +4973,11 @@

Total time: 63.34

- + @@ -5604,11 +4991,8 @@

Total time: 63.34

- - - @@ -5619,8 +5003,8 @@

Total time: 63.34

+ - @@ -5629,6 +5013,7 @@

Total time: 63.34

+ @@ -5636,25 +5021,25 @@

Total time: 63.34

+ + - - - + @@ -5666,9 +5051,9 @@

Total time: 63.34

- + @@ -5677,6 +5062,7 @@

Total time: 63.34

+ From ded40a7bbe798456493e104eb958be1425de01d7 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Tue, 15 Jan 2019 13:39:08 -0700 Subject: [PATCH 34/93] bump to 3.9.0.pre --- lib/protobuf/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protobuf/version.rb b/lib/protobuf/version.rb index 9a70aa66..34d7e5fc 100644 --- a/lib/protobuf/version.rb +++ b/lib/protobuf/version.rb @@ -1,3 +1,3 @@ module Protobuf - VERSION = '3.8.5' # rubocop:disable Style/MutableConstant + VERSION = '3.9.0.pre' # rubocop:disable Style/MutableConstant end From b0c3c3ebd36f02589f5a57e38f0f327f7c5e29eb Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Wed, 16 Jan 2019 09:04:31 -0700 Subject: [PATCH 35/93] only use boolean check when not repeated --- lib/protobuf/field/base_field.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protobuf/field/base_field.rb b/lib/protobuf/field/base_field.rb index 66b5076b..6f2f4f7f 100644 --- a/lib/protobuf/field/base_field.rb +++ b/lib/protobuf/field/base_field.rb @@ -145,7 +145,7 @@ def field?(values) end def define_field_and_present_predicate! - @field_and_present_predicate = if type_class == ::Protobuf::Field::BoolField # boolean present check + @field_and_present_predicate = if !repeated? && type_class == ::Protobuf::Field::BoolField # boolean present check OBJECT_MODULE::BoolFieldAndPresentPredicate.new(self) else OBJECT_MODULE::BaseFieldAndPresentPredicate.new(self) From a01a4d1f4c291682ab6d398be736ebd75c1769c6 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Wed, 16 Jan 2019 09:04:57 -0700 Subject: [PATCH 36/93] bump to pre2 --- lib/protobuf/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protobuf/version.rb b/lib/protobuf/version.rb index 34d7e5fc..635d6204 100644 --- a/lib/protobuf/version.rb +++ b/lib/protobuf/version.rb @@ -1,3 +1,3 @@ module Protobuf - VERSION = '3.9.0.pre' # rubocop:disable Style/MutableConstant + VERSION = '3.9.0.pre2' # rubocop:disable Style/MutableConstant end From 6d82a30e718e0a8a7ff36e624569d7f79d3e773b Mon Sep 17 00:00:00 2001 From: Marcos Minond Date: Thu, 31 Jan 2019 16:53:11 -0700 Subject: [PATCH 37/93] adding tracing --- lib/protobuf/rpc/client.rb | 7 +++++-- lib/protobuf/rpc/connectors/base.rb | 10 +++++++++- lib/protobuf/rpc/middleware/request_decoder.rb | 16 +++++++++++++++- lib/protobuf/rpc/rpc.pb.rb | 9 +++++++++ proto/rpc.proto | 11 +++++++++++ protobuf.gemspec | 1 + 6 files changed, 50 insertions(+), 4 deletions(-) diff --git a/lib/protobuf/rpc/client.rb b/lib/protobuf/rpc/client.rb index 74791d23..4baa8504 100644 --- a/lib/protobuf/rpc/client.rb +++ b/lib/protobuf/rpc/client.rb @@ -105,7 +105,8 @@ def on_success=(callable) def method_missing(method_name, *params) service = options[:service] if service.rpc_method?(method_name) - logger.debug { sign_message("#{service.name}##{method_name}") } + operation = "#{service.name}##{method_name}" + logger.debug { sign_message(operation) } rpc = service.rpcs[method_name.to_sym] options[:request_type] = rpc.request_type @@ -126,7 +127,9 @@ def method_missing(method_name, *params) logger.debug { sign_message("no block given for callbacks") } end - send_request + ::OpenTracing.start_active_span(operation) do |scope| + send_request + end else logger.error { sign_message("#{service.name}##{method_name} not rpc method, passing to super") } super(method_name, *params) diff --git a/lib/protobuf/rpc/connectors/base.rb b/lib/protobuf/rpc/connectors/base.rb index 2e9c76ba..39127b1a 100644 --- a/lib/protobuf/rpc/connectors/base.rb +++ b/lib/protobuf/rpc/connectors/base.rb @@ -4,6 +4,7 @@ require 'protobuf/rpc/buffer' require 'protobuf/rpc/error' require 'protobuf/rpc/stat' +require 'json' module Protobuf module Rpc @@ -138,11 +139,18 @@ def ping_port_enabled? end def request_bytes + trace_carrier = {} + ::OpenTracing.inject(::OpenTracing.active_span.context, + ::OpenTracing::FORMAT_TEXT_MAP, + trace_carrier) + trace = ::Protobuf::Socketrpc::Trace.new(:raw => JSON.generate(trace_carrier)) + validate_request_type! fields = { :service_name => @options[:service].name, :method_name => @options[:method].to_s, :request_proto => @options[:request], - :caller => request_caller } + :caller => request_caller, + :trace => trace } return ::Protobuf::Socketrpc::Request.encode(fields) rescue => e diff --git a/lib/protobuf/rpc/middleware/request_decoder.rb b/lib/protobuf/rpc/middleware/request_decoder.rb index 45469883..99c108df 100644 --- a/lib/protobuf/rpc/middleware/request_decoder.rb +++ b/lib/protobuf/rpc/middleware/request_decoder.rb @@ -28,7 +28,16 @@ def _call(env) env.request_type = rpc_method.request_type env.response_type = rpc_method.response_type - app.call(env) + operation = "#{service_name}##{method_name}" + trace = ::OpenTracing.extract(::OpenTracing::FORMAT_TEXT_MAP, trace_context) + + # return app.call(env) if trace.nil? + + result = nil + ::OpenTracing.start_active_span(operation, :child_of => trace) do |scope| + result = app.call(env) + end + result end def log_signature @@ -51,6 +60,11 @@ def request raise BadRequestData, "Unable to decode request: #{exception.message}" end + def trace_context + return nil if request_wrapper.trace.nil? # XXX test + @trace_context ||= JSON.parse(request_wrapper.trace.raw) + end + # Decode the incoming request object into our expected request object # def request_wrapper diff --git a/lib/protobuf/rpc/rpc.pb.rb b/lib/protobuf/rpc/rpc.pb.rb index eaea971f..c88a3c28 100644 --- a/lib/protobuf/rpc/rpc.pb.rb +++ b/lib/protobuf/rpc/rpc.pb.rb @@ -31,6 +31,7 @@ class ErrorReason < ::Protobuf::Enum # class Request < ::Protobuf::Message; end class Response < ::Protobuf::Message; end + class Trace < ::Protobuf::Message; end ## @@ -41,6 +42,9 @@ class Request required :string, :method_name, 2 optional :bytes, :request_proto, 3 optional :string, :caller, 4 + # Extension Fields + extensions 200...536870912 + optional ::Protobuf::Socketrpc::Trace, :".protobuf.socketrpc.Request.trace", 200, :extension => true end class Response @@ -51,6 +55,11 @@ class Response optional :string, :server, 5 end + class Trace + optional :string, :type, 1 + optional :bytes, :raw, 2 + end + end end diff --git a/proto/rpc.proto b/proto/rpc.proto index 17a1e350..52061aba 100644 --- a/proto/rpc.proto +++ b/proto/rpc.proto @@ -26,10 +26,16 @@ package protobuf.socketrpc; message Request { + extensions 200 to max; + required string service_name = 1; // Fully- qualified Service class name required string method_name = 2; // Service method to invoke optional bytes request_proto = 3; // Serialized request bytes optional string caller = 4; // Calling hostname or address + + extend Request { + optional Trace trace = 200; + } } message Response @@ -41,6 +47,11 @@ message Response optional string server = 5; // Server hostname or address } +message Trace { + optional string type = 1; + optional bytes raw = 2; +} + // Possible error reasons // The server-side errors are returned in the response from the server. // The client-side errors are returned by the client-side code when it doesn't diff --git a/protobuf.gemspec b/protobuf.gemspec index 624a43eb..598c28c5 100644 --- a/protobuf.gemspec +++ b/protobuf.gemspec @@ -23,6 +23,7 @@ require "protobuf/version" active_support_max_version = "< 5" if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.2.2") s.add_dependency "activesupport", '>= 3.2', active_support_max_version s.add_dependency 'middleware' + s.add_dependency 'opentracing' s.add_dependency 'thor' s.add_dependency 'thread_safe' From 220da508b9f6309ecfe50f5bde1a91b2fe643f00 Mon Sep 17 00:00:00 2001 From: Nephi Allred Date: Mon, 4 Feb 2019 11:48:36 -0700 Subject: [PATCH 38/93] Changed trace injection/extraction format to binary --- lib/protobuf/rpc/connectors/base.rb | 7 +++---- lib/protobuf/rpc/middleware/request_decoder.rb | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/protobuf/rpc/connectors/base.rb b/lib/protobuf/rpc/connectors/base.rb index 39127b1a..e424ca69 100644 --- a/lib/protobuf/rpc/connectors/base.rb +++ b/lib/protobuf/rpc/connectors/base.rb @@ -4,7 +4,6 @@ require 'protobuf/rpc/buffer' require 'protobuf/rpc/error' require 'protobuf/rpc/stat' -require 'json' module Protobuf module Rpc @@ -139,11 +138,11 @@ def ping_port_enabled? end def request_bytes - trace_carrier = {} + trace_carrier = "" ::OpenTracing.inject(::OpenTracing.active_span.context, - ::OpenTracing::FORMAT_TEXT_MAP, + ::OpenTracing::FORMAT_BINARY, trace_carrier) - trace = ::Protobuf::Socketrpc::Trace.new(:raw => JSON.generate(trace_carrier)) + trace = ::Protobuf::Socketrpc::Trace.new(:raw => trace_carrier) validate_request_type! fields = { :service_name => @options[:service].name, diff --git a/lib/protobuf/rpc/middleware/request_decoder.rb b/lib/protobuf/rpc/middleware/request_decoder.rb index 99c108df..6bcd6461 100644 --- a/lib/protobuf/rpc/middleware/request_decoder.rb +++ b/lib/protobuf/rpc/middleware/request_decoder.rb @@ -29,7 +29,7 @@ def _call(env) env.response_type = rpc_method.response_type operation = "#{service_name}##{method_name}" - trace = ::OpenTracing.extract(::OpenTracing::FORMAT_TEXT_MAP, trace_context) + trace = ::OpenTracing.extract(::OpenTracing::FORMAT_BINARY, trace_context) # return app.call(env) if trace.nil? @@ -62,7 +62,7 @@ def request def trace_context return nil if request_wrapper.trace.nil? # XXX test - @trace_context ||= JSON.parse(request_wrapper.trace.raw) + @trace_context ||= request_wrapper.trace.raw.to_s end # Decode the incoming request object into our expected request object From 7653155dec0d71837807e8939d917d442eacec83 Mon Sep 17 00:00:00 2001 From: Marcos Minond Date: Tue, 5 Feb 2019 16:37:08 -0700 Subject: [PATCH 39/93] moving request decoder logic out of this gem and into another middleware gem --- lib/protobuf/rpc/env.rb | 1 + lib/protobuf/rpc/middleware/request_decoder.rb | 12 ++---------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/protobuf/rpc/env.rb b/lib/protobuf/rpc/env.rb index cf6aea60..3d7c166e 100644 --- a/lib/protobuf/rpc/env.rb +++ b/lib/protobuf/rpc/env.rb @@ -41,6 +41,7 @@ def self.hash_accessor(*names) #:nodoc: :method_name, :request, :request_type, + :request_wrapper, :response, :response_type, :rpc_method, diff --git a/lib/protobuf/rpc/middleware/request_decoder.rb b/lib/protobuf/rpc/middleware/request_decoder.rb index 6bcd6461..396b41ac 100644 --- a/lib/protobuf/rpc/middleware/request_decoder.rb +++ b/lib/protobuf/rpc/middleware/request_decoder.rb @@ -21,6 +21,7 @@ def _call(env) env.service_name = service_name env.method_name = method_name env.request = request + env.request_wrapper = request_wrapper env.client_host = request_wrapper.caller env.rpc_service = service @@ -28,16 +29,7 @@ def _call(env) env.request_type = rpc_method.request_type env.response_type = rpc_method.response_type - operation = "#{service_name}##{method_name}" - trace = ::OpenTracing.extract(::OpenTracing::FORMAT_BINARY, trace_context) - - # return app.call(env) if trace.nil? - - result = nil - ::OpenTracing.start_active_span(operation, :child_of => trace) do |scope| - result = app.call(env) - end - result + app.call(env) end def log_signature From e8a2bf6011d037456706780686ed57865cbe3b69 Mon Sep 17 00:00:00 2001 From: Brandon Dewitt Date: Tue, 5 Feb 2019 18:47:39 -0700 Subject: [PATCH 40/93] bump to 3.9.0 --- lib/protobuf/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protobuf/version.rb b/lib/protobuf/version.rb index 635d6204..8d43f2bf 100644 --- a/lib/protobuf/version.rb +++ b/lib/protobuf/version.rb @@ -1,3 +1,3 @@ module Protobuf - VERSION = '3.9.0.pre2' # rubocop:disable Style/MutableConstant + VERSION = '3.9.0' # rubocop:disable Style/MutableConstant end From 119414766edcd4a444da8cf6e00726348e0ea604 Mon Sep 17 00:00:00 2001 From: Marcos Minond Date: Wed, 6 Feb 2019 12:13:31 -0700 Subject: [PATCH 41/93] removing tracing from client --- lib/protobuf/rpc/connectors/base.rb | 9 +-------- protobuf.gemspec | 1 - 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/protobuf/rpc/connectors/base.rb b/lib/protobuf/rpc/connectors/base.rb index e424ca69..2e9c76ba 100644 --- a/lib/protobuf/rpc/connectors/base.rb +++ b/lib/protobuf/rpc/connectors/base.rb @@ -138,18 +138,11 @@ def ping_port_enabled? end def request_bytes - trace_carrier = "" - ::OpenTracing.inject(::OpenTracing.active_span.context, - ::OpenTracing::FORMAT_BINARY, - trace_carrier) - trace = ::Protobuf::Socketrpc::Trace.new(:raw => trace_carrier) - validate_request_type! fields = { :service_name => @options[:service].name, :method_name => @options[:method].to_s, :request_proto => @options[:request], - :caller => request_caller, - :trace => trace } + :caller => request_caller } return ::Protobuf::Socketrpc::Request.encode(fields) rescue => e diff --git a/protobuf.gemspec b/protobuf.gemspec index 598c28c5..624a43eb 100644 --- a/protobuf.gemspec +++ b/protobuf.gemspec @@ -23,7 +23,6 @@ require "protobuf/version" active_support_max_version = "< 5" if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.2.2") s.add_dependency "activesupport", '>= 3.2', active_support_max_version s.add_dependency 'middleware' - s.add_dependency 'opentracing' s.add_dependency 'thor' s.add_dependency 'thread_safe' From dfad4eed44f7e96b333f020516812b2960129bb2 Mon Sep 17 00:00:00 2001 From: Marcos Minond Date: Wed, 6 Feb 2019 12:36:46 -0700 Subject: [PATCH 42/93] removing tracing from client and decoder --- lib/protobuf/rpc/client.rb | 7 ++----- lib/protobuf/rpc/middleware/request_decoder.rb | 5 ----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/protobuf/rpc/client.rb b/lib/protobuf/rpc/client.rb index 4baa8504..74791d23 100644 --- a/lib/protobuf/rpc/client.rb +++ b/lib/protobuf/rpc/client.rb @@ -105,8 +105,7 @@ def on_success=(callable) def method_missing(method_name, *params) service = options[:service] if service.rpc_method?(method_name) - operation = "#{service.name}##{method_name}" - logger.debug { sign_message(operation) } + logger.debug { sign_message("#{service.name}##{method_name}") } rpc = service.rpcs[method_name.to_sym] options[:request_type] = rpc.request_type @@ -127,9 +126,7 @@ def method_missing(method_name, *params) logger.debug { sign_message("no block given for callbacks") } end - ::OpenTracing.start_active_span(operation) do |scope| - send_request - end + send_request else logger.error { sign_message("#{service.name}##{method_name} not rpc method, passing to super") } super(method_name, *params) diff --git a/lib/protobuf/rpc/middleware/request_decoder.rb b/lib/protobuf/rpc/middleware/request_decoder.rb index 396b41ac..c4efe823 100644 --- a/lib/protobuf/rpc/middleware/request_decoder.rb +++ b/lib/protobuf/rpc/middleware/request_decoder.rb @@ -52,11 +52,6 @@ def request raise BadRequestData, "Unable to decode request: #{exception.message}" end - def trace_context - return nil if request_wrapper.trace.nil? # XXX test - @trace_context ||= request_wrapper.trace.raw.to_s - end - # Decode the incoming request object into our expected request object # def request_wrapper From b1563a37cd636fbd9516a139cbeb279fe1ea65d9 Mon Sep 17 00:00:00 2001 From: Marcos Minond Date: Thu, 7 Feb 2019 14:03:01 -0700 Subject: [PATCH 43/93] moving to map of headers --- lib/protobuf/rpc/rpc.pb.rb | 9 +++++++-- proto/rpc.proto | 8 ++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/protobuf/rpc/rpc.pb.rb b/lib/protobuf/rpc/rpc.pb.rb index c88a3c28..d1b2b441 100644 --- a/lib/protobuf/rpc/rpc.pb.rb +++ b/lib/protobuf/rpc/rpc.pb.rb @@ -32,6 +32,7 @@ class ErrorReason < ::Protobuf::Enum class Request < ::Protobuf::Message; end class Response < ::Protobuf::Message; end class Trace < ::Protobuf::Message; end + class MapEntry < ::Protobuf::Message; end ## @@ -56,8 +57,12 @@ class Response end class Trace - optional :string, :type, 1 - optional :bytes, :raw, 2 + repeated ::Protobuf::Socketrpc::MapEntry, :headers, 1 + end + + class MapEntry + optional :string, :key, 1 + optional :string, :value, 2 end end diff --git a/proto/rpc.proto b/proto/rpc.proto index 52061aba..22671154 100644 --- a/proto/rpc.proto +++ b/proto/rpc.proto @@ -48,8 +48,12 @@ message Response } message Trace { - optional string type = 1; - optional bytes raw = 2; + repeated MapEntry headers = 1; +} + +message MapEntry { + optional string key = 1; + optional string value = 2; } // Possible error reasons From beb9d4e5c290fe4abab4cd2eb585d93e46d89e1f Mon Sep 17 00:00:00 2001 From: Marcos Minond Date: Fri, 8 Feb 2019 14:11:41 -0700 Subject: [PATCH 44/93] moving to request headers --- lib/protobuf/rpc/rpc.pb.rb | 13 ++++--------- proto/rpc.proto | 13 +++---------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/lib/protobuf/rpc/rpc.pb.rb b/lib/protobuf/rpc/rpc.pb.rb index d1b2b441..741d6999 100644 --- a/lib/protobuf/rpc/rpc.pb.rb +++ b/lib/protobuf/rpc/rpc.pb.rb @@ -31,8 +31,7 @@ class ErrorReason < ::Protobuf::Enum # class Request < ::Protobuf::Message; end class Response < ::Protobuf::Message; end - class Trace < ::Protobuf::Message; end - class MapEntry < ::Protobuf::Message; end + class Header < ::Protobuf::Message; end ## @@ -43,9 +42,9 @@ class Request required :string, :method_name, 2 optional :bytes, :request_proto, 3 optional :string, :caller, 4 + repeated ::Protobuf::Socketrpc::Header, :headers, 5 # Extension Fields extensions 200...536870912 - optional ::Protobuf::Socketrpc::Trace, :".protobuf.socketrpc.Request.trace", 200, :extension => true end class Response @@ -56,12 +55,8 @@ class Response optional :string, :server, 5 end - class Trace - repeated ::Protobuf::Socketrpc::MapEntry, :headers, 1 - end - - class MapEntry - optional :string, :key, 1 + class Header + required :string, :key, 1 optional :string, :value, 2 end diff --git a/proto/rpc.proto b/proto/rpc.proto index 22671154..dce4586c 100644 --- a/proto/rpc.proto +++ b/proto/rpc.proto @@ -32,10 +32,7 @@ message Request required string method_name = 2; // Service method to invoke optional bytes request_proto = 3; // Serialized request bytes optional string caller = 4; // Calling hostname or address - - extend Request { - optional Trace trace = 200; - } + repeated Header headers = 5; // General purpose request headers } message Response @@ -47,12 +44,8 @@ message Response optional string server = 5; // Server hostname or address } -message Trace { - repeated MapEntry headers = 1; -} - -message MapEntry { - optional string key = 1; +message Header { + required string key = 1; optional string value = 2; } From 0796277076017953c36d439881ed0d144cab4b0c Mon Sep 17 00:00:00 2001 From: Marcos Minond Date: Fri, 8 Feb 2019 14:13:12 -0700 Subject: [PATCH 45/93] removing extension bounds --- lib/protobuf/rpc/rpc.pb.rb | 2 -- proto/rpc.proto | 2 -- 2 files changed, 4 deletions(-) diff --git a/lib/protobuf/rpc/rpc.pb.rb b/lib/protobuf/rpc/rpc.pb.rb index 741d6999..0d2937a7 100644 --- a/lib/protobuf/rpc/rpc.pb.rb +++ b/lib/protobuf/rpc/rpc.pb.rb @@ -43,8 +43,6 @@ class Request optional :bytes, :request_proto, 3 optional :string, :caller, 4 repeated ::Protobuf::Socketrpc::Header, :headers, 5 - # Extension Fields - extensions 200...536870912 end class Response diff --git a/proto/rpc.proto b/proto/rpc.proto index dce4586c..f496139e 100644 --- a/proto/rpc.proto +++ b/proto/rpc.proto @@ -26,8 +26,6 @@ package protobuf.socketrpc; message Request { - extensions 200 to max; - required string service_name = 1; // Fully- qualified Service class name required string method_name = 2; // Service method to invoke optional bytes request_proto = 3; // Serialized request bytes From 996f4f40f0ee0ca15269257483c1c6eea9fc72de Mon Sep 17 00:00:00 2001 From: Marcos Minond Date: Mon, 18 Mar 2019 13:49:26 -0600 Subject: [PATCH 46/93] Creating request fields in new Base#request_fields method. --- lib/protobuf/rpc/connectors/base.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/protobuf/rpc/connectors/base.rb b/lib/protobuf/rpc/connectors/base.rb index 2e9c76ba..f248f253 100644 --- a/lib/protobuf/rpc/connectors/base.rb +++ b/lib/protobuf/rpc/connectors/base.rb @@ -137,14 +137,16 @@ def ping_port_enabled? ENV.key?("PB_RPC_PING_PORT") end + def request_fields + { :service_name => @options[:service].name, + :method_name => @options[:method].to_s, + :request_proto => @options[:request], + :caller => request_caller } + end + def request_bytes validate_request_type! - fields = { :service_name => @options[:service].name, - :method_name => @options[:method].to_s, - :request_proto => @options[:request], - :caller => request_caller } - - return ::Protobuf::Socketrpc::Request.encode(fields) + return ::Protobuf::Socketrpc::Request.encode(request_fields) rescue => e failure(:INVALID_REQUEST_PROTO, "Could not set request proto: #{e.message}") end From 8d6c7ce4dc9c48a64ac284ff2d6bec06b1a8bbcf Mon Sep 17 00:00:00 2001 From: Marcos Minond Date: Mon, 18 Mar 2019 14:26:43 -0600 Subject: [PATCH 47/93] Alphabetically sorting class methods --- lib/protobuf/rpc/connectors/base.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/protobuf/rpc/connectors/base.rb b/lib/protobuf/rpc/connectors/base.rb index f248f253..bb1c084e 100644 --- a/lib/protobuf/rpc/connectors/base.rb +++ b/lib/protobuf/rpc/connectors/base.rb @@ -137,13 +137,6 @@ def ping_port_enabled? ENV.key?("PB_RPC_PING_PORT") end - def request_fields - { :service_name => @options[:service].name, - :method_name => @options[:method].to_s, - :request_proto => @options[:request], - :caller => request_caller } - end - def request_bytes validate_request_type! return ::Protobuf::Socketrpc::Request.encode(request_fields) @@ -155,6 +148,13 @@ def request_caller @options[:client_host] || ::Protobuf.client_host end + def request_fields + { :service_name => @options[:service].name, + :method_name => @options[:method].to_s, + :request_proto => @options[:request], + :caller => request_caller } + end + def send_request fail 'If you inherit a Connector from Base you must implement send_request' end From a2448e4df3fad0650c49655517d4fe141129e1dd Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Mon, 18 Mar 2019 17:32:10 -0400 Subject: [PATCH 48/93] Bump version to 3.10.0 --- lib/protobuf/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protobuf/version.rb b/lib/protobuf/version.rb index 8d43f2bf..9a551198 100644 --- a/lib/protobuf/version.rb +++ b/lib/protobuf/version.rb @@ -1,3 +1,3 @@ module Protobuf - VERSION = '3.9.0' # rubocop:disable Style/MutableConstant + VERSION = '3.10.0' # rubocop:disable Style/MutableConstant end From a2e0cbb783d49d37648c07d795dc4f7eb8d14eb1 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Mon, 18 Mar 2019 17:33:46 -0400 Subject: [PATCH 49/93] Update changelog --- CHANGES.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 2677938a..1577e709 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,14 @@ # Stable (3.8.x) + +3.10.0 +------ +- Add headers to request proto + +3.9.0 +----- +- Performance improvements + 3.8.0 ----- - Map types now supported (#367) From 0f03ed27fd28372675c7c3ed26188acbb1bbe8e5 Mon Sep 17 00:00:00 2001 From: Steve Newell Date: Mon, 26 Aug 2019 10:33:01 -0600 Subject: [PATCH 50/93] Add error reason to logs The error status will only be set in ::Protobuf::Rpc::Connectors::Base#failure method. Otherwise it will default to NONE. --- lib/protobuf/rpc/connectors/base.rb | 3 ++- lib/protobuf/rpc/stat.rb | 24 ++++++++++++++++++++++-- proto/rpc.proto | 1 + 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/lib/protobuf/rpc/connectors/base.rb b/lib/protobuf/rpc/connectors/base.rb index bb1c084e..969d777c 100644 --- a/lib/protobuf/rpc/connectors/base.rb +++ b/lib/protobuf/rpc/connectors/base.rb @@ -63,8 +63,9 @@ def data_callback(data) # @param [String] message The error message def failure(code, message) @error = ClientError.new - @error.code = ::Protobuf::Socketrpc::ErrorReason.fetch(code) + @stats.status = @error.code = ::Protobuf::Socketrpc::ErrorReason.fetch(code) @error.message = message + logger.debug { sign_message("Server failed request (invoking on_failure): #{@error.inspect}") } @failure_cb.call(@error) unless @failure_cb.nil? diff --git a/lib/protobuf/rpc/stat.rb b/lib/protobuf/rpc/stat.rb index 18d0eff6..3eaf9499 100644 --- a/lib/protobuf/rpc/stat.rb +++ b/lib/protobuf/rpc/stat.rb @@ -1,20 +1,36 @@ require 'date' require 'time' require 'protobuf/logging' +require 'protobuf/rpc/rpc.pb' module Protobuf module Rpc class Stat attr_accessor :mode, :start_time, :end_time, :request_size, :dispatcher - attr_accessor :response_size, :client, :service, :method_name + attr_accessor :response_size, :client, :service, :method_name, :status attr_reader :server MODES = [:SERVER, :CLIENT].freeze + ERROR_TRANSLATIONS = { + ::Protobuf::Socketrpc::ErrorReason::NONE => "OK", + ::Protobuf::Socketrpc::ErrorReason::BAD_REQUEST_DATA => "BAD_REQUEST_DATA", + ::Protobuf::Socketrpc::ErrorReason::BAD_REQUEST_PROTO => "BAD_REQUEST_PROTO", + ::Protobuf::Socketrpc::ErrorReason::SERVICE_NOT_FOUND => "SERVICE_NOT_FOUND", + ::Protobuf::Socketrpc::ErrorReason::METHOD_NOT_FOUND => "METHOD_NOT_FOUND", + ::Protobuf::Socketrpc::ErrorReason::RPC_ERROR => "RPC_ERROR", + ::Protobuf::Socketrpc::ErrorReason::RPC_FAILED => "RPC_FAILED", + ::Protobuf::Socketrpc::ErrorReason::INVALID_REQUEST_PROTO => "INVALID_REQUEST_PROTO", + ::Protobuf::Socketrpc::ErrorReason::BAD_RESPONSE_PROTO => "BAD_RESPONSE_PROTO", + ::Protobuf::Socketrpc::ErrorReason::UNKNOWN_HOST => "UNKNOWN_HOST", + ::Protobuf::Socketrpc::ErrorReason::IO_ERROR => "IO_ERROR", + } + def initialize(mode = :SERVER) @mode = mode @request_size = 0 @response_size = 0 + @status = ::Protobuf::Socketrpc::ErrorReason::NONE # default to NONE and only set if error occurs start end @@ -78,6 +94,10 @@ def client? @mode == :CLIENT end + def status_string + ERROR_TRANSLATIONS.fetch(status, "UNKNOWN_ERROR") + end + def to_s [ server? ? "[SRV]" : "[CLT]", @@ -86,6 +106,7 @@ def to_s rpc, sizes, elapsed_time, + status_string, @end_time.try(:iso8601), ].compact.join(' - ') end @@ -93,7 +114,6 @@ def to_s def trace_id ::Thread.current.object_id.to_s(16) end - end end end diff --git a/proto/rpc.proto b/proto/rpc.proto index f496139e..353a1e1d 100644 --- a/proto/rpc.proto +++ b/proto/rpc.proto @@ -66,4 +66,5 @@ enum ErrorReason BAD_RESPONSE_PROTO = 7; // Server returned a bad response proto UNKNOWN_HOST = 8; // Could not find supplied host IO_ERROR = 9; // I/O error while communicating with server + NONE = 10000; // No error. Typically not used. This is a placeholder to remind us not to use this value. } From 3557e4b98cf8196582c6fb96b48426fcec37d162 Mon Sep 17 00:00:00 2001 From: Steve Newell Date: Tue, 27 Aug 2019 10:40:46 -0600 Subject: [PATCH 51/93] remove enum NONE --- lib/protobuf/rpc/stat.rb | 4 ++-- proto/rpc.proto | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/protobuf/rpc/stat.rb b/lib/protobuf/rpc/stat.rb index 3eaf9499..20a5ca8a 100644 --- a/lib/protobuf/rpc/stat.rb +++ b/lib/protobuf/rpc/stat.rb @@ -13,7 +13,6 @@ class Stat MODES = [:SERVER, :CLIENT].freeze ERROR_TRANSLATIONS = { - ::Protobuf::Socketrpc::ErrorReason::NONE => "OK", ::Protobuf::Socketrpc::ErrorReason::BAD_REQUEST_DATA => "BAD_REQUEST_DATA", ::Protobuf::Socketrpc::ErrorReason::BAD_REQUEST_PROTO => "BAD_REQUEST_PROTO", ::Protobuf::Socketrpc::ErrorReason::SERVICE_NOT_FOUND => "SERVICE_NOT_FOUND", @@ -30,7 +29,6 @@ def initialize(mode = :SERVER) @mode = mode @request_size = 0 @response_size = 0 - @status = ::Protobuf::Socketrpc::ErrorReason::NONE # default to NONE and only set if error occurs start end @@ -95,6 +93,8 @@ def client? end def status_string + return "OK" if status.nil? + ERROR_TRANSLATIONS.fetch(status, "UNKNOWN_ERROR") end diff --git a/proto/rpc.proto b/proto/rpc.proto index 353a1e1d..f496139e 100644 --- a/proto/rpc.proto +++ b/proto/rpc.proto @@ -66,5 +66,4 @@ enum ErrorReason BAD_RESPONSE_PROTO = 7; // Server returned a bad response proto UNKNOWN_HOST = 8; // Could not find supplied host IO_ERROR = 9; // I/O error while communicating with server - NONE = 10000; // No error. Typically not used. This is a placeholder to remind us not to use this value. } From ceba333492a60165dd68a0b92817453831e9421a Mon Sep 17 00:00:00 2001 From: Steve Newell Date: Tue, 27 Aug 2019 13:55:18 -0600 Subject: [PATCH 52/93] update/fix specs --- spec/lib/protobuf/rpc/connectors/base_spec.rb | 10 +++---- spec/lib/protobuf/rpc/stat_spec.rb | 27 ++++++++++++++++--- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/spec/lib/protobuf/rpc/connectors/base_spec.rb b/spec/lib/protobuf/rpc/connectors/base_spec.rb index e5890307..32b8cd8b 100644 --- a/spec/lib/protobuf/rpc/connectors/base_spec.rb +++ b/spec/lib/protobuf/rpc/connectors/base_spec.rb @@ -187,14 +187,14 @@ shared_examples "a ConnectorDisposition" do |meth, cb, *args| it "calls #complete before exit" do - subject.stats = double("Object", :stop => true) + subject.stats = ::Protobuf::Rpc::Stat.new(:stop => true) expect(subject).to receive(:complete) subject.method(meth).call(*args) end it "calls the #{cb} callback when provided" do - stats = double("Object") + stats = ::Protobuf::Rpc::Stat.new allow(stats).to receive(:stop).and_return(true) subject.stats = stats some_cb = double("Object") @@ -205,7 +205,7 @@ end it "calls the complete callback when provided" do - stats = double("Object") + stats = ::Protobuf::Rpc::Stat.new allow(stats).to receive(:stop).and_return(true) subject.stats = stats comp_cb = double("Object") @@ -217,8 +217,8 @@ end - it_behaves_like("a ConnectorDisposition", :failure, "failure_cb", "code", "message") - it_behaves_like("a ConnectorDisposition", :failure, "complete_cb", "code", "message") + it_behaves_like("a ConnectorDisposition", :failure, "failure_cb", :RPC_ERROR, "message") + it_behaves_like("a ConnectorDisposition", :failure, "complete_cb", :RPC_ERROR, "message") it_behaves_like("a ConnectorDisposition", :succeed, "complete_cb", "response") it_behaves_like("a ConnectorDisposition", :succeed, "success_cb", "response") it_behaves_like("a ConnectorDisposition", :complete, "complete_cb") diff --git a/spec/lib/protobuf/rpc/stat_spec.rb b/spec/lib/protobuf/rpc/stat_spec.rb index 2b6c6011..9abd627f 100644 --- a/spec/lib/protobuf/rpc/stat_spec.rb +++ b/spec/lib/protobuf/rpc/stat_spec.rb @@ -33,7 +33,7 @@ ::Timecop.freeze(1.62.seconds.from_now) do stats.stop - expect(stats.to_s).to eq "[SRV] - myserver1 - #{stats.trace_id} - BarService#find_bars - 43B/1302B - 1.62s - #{::Time.now.iso8601}" + expect(stats.to_s).to eq "[SRV] - myserver1 - #{stats.trace_id} - BarService#find_bars - 43B/1302B - 1.62s - OK - #{::Time.now.iso8601}" end end end @@ -44,7 +44,7 @@ stats.client = 'myserver1' stats.dispatcher = double('dispatcher', :service => BarService.new(:find_bars)) stats.request_size = 43 - expect(stats.to_s).to eq "[SRV] - myserver1 - #{stats.trace_id} - BarService#find_bars - 43B/-" + expect(stats.to_s).to eq "[SRV] - myserver1 - #{stats.trace_id} - BarService#find_bars - 43B/- - OK" end end end @@ -61,12 +61,31 @@ ::Timecop.freeze(0.832.seconds.from_now) do stats.stop - expect(stats.to_s).to eq "[CLT] - myserver1.myhost.com:30000 - #{stats.trace_id} - Foo::BarService#find_bars - 37B/12345B - 0.832s - #{::Time.now.iso8601}" + expect(stats.to_s).to eq "[CLT] - myserver1.myhost.com:30000 - #{stats.trace_id} - Foo::BarService#find_bars - 37B/12345B - 0.832s - OK - #{::Time.now.iso8601}" end end end + describe 'error log' do + it 'resolves error to a string' do + ::Timecop.freeze(10.minutes.ago) do + stats = ::Protobuf::Rpc::Stat.new(:CLIENT) + stats.server = ['30000', 'myserver1.myhost.com'] + stats.service = 'Foo::BarService' + stats.status = ::Protobuf::Socketrpc::ErrorReason::RPC_ERROR + stats.method_name = 'find_bars' + stats.request_size = 37 + stats.response_size = 12345 + + ::Timecop.freeze(0.832.seconds.from_now) do + stats.stop + expect(stats.to_s).to eq "[CLT] - myserver1.myhost.com:30000 - #{stats.trace_id} - Foo::BarService#find_bars - 37B/12345B - 0.832s - RPC_ERROR - #{::Time.now.iso8601}" + end + end + end + end + context 'when request is still running' do it 'omits response size, duration, and timestamp' do stats = ::Protobuf::Rpc::Stat.new(:CLIENT) @@ -74,7 +93,7 @@ stats.service = 'Foo::BarService' stats.method_name = 'find_bars' stats.request_size = 37 - expect(stats.to_s).to eq "[CLT] - myserver1.myhost.com:30000 - #{stats.trace_id} - Foo::BarService#find_bars - 37B/-" + expect(stats.to_s).to eq "[CLT] - myserver1.myhost.com:30000 - #{stats.trace_id} - Foo::BarService#find_bars - 37B/- - OK" end end end From 0abd9bed19bfad3d9b4872b3d003d686219374c9 Mon Sep 17 00:00:00 2001 From: Steve Newell Date: Tue, 27 Aug 2019 14:27:49 -0600 Subject: [PATCH 53/93] rubocop --- lib/protobuf/rpc/stat.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protobuf/rpc/stat.rb b/lib/protobuf/rpc/stat.rb index 20a5ca8a..841181a3 100644 --- a/lib/protobuf/rpc/stat.rb +++ b/lib/protobuf/rpc/stat.rb @@ -23,7 +23,7 @@ class Stat ::Protobuf::Socketrpc::ErrorReason::BAD_RESPONSE_PROTO => "BAD_RESPONSE_PROTO", ::Protobuf::Socketrpc::ErrorReason::UNKNOWN_HOST => "UNKNOWN_HOST", ::Protobuf::Socketrpc::ErrorReason::IO_ERROR => "IO_ERROR", - } + }.freeze def initialize(mode = :SERVER) @mode = mode From 313756208739c2f47f23cbcecfb9100ad2cc9216 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Wed, 28 Aug 2019 10:41:41 -0400 Subject: [PATCH 54/93] Bump version to 3.10.1 --- lib/protobuf/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protobuf/version.rb b/lib/protobuf/version.rb index 9a551198..6f29ce5f 100644 --- a/lib/protobuf/version.rb +++ b/lib/protobuf/version.rb @@ -1,3 +1,3 @@ module Protobuf - VERSION = '3.10.0' # rubocop:disable Style/MutableConstant + VERSION = '3.10.1' # rubocop:disable Style/MutableConstant end From 7b77060f2bf3f16e5229966336c818db6c22a9c3 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Wed, 9 Oct 2019 20:40:26 -0400 Subject: [PATCH 55/93] Add a "before_server_bind" event for server to do work before starting --- lib/protobuf/cli.rb | 2 ++ spec/lib/protobuf/cli_spec.rb | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/lib/protobuf/cli.rb b/lib/protobuf/cli.rb index 3432a0dd..35c6d936 100644 --- a/lib/protobuf/cli.rb +++ b/lib/protobuf/cli.rb @@ -240,6 +240,8 @@ def shutdown_server def start_server debug_say('Running server') + ::ActiveSupport::Notifications.instrument("before_server_bind") + runner.run do logger.info do "pid #{::Process.pid} -- #{mode} RPC Server listening at #{options.host}:#{options.port}" diff --git a/spec/lib/protobuf/cli_spec.rb b/spec/lib/protobuf/cli_spec.rb index 99fdb960..26b974bc 100644 --- a/spec/lib/protobuf/cli_spec.rb +++ b/spec/lib/protobuf/cli_spec.rb @@ -275,6 +275,17 @@ end end + context 'before server bind' do + it 'publishes a message before the runner runs' do + server_published_message_before_bind = false + ::ActiveSupport::Notifications.subscribe('before_server_bind') do + server_published_message_before_bind = true + end + described_class.start(args) + expect(server_published_message_before_bind).to eq(true) + end + end + end end From 91e59ebfd332553b24f2cf5eff012670591608c6 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Wed, 9 Oct 2019 20:50:21 -0400 Subject: [PATCH 56/93] Add {before,after}_server_bind callbacks to Protobuf --- lib/protobuf.rb | 12 ++++++++++++ spec/lib/protobuf/cli_spec.rb | 30 +++++++++++++++++++++++++++--- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/lib/protobuf.rb b/lib/protobuf.rb index a1300025..69139e2c 100644 --- a/lib/protobuf.rb +++ b/lib/protobuf.rb @@ -54,6 +54,18 @@ class << self attr_writer :client_host end + def self.after_server_bind(&block) + ::ActiveSupport::Notifications.subscribe('after_server_bind') do |*args| + block.call(*args) + end + end + + def self.before_server_bind(&block) + ::ActiveSupport::Notifications.subscribe('before_server_bind') do |*args| + block.call(*args) + end + end + def self.client_host @client_host ||= Socket.gethostname end diff --git a/spec/lib/protobuf/cli_spec.rb b/spec/lib/protobuf/cli_spec.rb index 26b974bc..ea78ed0d 100644 --- a/spec/lib/protobuf/cli_spec.rb +++ b/spec/lib/protobuf/cli_spec.rb @@ -275,14 +275,38 @@ end end + context 'after server bind' do + let(:sock_runner) { double("FakeRunner", :run => nil) } + + before { allow(sock_runner).to receive(:run).and_yield } + + it 'publishes when using the lib/protobuf callback' do + message_after_bind = false + ::Protobuf.after_server_bind do + message_after_bind = true + end + described_class.start(args) + expect(message_after_bind).to eq(true) + end + end + context 'before server bind' do it 'publishes a message before the runner runs' do - server_published_message_before_bind = false + message_before_bind = false ::ActiveSupport::Notifications.subscribe('before_server_bind') do - server_published_message_before_bind = true + message_before_bind = true + end + described_class.start(args) + expect(message_before_bind).to eq(true) + end + + it 'publishes when using the lib/protobuf callback' do + message_before_bind = false + ::Protobuf.before_server_bind do + message_before_bind = true end described_class.start(args) - expect(server_published_message_before_bind).to eq(true) + expect(message_before_bind).to eq(true) end end From dd245b6ffce47aacb2ce29fee25f51e0edebf3f4 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Mon, 14 Oct 2019 20:12:49 -0600 Subject: [PATCH 57/93] Bump version to 3.10.2 --- lib/protobuf/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protobuf/version.rb b/lib/protobuf/version.rb index 6f29ce5f..5bd60165 100644 --- a/lib/protobuf/version.rb +++ b/lib/protobuf/version.rb @@ -1,3 +1,3 @@ module Protobuf - VERSION = '3.10.1' # rubocop:disable Style/MutableConstant + VERSION = '3.10.2' # rubocop:disable Style/MutableConstant end From 4f45a8a44cb864a561fc7988994c4886bf22453b Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Tue, 7 Jan 2020 10:04:01 -0500 Subject: [PATCH 58/93] Bump version to 3.10.3 --- lib/protobuf/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protobuf/version.rb b/lib/protobuf/version.rb index 5bd60165..d96e0847 100644 --- a/lib/protobuf/version.rb +++ b/lib/protobuf/version.rb @@ -1,3 +1,3 @@ module Protobuf - VERSION = '3.10.2' # rubocop:disable Style/MutableConstant + VERSION = '3.10.3' # rubocop:disable Style/MutableConstant end From ff9133f5367365e3f2b6fb742283d505e8b6bbcd Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Sat, 26 Jun 2021 17:37:11 -0600 Subject: [PATCH 59/93] Add a CI config for circle-ci --- .circleci/config.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..9d4e511a --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,43 @@ +version: 2.1 + +orbs: + # orbs are basically bundles of pre-written build scripts that work for common cases + # https://github.com/CircleCI-Public/ruby-orb + ruby: circleci/ruby@1.1 + +jobs: + # skipping build step because Gemfile.lock is not included in the source + # this makes the bundler caching step a noop + test: + parameters: + ruby-image: + type: string + docker: + - image: << parameters.ruby-image >> + steps: + - run: + command: sudo apt-get update + - run: + message: Install ZeroMQ and Protobuf Compiler + command: sudo apt-get -y install libzmq3-dev protobuf-compiler + - checkout + - run: + command: gem install bundler + - run: + command: bundle install + - run: + command: bundle exec rake + +workflows: + build_and_test: + jobs: + - test: + matrix: + parameters: + ruby-image: + # - circleci/jruby:9.2.6.0-jdk + # - circleci/jruby:9.1.17.0-jdk + # - circleci/jruby:9.2-jdk8 + # - circleci/ruby:2.4 + # - circleci/ruby:2.5 + - circleci/ruby:2.7 From 0375f93f7c20901eb5c0fdb536714c9550442f34 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Sat, 26 Jun 2021 17:57:32 -0600 Subject: [PATCH 60/93] Specify the proto syntax version --- proto/dynamic_discovery.proto | 2 ++ proto/google/protobuf/compiler/plugin.proto | 2 ++ proto/rpc.proto | 2 ++ 3 files changed, 6 insertions(+) diff --git a/proto/dynamic_discovery.proto b/proto/dynamic_discovery.proto index dcecca5f..a2301b5a 100644 --- a/proto/dynamic_discovery.proto +++ b/proto/dynamic_discovery.proto @@ -22,6 +22,8 @@ // // Protobufs needed for dynamic discovery zmq server and client. +syntax = "proto2"; + package protobuf.rpc.dynamicDiscovery; enum BeaconType { diff --git a/proto/google/protobuf/compiler/plugin.proto b/proto/google/protobuf/compiler/plugin.proto index 77b888f3..d001fa16 100644 --- a/proto/google/protobuf/compiler/plugin.proto +++ b/proto/google/protobuf/compiler/plugin.proto @@ -44,6 +44,8 @@ // plugin should be named "protoc-gen-$NAME", and will then be used when the // flag "--${NAME}_out" is passed to protoc. +syntax = "proto2"; + package google.protobuf.compiler; option java_package = "com.google.protobuf.compiler"; option java_outer_classname = "PluginProtos"; diff --git a/proto/rpc.proto b/proto/rpc.proto index f496139e..87fef057 100644 --- a/proto/rpc.proto +++ b/proto/rpc.proto @@ -22,6 +22,8 @@ // // Protobufs needed for socket rpcs. +syntax = "proto2"; + package protobuf.socketrpc; message Request From 555dcc628a25328b16a8c7e4599c782a0753f547 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Sat, 26 Jun 2021 18:00:27 -0600 Subject: [PATCH 61/93] Use protoc-gen-ruby-protobuf for compiling protos --- Rakefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Rakefile b/Rakefile index 8df9895f..cecc48a4 100644 --- a/Rakefile +++ b/Rakefile @@ -22,10 +22,12 @@ namespace :compile do task :spec do proto_path = ::File.expand_path('../spec/support/', __FILE__) proto_files = Dir[File.join(proto_path, '**', '*.proto')] - cmd = %(protoc --plugin=./bin/protoc-gen-ruby --ruby_out=#{proto_path} -I #{proto_path} #{proto_files.join(' ')}) - puts cmd - system(cmd) + proto_files.each do |proto_file| + cmd = %(protoc --plugin=protoc-gen-ruby-protobuf=./bin/protoc-gen-ruby --ruby-protobuf_out=#{proto_path} -I #{proto_path} #{proto_file}) + puts cmd + system(cmd) || fail("Failed to compile spec proto: #{proto_file}") + end end desc 'Compile rpc protos in protos/ directory' @@ -35,10 +37,10 @@ namespace :compile do output_dir = ::File.expand_path('../tmp/rpc', __FILE__) ::FileUtils.mkdir_p(output_dir) - cmd = %(protoc --plugin=./bin/protoc-gen-ruby --ruby_out=#{output_dir} -I #{proto_path} #{proto_files.join(' ')}) + cmd = %(protoc --plugin=protoc-gen-ruby-protobuf=./bin/protoc-gen-ruby --ruby-protobuf_out=#{output_dir} -I #{proto_path} #{proto_files.join(' ')}) puts cmd - system(cmd) + system(cmd) || fail("Failed to compile rpc protos!") files = { 'tmp/rpc/dynamic_discovery.pb.rb' => 'lib/protobuf/rpc', From db5e65fe2eada3d86b8452f14f534c9aec5f77f6 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Sat, 26 Jun 2021 18:04:15 -0600 Subject: [PATCH 62/93] Fix the broken map-test.proto test --- spec/support/protos/map-test.bin | Bin 4286 -> 4286 bytes spec/support/protos/map-test.proto | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/support/protos/map-test.bin b/spec/support/protos/map-test.bin index 5f6e02c39696ca01440c748db94d24b7ef6baf83..97ad6500d22947de1139add13242bbeeafa21914 100644 GIT binary patch delta 19 acmdm|xKDAzW&v&nAr3AUKhKaT0Y(5j!vwnk delta 19 acmdm|xKDAzW&v(SAr3AUKhKaT0VV)D&jh^y diff --git a/spec/support/protos/map-test.proto b/spec/support/protos/map-test.proto index 6f7f221d..447c651d 100644 --- a/spec/support/protos/map-test.proto +++ b/spec/support/protos/map-test.proto @@ -1,13 +1,13 @@ // Use protoc v3.0.0 to compile this file into map-test.bin: -// protoc --descriptor_set_out=map-test.bin map-test.proto +// protoc --descriptor_set_out=map-test.bin map-test.proto syntax = "proto2"; package foo; enum Frobnitz { - FROB = 1; - NITZ = 2; + FROB = 0; + NITZ = 1; } message Baz { From 91e505faae331b5b09ed6dc5c9ba211f6e1a3f7a Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Sat, 26 Jun 2021 18:04:38 -0600 Subject: [PATCH 63/93] Add missing code from bx rake compile:spec --- spec/support/google/protobuf/descriptor.pb.rb | 360 ++++++++++++++++++ spec/support/protos/map-test.pb.rb | 4 +- 2 files changed, 362 insertions(+), 2 deletions(-) create mode 100644 spec/support/google/protobuf/descriptor.pb.rb diff --git a/spec/support/google/protobuf/descriptor.pb.rb b/spec/support/google/protobuf/descriptor.pb.rb new file mode 100644 index 00000000..acff3ebd --- /dev/null +++ b/spec/support/google/protobuf/descriptor.pb.rb @@ -0,0 +1,360 @@ +# encoding: utf-8 + +## +# This file is auto-generated. DO NOT EDIT! +# +require 'protobuf' + +module Google + module Protobuf + ::Protobuf::Optionable.inject(self) { ::Google::Protobuf::FileOptions } + + ## + # Message Classes + # + class FileDescriptorSet < ::Protobuf::Message; end + class FileDescriptorProto < ::Protobuf::Message; end + class DescriptorProto < ::Protobuf::Message + class ExtensionRange < ::Protobuf::Message; end + class ReservedRange < ::Protobuf::Message; end + + end + + class ExtensionRangeOptions < ::Protobuf::Message; end + class FieldDescriptorProto < ::Protobuf::Message + class Type < ::Protobuf::Enum + define :TYPE_DOUBLE, 1 + define :TYPE_FLOAT, 2 + define :TYPE_INT64, 3 + define :TYPE_UINT64, 4 + define :TYPE_INT32, 5 + define :TYPE_FIXED64, 6 + define :TYPE_FIXED32, 7 + define :TYPE_BOOL, 8 + define :TYPE_STRING, 9 + define :TYPE_GROUP, 10 + define :TYPE_MESSAGE, 11 + define :TYPE_BYTES, 12 + define :TYPE_UINT32, 13 + define :TYPE_ENUM, 14 + define :TYPE_SFIXED32, 15 + define :TYPE_SFIXED64, 16 + define :TYPE_SINT32, 17 + define :TYPE_SINT64, 18 + end + + class Label < ::Protobuf::Enum + define :LABEL_OPTIONAL, 1 + define :LABEL_REQUIRED, 2 + define :LABEL_REPEATED, 3 + end + + end + + class OneofDescriptorProto < ::Protobuf::Message; end + class EnumDescriptorProto < ::Protobuf::Message + class EnumReservedRange < ::Protobuf::Message; end + + end + + class EnumValueDescriptorProto < ::Protobuf::Message; end + class ServiceDescriptorProto < ::Protobuf::Message; end + class MethodDescriptorProto < ::Protobuf::Message; end + class FileOptions < ::Protobuf::Message + class OptimizeMode < ::Protobuf::Enum + define :SPEED, 1 + define :CODE_SIZE, 2 + define :LITE_RUNTIME, 3 + end + + end + + class MessageOptions < ::Protobuf::Message; end + class FieldOptions < ::Protobuf::Message + class CType < ::Protobuf::Enum + define :STRING, 0 + define :CORD, 1 + define :STRING_PIECE, 2 + end + + class JSType < ::Protobuf::Enum + define :JS_NORMAL, 0 + define :JS_STRING, 1 + define :JS_NUMBER, 2 + end + + end + + class OneofOptions < ::Protobuf::Message; end + class EnumOptions < ::Protobuf::Message; end + class EnumValueOptions < ::Protobuf::Message; end + class ServiceOptions < ::Protobuf::Message; end + class MethodOptions < ::Protobuf::Message + class IdempotencyLevel < ::Protobuf::Enum + define :IDEMPOTENCY_UNKNOWN, 0 + define :NO_SIDE_EFFECTS, 1 + define :IDEMPOTENT, 2 + end + + end + + class UninterpretedOption < ::Protobuf::Message + class NamePart < ::Protobuf::Message; end + + end + + class SourceCodeInfo < ::Protobuf::Message + class Location < ::Protobuf::Message; end + + end + + class GeneratedCodeInfo < ::Protobuf::Message + class Annotation < ::Protobuf::Message; end + + end + + + + ## + # File Options + # + set_option :java_package, "com.google.protobuf" + set_option :java_outer_classname, "DescriptorProtos" + set_option :optimize_for, ::Google::Protobuf::FileOptions::OptimizeMode::SPEED + set_option :go_package, "google.golang.org/protobuf/types/descriptorpb" + set_option :cc_enable_arenas, true + set_option :objc_class_prefix, "GPB" + set_option :csharp_namespace, "Google.Protobuf.Reflection" + + + ## + # Message Fields + # + class FileDescriptorSet + repeated ::Google::Protobuf::FileDescriptorProto, :file, 1 + end + + class FileDescriptorProto + optional :string, :name, 1 + optional :string, :package, 2 + repeated :string, :dependency, 3 + repeated :int32, :public_dependency, 10 + repeated :int32, :weak_dependency, 11 + repeated ::Google::Protobuf::DescriptorProto, :message_type, 4 + repeated ::Google::Protobuf::EnumDescriptorProto, :enum_type, 5 + repeated ::Google::Protobuf::ServiceDescriptorProto, :service, 6 + repeated ::Google::Protobuf::FieldDescriptorProto, :extension, 7 + optional ::Google::Protobuf::FileOptions, :options, 8 + optional ::Google::Protobuf::SourceCodeInfo, :source_code_info, 9 + optional :string, :syntax, 12 + end + + class DescriptorProto + class ExtensionRange + optional :int32, :start, 1 + optional :int32, :end, 2 + optional ::Google::Protobuf::ExtensionRangeOptions, :options, 3 + end + + class ReservedRange + optional :int32, :start, 1 + optional :int32, :end, 2 + end + + optional :string, :name, 1 + repeated ::Google::Protobuf::FieldDescriptorProto, :field, 2 + repeated ::Google::Protobuf::FieldDescriptorProto, :extension, 6 + repeated ::Google::Protobuf::DescriptorProto, :nested_type, 3 + repeated ::Google::Protobuf::EnumDescriptorProto, :enum_type, 4 + repeated ::Google::Protobuf::DescriptorProto::ExtensionRange, :extension_range, 5 + repeated ::Google::Protobuf::OneofDescriptorProto, :oneof_decl, 8 + optional ::Google::Protobuf::MessageOptions, :options, 7 + repeated ::Google::Protobuf::DescriptorProto::ReservedRange, :reserved_range, 9 + repeated :string, :reserved_name, 10 + end + + class ExtensionRangeOptions + repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999 + # Extension Fields + extensions 1000...536870912 + end + + class FieldDescriptorProto + optional :string, :name, 1 + optional :int32, :number, 3 + optional ::Google::Protobuf::FieldDescriptorProto::Label, :label, 4 + optional ::Google::Protobuf::FieldDescriptorProto::Type, :type, 5 + optional :string, :type_name, 6 + optional :string, :extendee, 2 + optional :string, :default_value, 7 + optional :int32, :oneof_index, 9 + optional :string, :json_name, 10 + optional ::Google::Protobuf::FieldOptions, :options, 8 + optional :bool, :proto3_optional, 17 + end + + class OneofDescriptorProto + optional :string, :name, 1 + optional ::Google::Protobuf::OneofOptions, :options, 2 + end + + class EnumDescriptorProto + class EnumReservedRange + optional :int32, :start, 1 + optional :int32, :end, 2 + end + + optional :string, :name, 1 + repeated ::Google::Protobuf::EnumValueDescriptorProto, :value, 2 + optional ::Google::Protobuf::EnumOptions, :options, 3 + repeated ::Google::Protobuf::EnumDescriptorProto::EnumReservedRange, :reserved_range, 4 + repeated :string, :reserved_name, 5 + end + + class EnumValueDescriptorProto + optional :string, :name, 1 + optional :int32, :number, 2 + optional ::Google::Protobuf::EnumValueOptions, :options, 3 + end + + class ServiceDescriptorProto + optional :string, :name, 1 + repeated ::Google::Protobuf::MethodDescriptorProto, :method, 2 + optional ::Google::Protobuf::ServiceOptions, :options, 3 + end + + class MethodDescriptorProto + optional :string, :name, 1 + optional :string, :input_type, 2 + optional :string, :output_type, 3 + optional ::Google::Protobuf::MethodOptions, :options, 4 + optional :bool, :client_streaming, 5, :default => false + optional :bool, :server_streaming, 6, :default => false + end + + class FileOptions + optional :string, :java_package, 1 + optional :string, :java_outer_classname, 8 + optional :bool, :java_multiple_files, 10, :default => false + optional :bool, :java_generate_equals_and_hash, 20, :deprecated => true + optional :bool, :java_string_check_utf8, 27, :default => false + optional ::Google::Protobuf::FileOptions::OptimizeMode, :optimize_for, 9, :default => ::Google::Protobuf::FileOptions::OptimizeMode::SPEED + optional :string, :go_package, 11 + optional :bool, :cc_generic_services, 16, :default => false + optional :bool, :java_generic_services, 17, :default => false + optional :bool, :py_generic_services, 18, :default => false + optional :bool, :php_generic_services, 42, :default => false + optional :bool, :deprecated, 23, :default => false + optional :bool, :cc_enable_arenas, 31, :default => true + optional :string, :objc_class_prefix, 36 + optional :string, :csharp_namespace, 37 + optional :string, :swift_prefix, 39 + optional :string, :php_class_prefix, 40 + optional :string, :php_namespace, 41 + optional :string, :php_metadata_namespace, 44 + optional :string, :ruby_package, 45 + repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999 + # Extension Fields + extensions 1000...536870912 + end + + class MessageOptions + optional :bool, :message_set_wire_format, 1, :default => false + optional :bool, :no_standard_descriptor_accessor, 2, :default => false + optional :bool, :deprecated, 3, :default => false + optional :bool, :map_entry, 7 + repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999 + # Extension Fields + extensions 1000...536870912 + end + + class FieldOptions + optional ::Google::Protobuf::FieldOptions::CType, :ctype, 1, :default => ::Google::Protobuf::FieldOptions::CType::STRING + optional :bool, :packed, 2 + optional ::Google::Protobuf::FieldOptions::JSType, :jstype, 6, :default => ::Google::Protobuf::FieldOptions::JSType::JS_NORMAL + optional :bool, :lazy, 5, :default => false + optional :bool, :deprecated, 3, :default => false + optional :bool, :weak, 10, :default => false + repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999 + # Extension Fields + extensions 1000...536870912 + end + + class OneofOptions + repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999 + # Extension Fields + extensions 1000...536870912 + end + + class EnumOptions + optional :bool, :allow_alias, 2 + optional :bool, :deprecated, 3, :default => false + repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999 + # Extension Fields + extensions 1000...536870912 + end + + class EnumValueOptions + optional :bool, :deprecated, 1, :default => false + repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999 + # Extension Fields + extensions 1000...536870912 + end + + class ServiceOptions + optional :bool, :deprecated, 33, :default => false + repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999 + # Extension Fields + extensions 1000...536870912 + end + + class MethodOptions + optional :bool, :deprecated, 33, :default => false + optional ::Google::Protobuf::MethodOptions::IdempotencyLevel, :idempotency_level, 34, :default => ::Google::Protobuf::MethodOptions::IdempotencyLevel::IDEMPOTENCY_UNKNOWN + repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999 + # Extension Fields + extensions 1000...536870912 + end + + class UninterpretedOption + class NamePart + required :string, :name_part, 1 + required :bool, :is_extension, 2 + end + + repeated ::Google::Protobuf::UninterpretedOption::NamePart, :name, 2 + optional :string, :identifier_value, 3 + optional :uint64, :positive_int_value, 4 + optional :int64, :negative_int_value, 5 + optional :double, :double_value, 6 + optional :bytes, :string_value, 7 + optional :string, :aggregate_value, 8 + end + + class SourceCodeInfo + class Location + repeated :int32, :path, 1, :packed => true + repeated :int32, :span, 2, :packed => true + optional :string, :leading_comments, 3 + optional :string, :trailing_comments, 4 + repeated :string, :leading_detached_comments, 6 + end + + repeated ::Google::Protobuf::SourceCodeInfo::Location, :location, 1 + end + + class GeneratedCodeInfo + class Annotation + repeated :int32, :path, 1, :packed => true + optional :string, :source_file, 2 + optional :int32, :begin, 3 + optional :int32, :end, 4 + end + + repeated ::Google::Protobuf::GeneratedCodeInfo::Annotation, :annotation, 1 + end + + end + +end + diff --git a/spec/support/protos/map-test.pb.rb b/spec/support/protos/map-test.pb.rb index bd856360..849bad87 100644 --- a/spec/support/protos/map-test.pb.rb +++ b/spec/support/protos/map-test.pb.rb @@ -12,8 +12,8 @@ module Foo # Enum Classes # class Frobnitz < ::Protobuf::Enum - define :FROB, 1 - define :NITZ, 2 + define :FROB, 0 + define :NITZ, 1 end From 7993689a62aba537405ed08011e9b5ef0061b260 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Sat, 26 Jun 2021 18:06:15 -0600 Subject: [PATCH 64/93] Drop the circle ruby orb --- .circleci/config.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9d4e511a..3eb220c1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,10 +1,5 @@ version: 2.1 -orbs: - # orbs are basically bundles of pre-written build scripts that work for common cases - # https://github.com/CircleCI-Public/ruby-orb - ruby: circleci/ruby@1.1 - jobs: # skipping build step because Gemfile.lock is not included in the source # this makes the bundler caching step a noop From 636481bad211e4dc48e74cd230a7000b681ffc2c Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Sat, 26 Jun 2021 18:08:33 -0600 Subject: [PATCH 65/93] Add full ruby version matrix --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3eb220c1..b346a46a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,9 +30,9 @@ workflows: matrix: parameters: ruby-image: - # - circleci/jruby:9.2.6.0-jdk - # - circleci/jruby:9.1.17.0-jdk - # - circleci/jruby:9.2-jdk8 - # - circleci/ruby:2.4 - # - circleci/ruby:2.5 + - circleci/jruby:9.2.6.0-jdk + - circleci/jruby:9.1.17.0-jdk + - circleci/jruby:9.2-jdk8 + - circleci/ruby:2.4 + - circleci/ruby:2.5 - circleci/ruby:2.7 From 1ce2617a0a87c1411f31797ac780c5bb88b4aec2 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Sat, 26 Jun 2021 18:14:18 -0600 Subject: [PATCH 66/93] Print the protoc version --- .circleci/config.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b346a46a..fe0d5655 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,6 +15,8 @@ jobs: - run: message: Install ZeroMQ and Protobuf Compiler command: sudo apt-get -y install libzmq3-dev protobuf-compiler + - run: + command: protoc --version - checkout - run: command: gem install bundler @@ -31,8 +33,8 @@ workflows: parameters: ruby-image: - circleci/jruby:9.2.6.0-jdk - - circleci/jruby:9.1.17.0-jdk - - circleci/jruby:9.2-jdk8 - - circleci/ruby:2.4 - - circleci/ruby:2.5 - - circleci/ruby:2.7 + # - circleci/jruby:9.1.17.0-jdk + # - circleci/jruby:9.2-jdk8 + # - circleci/ruby:2.4 + # - circleci/ruby:2.5 + # - circleci/ruby:2.7 From aac6b0263c395210f8267e2cacc87a86abbbc3ab Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Sat, 26 Jun 2021 18:18:45 -0600 Subject: [PATCH 67/93] Use protoc version 3.16.0 --- .circleci/config.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fe0d5655..7991ae40 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,12 +11,20 @@ jobs: - image: << parameters.ruby-image >> steps: - run: - command: sudo apt-get update - - run: - message: Install ZeroMQ and Protobuf Compiler - command: sudo apt-get -y install libzmq3-dev protobuf-compiler + name: Install protobuf compiler + command: | + archive=protoc-3.16.0-linux-x86_64 + curl -O -L https://github.com/protocolbuffers/protobuf/releases/download/v3.16.0/$archive.zip + sudo unzip -d '/usr/local' $archive.zip 'bin/*' 'include/*' + sudo chown -R $(whoami) /usr/local/bin/protoc /usr/local/include/google + rm -rf $archive.zip - run: command: protoc --version + - run: + command: sudo apt-get update + - run: + message: Install ZeroMQ + command: sudo apt-get -y install libzmq3-dev - checkout - run: command: gem install bundler From 15135c9dfbe5fe0dc67611e1d670d12fab368e86 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Sat, 26 Jun 2021 18:39:30 -0600 Subject: [PATCH 68/93] Enable all ruby versions once again --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7991ae40..e1c40701 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,8 +41,8 @@ workflows: parameters: ruby-image: - circleci/jruby:9.2.6.0-jdk - # - circleci/jruby:9.1.17.0-jdk - # - circleci/jruby:9.2-jdk8 - # - circleci/ruby:2.4 - # - circleci/ruby:2.5 - # - circleci/ruby:2.7 + - circleci/jruby:9.1.17.0-jdk + - circleci/jruby:9.2-jdk8 + - circleci/ruby:2.4 + - circleci/ruby:2.5 + - circleci/ruby:2.7 From d3d759229cc496687803f8212cc68cb6e1e6479f Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Sat, 26 Jun 2021 18:45:01 -0600 Subject: [PATCH 69/93] So long, travis! --- .travis.yml | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f89eb2e6..00000000 --- a/.travis.yml +++ /dev/null @@ -1,40 +0,0 @@ -before_install: - - wget https://github.com/zeromq/libzmq/releases/download/v4.2.1/zeromq-4.2.1.tar.gz - - tar xvf zeromq-4.2.1.tar.gz - - cd zeromq-4.2.1 - - ./configure - - make -j4 - - sudo make install - # Retrun to project directory - - cd .. - - sudo -E ./install-protobuf.sh - - java -Xmx1g -version - - javac -J-Xmx1g -version - - export JRUBY_OPTS=-J-Xmx1g - - gem update bundler -language: ruby -rvm: - - 1.9.3 - - 2.0.0 - - 2.1 - - 2.2 - - 2.3 - - 2.4 - - 2.5 - - jruby-9.1.17.0 - - jruby-9.2.5.0 - - rbx-2 -env: - - PROTOBUF_VERSION=2.6.1 - - PROTOBUF_VERSION=3.0.0-alpha-2 -matrix: - allow_failures: - - rvm: rbx-2 - - env: PROTOBUF_VERSION=3.0.0-alpha-2 -notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/51a956bcd2b1854d6756 - on_success: change # options: [always|never|change] default: always - on_failure: always # options: [always|never|change] default: always - on_start: false # default: false From 4e236ebb083db2ce1a1e9dd0d23bbee3fc3d841c Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Sat, 26 Jun 2021 18:47:51 -0600 Subject: [PATCH 70/93] Remove the instal-protobuf script --- install-protobuf.sh | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100755 install-protobuf.sh diff --git a/install-protobuf.sh b/install-protobuf.sh deleted file mode 100755 index b3872fd0..00000000 --- a/install-protobuf.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env sh - -set -ex - -gdie() { - echo "$@" >&2 - exit 1 -} - -test -n "$PROTOBUF_VERSION" || die "PROTOBUF_VERSION env var is undefined" - -case "$PROTOBUF_VERSION" in -2*) - basename=protobuf-$PROTOBUF_VERSION - ;; -3*) - basename=protobuf-cpp-$PROTOBUF_VERSION - ;; -*) - die "unknown protobuf version: $PROTOBUF_VERSION" - ;; -esac - -curl -sL https://github.com/google/protobuf/releases/download/v$PROTOBUF_VERSION/$basename.tar.gz | tar zx - -cd protobuf-$PROTOBUF_VERSION - -./configure --prefix=/usr && make -j2 && make install From b385f4a95988b8db1414fe3f1fbbc0c317a9e207 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Mon, 21 Jun 2021 15:14:27 -0600 Subject: [PATCH 71/93] Add proto v3 features to the plugin.proto --- .../descriptors/google/protobuf/compiler/plugin.pb.rb | 6 ++++++ proto/google/protobuf/compiler/plugin.proto | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb b/lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb index 354aa845..e4c402da 100644 --- a/lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb +++ b/lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb @@ -21,6 +21,11 @@ module Compiler # class CodeGeneratorRequest < ::Protobuf::Message; end class CodeGeneratorResponse < ::Protobuf::Message + class Feature < ::Protobuf::Enum + define :FEATURE_NONE, 0 + define :FEATURE_PROTO3_OPTIONAL, 1 + end + class File < ::Protobuf::Message; end end @@ -51,6 +56,7 @@ class File end optional :string, :error, 1 + optional :uint64, :supported_features, 2 repeated ::Google::Protobuf::Compiler::CodeGeneratorResponse::File, :file, 15 end diff --git a/proto/google/protobuf/compiler/plugin.proto b/proto/google/protobuf/compiler/plugin.proto index d001fa16..a1718e77 100644 --- a/proto/google/protobuf/compiler/plugin.proto +++ b/proto/google/protobuf/compiler/plugin.proto @@ -88,6 +88,16 @@ message CodeGeneratorResponse { // exiting with a non-zero status code. optional string error = 1; + // A bitmask of supported features that the code generator supports. + // This is a bitwise "or" of values from the Feature enum. + optional uint64 supported_features = 2; + + // Sync with code_generator.h. + enum Feature { + FEATURE_NONE = 0; + FEATURE_PROTO3_OPTIONAL = 1; + } + // Represents a single generated file. message File { // The file name, relative to the output directory. The name must not From 33af6ada73e242ca75a682c9f8dd73c21cf2b694 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Mon, 21 Jun 2021 15:14:53 -0600 Subject: [PATCH 72/93] Wire the compiler to support proto v3 with optional fields --- lib/protobuf/code_generator.rb | 11 ++++++++++- spec/functional/code_generator_spec.rb | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/protobuf/code_generator.rb b/lib/protobuf/code_generator.rb index 7b04a32c..7068800b 100644 --- a/lib/protobuf/code_generator.rb +++ b/lib/protobuf/code_generator.rb @@ -46,7 +46,16 @@ def response_bytes generate_file(file_descriptor) end - ::Google::Protobuf::Compiler::CodeGeneratorResponse.encode(:file => generated_files) + ::Google::Protobuf::Compiler::CodeGeneratorResponse.encode( + :file => generated_files, + :supported_features => supported_features, + ) + end + + def supported_features + # The only available feature is proto3 with optional fields. + # This is backwards compatible with proto2 optional fields. + ::Google::Protobuf::Compiler::CodeGeneratorResponse::Feature::FEATURE_PROTO3_OPTIONAL.to_i end Protobuf::Field::BaseField.module_eval do diff --git a/spec/functional/code_generator_spec.rb b/spec/functional/code_generator_spec.rb index aac45319..3f767b23 100644 --- a/spec/functional/code_generator_spec.rb +++ b/spec/functional/code_generator_spec.rb @@ -17,7 +17,7 @@ end expected_output = - ::Google::Protobuf::Compiler::CodeGeneratorResponse.encode(:file => expected_file_descriptors) + ::Google::Protobuf::Compiler::CodeGeneratorResponse.encode(:file => expected_file_descriptors, :supported_features => 1) code_generator = ::Protobuf::CodeGenerator.new(bytes) code_generator.eval_unknown_extensions! @@ -37,7 +37,7 @@ :name => file_name, :content => file_content) expected_response = - ::Google::Protobuf::Compiler::CodeGeneratorResponse.encode(:file => [expected_file_output]) + ::Google::Protobuf::Compiler::CodeGeneratorResponse.encode(:file => [expected_file_output], :supported_features => 1) code_generator = ::Protobuf::CodeGenerator.new(request.encode) code_generator.eval_unknown_extensions! From 59eb89671e319b3d5b878b302c02feec02276edb Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Mon, 21 Jun 2021 15:19:21 -0600 Subject: [PATCH 73/93] Add functional v3 proto with optional fields compiler test --- spec/lib/protobuf/code_generator_spec.rb | 2 +- spec/support/protos/optional_v3_fields.pb.rb | 22 ++++++++++++++++++++ spec/support/protos/optional_v3_fields.proto | 6 ++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 spec/support/protos/optional_v3_fields.pb.rb create mode 100644 spec/support/protos/optional_v3_fields.proto diff --git a/spec/lib/protobuf/code_generator_spec.rb b/spec/lib/protobuf/code_generator_spec.rb index 230029c0..44b8dd16 100644 --- a/spec/lib/protobuf/code_generator_spec.rb +++ b/spec/lib/protobuf/code_generator_spec.rb @@ -23,7 +23,7 @@ end let(:expected_response_bytes) do - COMPILER::CodeGeneratorResponse.encode(:file => [output_file1, output_file2]) + COMPILER::CodeGeneratorResponse.encode(:file => [output_file1, output_file2], :supported_features => 1) end before do diff --git a/spec/support/protos/optional_v3_fields.pb.rb b/spec/support/protos/optional_v3_fields.pb.rb new file mode 100644 index 00000000..058f37ff --- /dev/null +++ b/spec/support/protos/optional_v3_fields.pb.rb @@ -0,0 +1,22 @@ +# encoding: utf-8 + +## +# This file is auto-generated. DO NOT EDIT! +# +require 'protobuf' + + +## +# Message Classes +# +class SomethingWithOptionalFields < ::Protobuf::Message; end + + +## +# Message Fields +# +class SomethingWithOptionalFields + optional :string, :i_am_optional, 1 + optional :string, :i_am_not_optional, 2 +end + diff --git a/spec/support/protos/optional_v3_fields.proto b/spec/support/protos/optional_v3_fields.proto new file mode 100644 index 00000000..b145fba2 --- /dev/null +++ b/spec/support/protos/optional_v3_fields.proto @@ -0,0 +1,6 @@ +syntax = "proto3"; + +message SomethingWithOptionalFields { + optional string i_am_optional = 1; + string i_am_not_optional = 2; +} From f1606fa51a5aa7b3c29716254669c2c028269676 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Mon, 21 Jun 2021 22:03:25 -0600 Subject: [PATCH 74/93] Update map-test.proto to use 0 value enum I manually corrected the enum values via pry debugger and wrote the new request bytes to disk, hence the map-test.bin change. This was causing the rake compile:spec task to fail. From 03c841be846edd925ca6ac6747eca7ca358bb3c7 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Wed, 30 Jun 2021 14:10:33 -0600 Subject: [PATCH 75/93] Bump version to 3.10.4 and add notes to CHANGES --- CHANGES.md | 1 + lib/protobuf/version.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 1577e709..032d0ce5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ 3.10.0 ------ - Add headers to request proto +- Add support for compiling v3 protos with optional fields as v2 optional fields 3.9.0 ----- diff --git a/lib/protobuf/version.rb b/lib/protobuf/version.rb index d96e0847..77a79c63 100644 --- a/lib/protobuf/version.rb +++ b/lib/protobuf/version.rb @@ -1,3 +1,3 @@ module Protobuf - VERSION = '3.10.3' # rubocop:disable Style/MutableConstant + VERSION = '3.10.4' # rubocop:disable Style/MutableConstant end From 993ecba46cc20f4727704a967de0b167fd60f448 Mon Sep 17 00:00:00 2001 From: Andrew Lazarus Date: Tue, 13 Jul 2021 11:31:05 -0700 Subject: [PATCH 76/93] refresh well known protos: descriptor.proto, plugin.proto from: https://raw.githubusercontent.com/google/protobuf/master/src/google/protobuf/descriptor.proto https://raw.githubusercontent.com/protocolbuffers/protobuf/master/src/google/protobuf/compiler/plugin.proto --- .../google/protobuf/compiler/plugin.pb.rb | 17 + .../google/protobuf/descriptor.pb.rb | 71 +++- proto/google/protobuf/compiler/plugin.proto | 36 +- proto/google/protobuf/descriptor.proto | 324 ++++++++++++------ 4 files changed, 345 insertions(+), 103 deletions(-) diff --git a/lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb b/lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb index 354aa845..62e17f56 100644 --- a/lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb +++ b/lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb @@ -19,8 +19,14 @@ module Compiler ## # Message Classes # + class Version < ::Protobuf::Message; end class CodeGeneratorRequest < ::Protobuf::Message; end class CodeGeneratorResponse < ::Protobuf::Message + class Feature < ::Protobuf::Enum + define :FEATURE_NONE, 0 + define :FEATURE_PROTO3_OPTIONAL, 1 + end + class File < ::Protobuf::Message; end end @@ -32,15 +38,24 @@ class File < ::Protobuf::Message; end # set_option :java_package, "com.google.protobuf.compiler" set_option :java_outer_classname, "PluginProtos" + set_option :go_package, "google.golang.org/protobuf/types/pluginpb" ## # Message Fields # + class Version + optional :int32, :major, 1 + optional :int32, :minor, 2 + optional :int32, :patch, 3 + optional :string, :suffix, 4 + end + class CodeGeneratorRequest repeated :string, :file_to_generate, 1 optional :string, :parameter, 2 repeated ::Google::Protobuf::FileDescriptorProto, :proto_file, 15 + optional ::Google::Protobuf::Compiler::Version, :compiler_version, 3 end class CodeGeneratorResponse @@ -48,9 +63,11 @@ class File optional :string, :name, 1 optional :string, :insertion_point, 2 optional :string, :content, 15 + optional ::Google::Protobuf::GeneratedCodeInfo, :generated_code_info, 16 end optional :string, :error, 1 + optional :uint64, :supported_features, 2 repeated ::Google::Protobuf::Compiler::CodeGeneratorResponse::File, :file, 15 end diff --git a/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb b/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb index 534d83a5..acff3ebd 100644 --- a/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb +++ b/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb @@ -20,6 +20,7 @@ class ReservedRange < ::Protobuf::Message; end end + class ExtensionRangeOptions < ::Protobuf::Message; end class FieldDescriptorProto < ::Protobuf::Message class Type < ::Protobuf::Enum define :TYPE_DOUBLE, 1 @@ -51,7 +52,11 @@ class Label < ::Protobuf::Enum end class OneofDescriptorProto < ::Protobuf::Message; end - class EnumDescriptorProto < ::Protobuf::Message; end + class EnumDescriptorProto < ::Protobuf::Message + class EnumReservedRange < ::Protobuf::Message; end + + end + class EnumValueDescriptorProto < ::Protobuf::Message; end class ServiceDescriptorProto < ::Protobuf::Message; end class MethodDescriptorProto < ::Protobuf::Message; end @@ -80,10 +85,19 @@ class JSType < ::Protobuf::Enum end + class OneofOptions < ::Protobuf::Message; end class EnumOptions < ::Protobuf::Message; end class EnumValueOptions < ::Protobuf::Message; end class ServiceOptions < ::Protobuf::Message; end - class MethodOptions < ::Protobuf::Message; end + class MethodOptions < ::Protobuf::Message + class IdempotencyLevel < ::Protobuf::Enum + define :IDEMPOTENCY_UNKNOWN, 0 + define :NO_SIDE_EFFECTS, 1 + define :IDEMPOTENT, 2 + end + + end + class UninterpretedOption < ::Protobuf::Message class NamePart < ::Protobuf::Message; end @@ -94,6 +108,11 @@ class Location < ::Protobuf::Message; end end + class GeneratedCodeInfo < ::Protobuf::Message + class Annotation < ::Protobuf::Message; end + + end + ## @@ -102,7 +121,8 @@ class Location < ::Protobuf::Message; end set_option :java_package, "com.google.protobuf" set_option :java_outer_classname, "DescriptorProtos" set_option :optimize_for, ::Google::Protobuf::FileOptions::OptimizeMode::SPEED - set_option :go_package, "descriptor" + set_option :go_package, "google.golang.org/protobuf/types/descriptorpb" + set_option :cc_enable_arenas, true set_option :objc_class_prefix, "GPB" set_option :csharp_namespace, "Google.Protobuf.Reflection" @@ -133,6 +153,7 @@ class DescriptorProto class ExtensionRange optional :int32, :start, 1 optional :int32, :end, 2 + optional ::Google::Protobuf::ExtensionRangeOptions, :options, 3 end class ReservedRange @@ -152,6 +173,12 @@ class ReservedRange repeated :string, :reserved_name, 10 end + class ExtensionRangeOptions + repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999 + # Extension Fields + extensions 1000...536870912 + end + class FieldDescriptorProto optional :string, :name, 1 optional :int32, :number, 3 @@ -163,16 +190,25 @@ class FieldDescriptorProto optional :int32, :oneof_index, 9 optional :string, :json_name, 10 optional ::Google::Protobuf::FieldOptions, :options, 8 + optional :bool, :proto3_optional, 17 end class OneofDescriptorProto optional :string, :name, 1 + optional ::Google::Protobuf::OneofOptions, :options, 2 end class EnumDescriptorProto + class EnumReservedRange + optional :int32, :start, 1 + optional :int32, :end, 2 + end + optional :string, :name, 1 repeated ::Google::Protobuf::EnumValueDescriptorProto, :value, 2 optional ::Google::Protobuf::EnumOptions, :options, 3 + repeated ::Google::Protobuf::EnumDescriptorProto::EnumReservedRange, :reserved_range, 4 + repeated :string, :reserved_name, 5 end class EnumValueDescriptorProto @@ -200,18 +236,23 @@ class FileOptions optional :string, :java_package, 1 optional :string, :java_outer_classname, 8 optional :bool, :java_multiple_files, 10, :default => false - optional :bool, :java_generate_equals_and_hash, 20, :default => false + optional :bool, :java_generate_equals_and_hash, 20, :deprecated => true optional :bool, :java_string_check_utf8, 27, :default => false optional ::Google::Protobuf::FileOptions::OptimizeMode, :optimize_for, 9, :default => ::Google::Protobuf::FileOptions::OptimizeMode::SPEED optional :string, :go_package, 11 optional :bool, :cc_generic_services, 16, :default => false optional :bool, :java_generic_services, 17, :default => false optional :bool, :py_generic_services, 18, :default => false + optional :bool, :php_generic_services, 42, :default => false optional :bool, :deprecated, 23, :default => false - optional :bool, :cc_enable_arenas, 31, :default => false + optional :bool, :cc_enable_arenas, 31, :default => true optional :string, :objc_class_prefix, 36 optional :string, :csharp_namespace, 37 - optional :bool, :javanano_use_deprecated_package, 38 + optional :string, :swift_prefix, 39 + optional :string, :php_class_prefix, 40 + optional :string, :php_namespace, 41 + optional :string, :php_metadata_namespace, 44 + optional :string, :ruby_package, 45 repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999 # Extension Fields extensions 1000...536870912 @@ -239,6 +280,12 @@ class FieldOptions extensions 1000...536870912 end + class OneofOptions + repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999 + # Extension Fields + extensions 1000...536870912 + end + class EnumOptions optional :bool, :allow_alias, 2 optional :bool, :deprecated, 3, :default => false @@ -263,6 +310,7 @@ class ServiceOptions class MethodOptions optional :bool, :deprecated, 33, :default => false + optional ::Google::Protobuf::MethodOptions::IdempotencyLevel, :idempotency_level, 34, :default => ::Google::Protobuf::MethodOptions::IdempotencyLevel::IDEMPOTENCY_UNKNOWN repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999 # Extension Fields extensions 1000...536870912 @@ -295,6 +343,17 @@ class Location repeated ::Google::Protobuf::SourceCodeInfo::Location, :location, 1 end + class GeneratedCodeInfo + class Annotation + repeated :int32, :path, 1, :packed => true + optional :string, :source_file, 2 + optional :int32, :begin, 3 + optional :int32, :end, 4 + end + + repeated ::Google::Protobuf::GeneratedCodeInfo::Annotation, :annotation, 1 + end + end end diff --git a/proto/google/protobuf/compiler/plugin.proto b/proto/google/protobuf/compiler/plugin.proto index d001fa16..9242aacc 100644 --- a/proto/google/protobuf/compiler/plugin.proto +++ b/proto/google/protobuf/compiler/plugin.proto @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -50,8 +50,20 @@ package google.protobuf.compiler; option java_package = "com.google.protobuf.compiler"; option java_outer_classname = "PluginProtos"; +option go_package = "google.golang.org/protobuf/types/pluginpb"; + import "google/protobuf/descriptor.proto"; +// The version number of protocol compiler. +message Version { + optional int32 major = 1; + optional int32 minor = 2; + optional int32 patch = 3; + // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should + // be empty for mainline stable releases. + optional string suffix = 4; +} + // An encoded CodeGeneratorRequest is written to the plugin's stdin. message CodeGeneratorRequest { // The .proto files that were explicitly listed on the command-line. The @@ -73,7 +85,14 @@ message CodeGeneratorRequest { // the entire set into memory at once. However, as of this writing, this // is not similarly optimized on protoc's end -- it will store all fields in // memory at once before sending them to the plugin. + // + // Type names of fields and extensions in the FileDescriptorProto are always + // fully qualified. repeated FileDescriptorProto proto_file = 15; + + // The version number of protocol compiler. + optional Version compiler_version = 3; + } // The plugin writes an encoded CodeGeneratorResponse to stdout. @@ -88,6 +107,16 @@ message CodeGeneratorResponse { // exiting with a non-zero status code. optional string error = 1; + // A bitmask of supported features that the code generator supports. + // This is a bitwise "or" of values from the Feature enum. + optional uint64 supported_features = 2; + + // Sync with code_generator.h. + enum Feature { + FEATURE_NONE = 0; + FEATURE_PROTO3_OPTIONAL = 1; + } + // Represents a single generated file. message File { // The file name, relative to the output directory. The name must not @@ -144,6 +173,11 @@ message CodeGeneratorResponse { // The file contents. optional string content = 15; + + // Information describing the file content being inserted. If an insertion + // point is used, this information will be appropriately offset and inserted + // into the code generation metadata for the generated files. + optional GeneratedCodeInfo generated_code_info = 16; } repeated File file = 15; } diff --git a/proto/google/protobuf/descriptor.proto b/proto/google/protobuf/descriptor.proto index c59a6022..156e410a 100644 --- a/proto/google/protobuf/descriptor.proto +++ b/proto/google/protobuf/descriptor.proto @@ -40,11 +40,13 @@ syntax = "proto2"; package google.protobuf; -option go_package = "descriptor"; + +option go_package = "google.golang.org/protobuf/types/descriptorpb"; option java_package = "com.google.protobuf"; option java_outer_classname = "DescriptorProtos"; option csharp_namespace = "Google.Protobuf.Reflection"; option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; // descriptor.proto must be optimized for speed because reflection-based // algorithms don't work during bootstrapping. @@ -58,8 +60,8 @@ message FileDescriptorSet { // Describes a complete .proto file. message FileDescriptorProto { - optional string name = 1; // file name, relative to root of source tree - optional string package = 2; // e.g. "foo", "foo.bar", etc. + optional string name = 1; // file name, relative to root of source tree + optional string package = 2; // e.g. "foo", "foo.bar", etc. // Names of files imported by this file. repeated string dependency = 3; @@ -99,8 +101,10 @@ message DescriptorProto { repeated EnumDescriptorProto enum_type = 4; message ExtensionRange { - optional int32 start = 1; - optional int32 end = 2; + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + + optional ExtensionRangeOptions options = 3; } repeated ExtensionRange extension_range = 5; @@ -112,8 +116,8 @@ message DescriptorProto { // fields or extension ranges in the same message. Reserved ranges may // not overlap. message ReservedRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Exclusive. + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. } repeated ReservedRange reserved_range = 9; // Reserved field names, which may not be used by fields in the same message. @@ -121,44 +125,56 @@ message DescriptorProto { repeated string reserved_name = 10; } +message ExtensionRangeOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + // Describes a field within a message. message FieldDescriptorProto { enum Type { // 0 is reserved for errors. // Order is weird for historical reasons. - TYPE_DOUBLE = 1; - TYPE_FLOAT = 2; + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if // negative values are likely. - TYPE_INT64 = 3; - TYPE_UINT64 = 4; + TYPE_INT64 = 3; + TYPE_UINT64 = 4; // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if // negative values are likely. - TYPE_INT32 = 5; - TYPE_FIXED64 = 6; - TYPE_FIXED32 = 7; - TYPE_BOOL = 8; - TYPE_STRING = 9; - TYPE_GROUP = 10; // Tag-delimited aggregate. - TYPE_MESSAGE = 11; // Length-delimited aggregate. + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; + // Tag-delimited aggregate. + // Group type is deprecated and not supported in proto3. However, Proto3 + // implementations should still be able to parse the group wire format and + // treat group fields as unknown fields. + TYPE_GROUP = 10; + TYPE_MESSAGE = 11; // Length-delimited aggregate. // New in version 2. - TYPE_BYTES = 12; - TYPE_UINT32 = 13; - TYPE_ENUM = 14; - TYPE_SFIXED32 = 15; - TYPE_SFIXED64 = 16; - TYPE_SINT32 = 17; // Uses ZigZag encoding. - TYPE_SINT64 = 18; // Uses ZigZag encoding. - }; + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; // Uses ZigZag encoding. + TYPE_SINT64 = 18; // Uses ZigZag encoding. + } enum Label { // 0 is reserved for errors - LABEL_OPTIONAL = 1; - LABEL_REQUIRED = 2; - LABEL_REPEATED = 3; - // TODO(sanjay): Should we add LABEL_MAP? - }; + LABEL_OPTIONAL = 1; + LABEL_REQUIRED = 2; + LABEL_REPEATED = 3; + } optional string name = 1; optional int32 number = 3; @@ -197,11 +213,35 @@ message FieldDescriptorProto { optional string json_name = 10; optional FieldOptions options = 8; + + // If true, this is a proto3 "optional". When a proto3 field is optional, it + // tracks presence regardless of field type. + // + // When proto3_optional is true, this field must be belong to a oneof to + // signal to old proto3 clients that presence is tracked for this field. This + // oneof is known as a "synthetic" oneof, and this field must be its sole + // member (each proto3 optional field gets its own synthetic oneof). Synthetic + // oneofs exist in the descriptor only, and do not generate any API. Synthetic + // oneofs must be ordered after all "real" oneofs. + // + // For message fields, proto3_optional doesn't create any semantic change, + // since non-repeated message fields always track presence. However it still + // indicates the semantic detail of whether the user wrote "optional" or not. + // This can be useful for round-tripping the .proto file. For consistency we + // give message fields a synthetic oneof also, even though it is not required + // to track presence. This is especially important because the parser can't + // tell if a field is a message or an enum, so it must always create a + // synthetic oneof. + // + // Proto2 optional fields do not set this flag, because they already indicate + // optional with `LABEL_OPTIONAL`. + optional bool proto3_optional = 17; } // Describes a oneof. message OneofDescriptorProto { optional string name = 1; + optional OneofOptions options = 2; } // Describes an enum type. @@ -211,6 +251,26 @@ message EnumDescriptorProto { repeated EnumValueDescriptorProto value = 2; optional EnumOptions options = 3; + + // Range of reserved numeric values. Reserved values may not be used by + // entries in the same enum. Reserved ranges may not overlap. + // + // Note that this is distinct from DescriptorProto.ReservedRange in that it + // is inclusive such that it can appropriately represent the entire int32 + // domain. + message EnumReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Inclusive. + } + + // Range of reserved numeric values. Reserved numeric values may not be used + // by enum values in the same enum declaration. Reserved ranges may not + // overlap. + repeated EnumReservedRange reserved_range = 4; + + // Reserved enum value names, which may not be reused. A given name may only + // be reserved once. + repeated string reserved_name = 5; } // Describes a value within an enum. @@ -241,9 +301,9 @@ message MethodDescriptorProto { optional MethodOptions options = 4; // Identifies if client streams multiple client messages - optional bool client_streaming = 5 [default=false]; + optional bool client_streaming = 5 [default = false]; // Identifies if server streams multiple server messages - optional bool server_streaming = 6 [default=false]; + optional bool server_streaming = 6 [default = false]; } @@ -279,7 +339,6 @@ message MethodDescriptorProto { // If this turns out to be popular, a web service will be set up // to automatically assign option numbers. - message FileOptions { // Sets the Java package where classes generated from this .proto will be @@ -289,34 +348,23 @@ message FileOptions { optional string java_package = 1; - // If set, all the classes from the .proto file are wrapped in a single - // outer class with the given name. This applies to both Proto1 - // (equivalent to the old "--one_java_file" option) and Proto2 (where - // a .proto always translates to a single class, but you may want to - // explicitly choose the class name). + // Controls the name of the wrapper Java class generated for the .proto file. + // That class will always contain the .proto file's getDescriptor() method as + // well as any top-level extensions defined in the .proto file. + // If java_multiple_files is disabled, then all the other classes from the + // .proto file will be nested inside the single wrapper outer class. optional string java_outer_classname = 8; - // If set true, then the Java code generator will generate a separate .java + // If enabled, then the Java code generator will generate a separate .java // file for each top-level message, enum, and service defined in the .proto - // file. Thus, these types will *not* be nested inside the outer class - // named by java_outer_classname. However, the outer class will still be + // file. Thus, these types will *not* be nested inside the wrapper class + // named by java_outer_classname. However, the wrapper class will still be // generated to contain the file's getDescriptor() method as well as any // top-level extensions defined in the file. - optional bool java_multiple_files = 10 [default=false]; - - // If set true, then the Java code generator will generate equals() and - // hashCode() methods for all messages defined in the .proto file. - // This increases generated code size, potentially substantially for large - // protos, which may harm a memory-constrained application. - // - In the full runtime this is a speed optimization, as the - // AbstractMessage base class includes reflection-based implementations of - // these methods. - // - In the lite runtime, setting this option changes the semantics of - // equals() and hashCode() to more closely match those of the full runtime; - // the generated methods compute their results based on field values rather - // than object identity. (Implementations should not assume that hashcodes - // will be consistent across runtimes or versions of the protocol compiler.) - optional bool java_generate_equals_and_hash = 20 [default=false]; + optional bool java_multiple_files = 10 [default = false]; + + // This option does nothing. + optional bool java_generate_equals_and_hash = 20 [deprecated=true]; // If set true, then the Java2 code generator will generate code that // throws an exception whenever an attempt is made to assign a non-UTF-8 @@ -324,17 +372,17 @@ message FileOptions { // Message reflection will do the same. // However, an extension field still accepts non-UTF-8 byte sequences. // This option has no effect on when used with the lite runtime. - optional bool java_string_check_utf8 = 27 [default=false]; + optional bool java_string_check_utf8 = 27 [default = false]; // Generated classes can be optimized for speed or code size. enum OptimizeMode { - SPEED = 1; // Generate complete code for parsing, serialization, - // etc. - CODE_SIZE = 2; // Use ReflectionOps to implement these methods. - LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. + SPEED = 1; // Generate complete code for parsing, serialization, + // etc. + CODE_SIZE = 2; // Use ReflectionOps to implement these methods. + LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. } - optional OptimizeMode optimize_for = 9 [default=SPEED]; + optional OptimizeMode optimize_for = 9 [default = SPEED]; // Sets the Go package where structs generated from this .proto will be // placed. If omitted, the Go package will be derived from the following: @@ -345,6 +393,7 @@ message FileOptions { + // Should generic services be generated in each language? "Generic" services // are not specific to any particular RPC system. They are generated by the // main code generators in each language (without additional plugins). @@ -355,19 +404,20 @@ message FileOptions { // that generate code specific to your particular RPC system. Therefore, // these default to false. Old code which depends on generic services should // explicitly set them to true. - optional bool cc_generic_services = 16 [default=false]; - optional bool java_generic_services = 17 [default=false]; - optional bool py_generic_services = 18 [default=false]; + optional bool cc_generic_services = 16 [default = false]; + optional bool java_generic_services = 17 [default = false]; + optional bool py_generic_services = 18 [default = false]; + optional bool php_generic_services = 42 [default = false]; // Is this file deprecated? // Depending on the target platform, this can emit Deprecated annotations // for everything in the file, or it will be completely ignored; in the very // least, this is a formalization for deprecating files. - optional bool deprecated = 23 [default=false]; + optional bool deprecated = 23 [default = false]; // Enables the use of arenas for the proto messages in this file. This applies // only to generated classes for C++. - optional bool cc_enable_arenas = 31 [default=false]; + optional bool cc_enable_arenas = 31 [default = true]; // Sets the objective c class prefix which is prepended to all objective c @@ -377,15 +427,41 @@ message FileOptions { // Namespace for generated classes; defaults to the package. optional string csharp_namespace = 37; - // Whether the nano proto compiler should generate in the deprecated non-nano - // suffixed package. - optional bool javanano_use_deprecated_package = 38; + // By default Swift generators will take the proto package and CamelCase it + // replacing '.' with underscore and use that to prefix the types/symbols + // defined. When this options is provided, they will use this value instead + // to prefix the types/symbols defined. + optional string swift_prefix = 39; - // The parser stores options it doesn't recognize here. See above. + // Sets the php class prefix which is prepended to all php generated classes + // from this .proto. Default is empty. + optional string php_class_prefix = 40; + + // Use this option to change the namespace of php generated classes. Default + // is empty. When this option is empty, the package name will be used for + // determining the namespace. + optional string php_namespace = 41; + + // Use this option to change the namespace of php generated metadata classes. + // Default is empty. When this option is empty, the proto file name will be + // used for determining the namespace. + optional string php_metadata_namespace = 44; + + // Use this option to change the package of ruby generated classes. Default + // is empty. When this option is not set, the package name will be used for + // determining the ruby package. + optional string ruby_package = 45; + + + // The parser stores options it doesn't recognize here. + // See the documentation for the "Options" section above. repeated UninterpretedOption uninterpreted_option = 999; - // Clients can define custom options in extensions of this message. See above. + // Clients can define custom options in extensions of this message. + // See the documentation for the "Options" section above. extensions 1000 to max; + + reserved 38; } message MessageOptions { @@ -407,18 +483,20 @@ message MessageOptions { // // Because this is an option, the above two restrictions are not enforced by // the protocol compiler. - optional bool message_set_wire_format = 1 [default=false]; + optional bool message_set_wire_format = 1 [default = false]; // Disables the generation of the standard "descriptor()" accessor, which can // conflict with a field of the same name. This is meant to make migration // from proto1 easier; new code should avoid fields named "descriptor". - optional bool no_standard_descriptor_accessor = 2 [default=false]; + optional bool no_standard_descriptor_accessor = 2 [default = false]; // Is this message deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the message, or it will be completely ignored; in the very least, // this is a formalization for deprecating messages. - optional bool deprecated = 3 [default=false]; + optional bool deprecated = 3 [default = false]; + + reserved 4, 5, 6; // Whether the message is an automatically generated map entry type for the // maps field. @@ -435,7 +513,7 @@ message MessageOptions { // // Implementations may choose not to generate the map_entry=true message, but // use a native map in the target language to hold the keys and values. - // The reflection APIs in such implementions still need to work as + // The reflection APIs in such implementations still need to work as // if the field is a repeated message field. // // NOTE: Do not set the option in .proto files. Always use the maps syntax @@ -443,6 +521,10 @@ message MessageOptions { // parser. optional bool map_entry = 7; + reserved 8; // javalite_serializable + reserved 9; // javanano_as_lite + + // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; @@ -471,16 +553,17 @@ message FieldOptions { // false will avoid using packed encoding. optional bool packed = 2; - // The jstype option determines the JavaScript type used for values of the // field. The option is permitted only for 64 bit integral and fixed types - // (int64, uint64, sint64, fixed64, sfixed64). By default these types are - // represented as JavaScript strings. This avoids loss of precision that can - // happen when a large value is converted to a floating point JavaScript - // numbers. Specifying JS_NUMBER for the jstype causes the generated - // JavaScript code to use the JavaScript "number" type instead of strings. - // This option is an enum to permit additional types to be added, - // e.g. goog.math.Integer. + // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + // is represented as JavaScript string, which avoids loss of precision that + // can happen when a large value is converted to a floating point JavaScript. + // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + // use the JavaScript "number" type. The behavior of the default option + // JS_NORMAL is implementation dependent. + // + // This option is an enum to permit additional types to be added, e.g. + // goog.math.Integer. optional JSType jstype = 6 [default = JS_NORMAL]; enum JSType { // Use the default type. @@ -512,7 +595,7 @@ message FieldOptions { // // // Note that implementations may choose not to check required fields within - // a lazy sub-message. That is, calling IsInitialized() on the outher message + // a lazy sub-message. That is, calling IsInitialized() on the outer message // may return true even if the inner message has missing required fields. // This is necessary because otherwise the inner message would have to be // parsed in order to perform the check, defeating the purpose of lazy @@ -521,18 +604,28 @@ message FieldOptions { // implementation must either *always* check its required fields, or *never* // check its required fields, regardless of whether or not the message has // been parsed. - optional bool lazy = 5 [default=false]; + optional bool lazy = 5 [default = false]; // Is this field deprecated? // Depending on the target platform, this can emit Deprecated annotations // for accessors, or it will be completely ignored; in the very least, this // is a formalization for deprecating fields. - optional bool deprecated = 3 [default=false]; + optional bool deprecated = 3 [default = false]; // For Google-internal migration only. Do not use. - optional bool weak = 10 [default=false]; + optional bool weak = 10 [default = false]; + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; + + reserved 4; // removed jtype +} + +message OneofOptions { // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; @@ -550,7 +643,9 @@ message EnumOptions { // Depending on the target platform, this can emit Deprecated annotations // for the enum, or it will be completely ignored; in the very least, this // is a formalization for deprecating enums. - optional bool deprecated = 3 [default=false]; + optional bool deprecated = 3 [default = false]; + + reserved 5; // javanano_as_lite // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; @@ -564,7 +659,7 @@ message EnumValueOptions { // Depending on the target platform, this can emit Deprecated annotations // for the enum value, or it will be completely ignored; in the very least, // this is a formalization for deprecating enum values. - optional bool deprecated = 1 [default=false]; + optional bool deprecated = 1 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; @@ -584,7 +679,7 @@ message ServiceOptions { // Depending on the target platform, this can emit Deprecated annotations // for the service, or it will be completely ignored; in the very least, // this is a formalization for deprecating services. - optional bool deprecated = 33 [default=false]; + optional bool deprecated = 33 [default = false]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; @@ -604,7 +699,18 @@ message MethodOptions { // Depending on the target platform, this can emit Deprecated annotations // for the method, or it will be completely ignored; in the very least, // this is a formalization for deprecating methods. - optional bool deprecated = 33 [default=false]; + optional bool deprecated = 33 [default = false]; + + // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + // or neither? HTTP based RPC implementation may choose GET verb for safe + // methods, and PUT verb for idempotent methods instead of the default POST. + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0; + NO_SIDE_EFFECTS = 1; // implies idempotent + IDEMPOTENT = 2; // idempotent, but may have side effects + } + optional IdempotencyLevel idempotency_level = 34 + [default = IDEMPOTENCY_UNKNOWN]; // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; @@ -685,7 +791,7 @@ message SourceCodeInfo { // beginning of the "extend" block and is shared by all extensions within // the block. // - Just because a location's span is a subset of some other location's span - // does not mean that it is a descendent. For example, a "group" defines + // does not mean that it is a descendant. For example, a "group" defines // both a type and a field in a single declaration. Thus, the locations // corresponding to the type and field and their components will overlap. // - Code which tries to interpret locations should probably be designed to @@ -716,14 +822,14 @@ message SourceCodeInfo { // [ 4, 3, 2, 7 ] // this path refers to the whole field declaration (from the beginning // of the label to the terminating semicolon). - repeated int32 path = 1 [packed=true]; + repeated int32 path = 1 [packed = true]; // Always has exactly three or four elements: start line, start column, // end line (optional, otherwise assumed same as start line), end column. // These are packed into a single field for efficiency. Note that line // and column numbers are zero-based -- typically you will want to add // 1 to each before displaying to a user. - repeated int32 span = 2 [packed=true]; + repeated int32 span = 2 [packed = true]; // If this SourceCodeInfo represents a complete declaration, these are any // comments appearing before and after the declaration which appear to be @@ -777,3 +883,29 @@ message SourceCodeInfo { repeated string leading_detached_comments = 6; } } + +// Describes the relationship between generated code and its original source +// file. A GeneratedCodeInfo message is associated with only one generated +// source file, but may contain references to different source .proto files. +message GeneratedCodeInfo { + // An Annotation connects some span of text in generated code to an element + // of its generating .proto file. + repeated Annotation annotation = 1; + message Annotation { + // Identifies the element in the original source .proto file. This field + // is formatted the same as SourceCodeInfo.Location.path. + repeated int32 path = 1 [packed = true]; + + // Identifies the filesystem path to the original source .proto. + optional string source_file = 2; + + // Identifies the starting offset in bytes in the generated code + // that relates to the identified object. + optional int32 begin = 3; + + // Identifies the ending offset in bytes in the generated code that + // relates to the identified offset. The end offset should be one past + // the last relevant byte (so the length of the text = end - begin). + optional int32 end = 4; + } +} From db85425bc8a8d2a60d8e4ab46360e6bcd9074e28 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Mon, 13 Sep 2021 09:31:58 -0600 Subject: [PATCH 77/93] Bump version to v3.10.5 --- lib/protobuf/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protobuf/version.rb b/lib/protobuf/version.rb index 77a79c63..8ed405a7 100644 --- a/lib/protobuf/version.rb +++ b/lib/protobuf/version.rb @@ -1,3 +1,3 @@ module Protobuf - VERSION = '3.10.4' # rubocop:disable Style/MutableConstant + VERSION = '3.10.5' # rubocop:disable Style/MutableConstant end From 4d2278e2fb5c365f2cf61ac56204f6e2fcbef09e Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Wed, 27 Apr 2022 10:26:21 -0600 Subject: [PATCH 78/93] Use activesupport/all in tests (>= 6 causes load errors) --- spec/lib/protobuf/rpc/stat_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/lib/protobuf/rpc/stat_spec.rb b/spec/lib/protobuf/rpc/stat_spec.rb index 9abd627f..10015491 100644 --- a/spec/lib/protobuf/rpc/stat_spec.rb +++ b/spec/lib/protobuf/rpc/stat_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' require 'timecop' -require 'active_support/core_ext/numeric/time' +require 'active_support/all' RSpec.describe ::Protobuf::Rpc::Stat do From 7f0a2b89afd417fa67561ee81380f546f46f64fe Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Wed, 27 Apr 2022 10:42:02 -0600 Subject: [PATCH 79/93] Ensure server is always set for PbError messages in exception handler --- lib/protobuf/rpc/error.rb | 8 ++++---- lib/protobuf/rpc/middleware/exception_handler.rb | 13 ++++++++++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/protobuf/rpc/error.rb b/lib/protobuf/rpc/error.rb index 343d1889..038eeca9 100644 --- a/lib/protobuf/rpc/error.rb +++ b/lib/protobuf/rpc/error.rb @@ -13,12 +13,12 @@ def initialize(message = 'An unknown RpcError occurred', error_type = 'RPC_ERROR super message end - def encode - to_response.encode + def encode(args = {}) + to_response(args).encode end - def to_response - ::Protobuf::Socketrpc::Response.new(:error => message, :error_reason => error_type) + def to_response(args = {}) + ::Protobuf::Socketrpc::Response.new({:error => message, :error_reason => error_type}.merge(args)) end end end diff --git a/lib/protobuf/rpc/middleware/exception_handler.rb b/lib/protobuf/rpc/middleware/exception_handler.rb index 9592c049..376e0375 100644 --- a/lib/protobuf/rpc/middleware/exception_handler.rb +++ b/lib/protobuf/rpc/middleware/exception_handler.rb @@ -22,7 +22,7 @@ def _call(env) # Rescue exceptions, re-wrap them as generic Protobuf errors, # and encode them env.response = wrap_exception(exception) - env.encoded_response = env.response.encode + env.encoded_response = wrap_and_encode_with_server(env.response, env) env end @@ -34,6 +34,17 @@ def wrap_exception(exception) exception = RpcFailed.new(exception.message) unless exception.is_a?(PbError) exception end + + # If the response is a PbError, it won't have the server merged into the response proto. + # We should add it here since exception handler is always at the bottom of the middleware + # stack. Without this, the server hostname in the client rpc log will not be set. + def wrap_and_encode_with_server(response, env) + if response.is_a?(PbError) + response.encode(:server => env.server) + else + response.encode + end + end end end end From ddb619082d34bb29a74246959454cf6f755c467c Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Wed, 27 Apr 2022 10:48:11 -0600 Subject: [PATCH 80/93] Add supporting tests showing server is added to the encoded error --- spec/lib/protobuf/rpc/middleware/exception_handler_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/lib/protobuf/rpc/middleware/exception_handler_spec.rb b/spec/lib/protobuf/rpc/middleware/exception_handler_spec.rb index 0a71e43d..01248f40 100644 --- a/spec/lib/protobuf/rpc/middleware/exception_handler_spec.rb +++ b/spec/lib/protobuf/rpc/middleware/exception_handler_spec.rb @@ -2,7 +2,7 @@ RSpec.describe Protobuf::Rpc::Middleware::ExceptionHandler do let(:app) { proc { |env| env } } - let(:env) { Protobuf::Rpc::Env.new } + let(:env) { Protobuf::Rpc::Env.new("server" => "cooldude") } subject { described_class.new(app) } @@ -17,7 +17,7 @@ end context "when exceptions occur" do - let(:encoded_error) { error.encode } + let(:encoded_error) { error.encode(:server => "cooldude") } let(:error) { Protobuf::Rpc::MethodNotFound.new('Boom!') } before { allow(app).to receive(:call).and_raise(error, 'Boom!') } @@ -42,7 +42,7 @@ end context "when exception is not a Protobuf error" do - let(:encoded_error) { error.encode } + let(:encoded_error) { error.encode(:server => "cooldude") } let(:error) { Protobuf::Rpc::RpcFailed.new('Boom!') } before { allow(app).to receive(:call).and_raise(RuntimeError, 'Boom!') } From 89827d67ed5ab6e69b7062e612c8b5d35b87f3d4 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Wed, 27 Apr 2022 10:49:53 -0600 Subject: [PATCH 81/93] Rubocop --- lib/protobuf/rpc/error.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protobuf/rpc/error.rb b/lib/protobuf/rpc/error.rb index 038eeca9..584a0425 100644 --- a/lib/protobuf/rpc/error.rb +++ b/lib/protobuf/rpc/error.rb @@ -18,7 +18,7 @@ def encode(args = {}) end def to_response(args = {}) - ::Protobuf::Socketrpc::Response.new({:error => message, :error_reason => error_type}.merge(args)) + ::Protobuf::Socketrpc::Response.new({ :error => message, :error_reason => error_type }.merge(args)) end end end From bcd668f32a482c5d5b5a678253bee7943994c97d Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Wed, 27 Apr 2022 11:28:22 -0600 Subject: [PATCH 82/93] simplify ci / drop 2.4 ruby --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e1c40701..c90128e3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -42,7 +42,5 @@ workflows: ruby-image: - circleci/jruby:9.2.6.0-jdk - circleci/jruby:9.1.17.0-jdk - - circleci/jruby:9.2-jdk8 - - circleci/ruby:2.4 - circleci/ruby:2.5 - circleci/ruby:2.7 From ea0c98efc316288e2f7e080cf7aa186cc220adf7 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Wed, 27 Apr 2022 11:36:03 -0600 Subject: [PATCH 83/93] Bump version to 3.10.6 --- lib/protobuf/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protobuf/version.rb b/lib/protobuf/version.rb index 8ed405a7..28251aa8 100644 --- a/lib/protobuf/version.rb +++ b/lib/protobuf/version.rb @@ -1,3 +1,3 @@ module Protobuf - VERSION = '3.10.5' # rubocop:disable Style/MutableConstant + VERSION = '3.10.6' # rubocop:disable Style/MutableConstant end From 3305a9d9b43730572b5ea0f17c54c8bffc2c3ddc Mon Sep 17 00:00:00 2001 From: tison Date: Wed, 24 Aug 2022 13:30:54 +0800 Subject: [PATCH 84/93] Allow captialize enums name Signed-off-by: tison --- lib/protobuf/generators/enum_generator.rb | 1 + lib/protobuf/generators/field_generator.rb | 2 ++ spec/lib/protobuf/generators/enum_generator_spec.rb | 9 +++++++++ spec/lib/protobuf/generators/field_generator_spec.rb | 9 +++++++++ 4 files changed, 21 insertions(+) diff --git a/lib/protobuf/generators/enum_generator.rb b/lib/protobuf/generators/enum_generator.rb index 1088e3ed..b8522171 100644 --- a/lib/protobuf/generators/enum_generator.rb +++ b/lib/protobuf/generators/enum_generator.rb @@ -29,6 +29,7 @@ def compile def build_value(enum_value_descriptor) name = enum_value_descriptor.name + name.capitalize! if ENV.key?('PB_CAPITALIZE_ENUMS') name.upcase! if ENV.key?('PB_UPCASE_ENUMS') number = enum_value_descriptor.number "define :#{name}, #{number}" diff --git a/lib/protobuf/generators/field_generator.rb b/lib/protobuf/generators/field_generator.rb index 68652fcc..1642308f 100644 --- a/lib/protobuf/generators/field_generator.rb +++ b/lib/protobuf/generators/field_generator.rb @@ -140,6 +140,8 @@ def enum_default_value optionally_upcased_default = if ENV.key?('PB_UPCASE_ENUMS') verbatim_default_value.upcase + elsif ENV.key?('PB_CAPITALIZE_ENUMS') + verbatim_default_value.capitalize else verbatim_default_value end diff --git a/spec/lib/protobuf/generators/enum_generator_spec.rb b/spec/lib/protobuf/generators/enum_generator_spec.rb index 1c263188..95637aac 100644 --- a/spec/lib/protobuf/generators/enum_generator_spec.rb +++ b/spec/lib/protobuf/generators/enum_generator_spec.rb @@ -77,6 +77,15 @@ class TestEnum < ::Protobuf::Enum expect(subject.build_value(enum.value.first)).to eq("define :BOOM, 1") end end + + context 'with PB_CAPITALIZE_ENUMS set' do + before { allow(ENV).to receive(:key?).with('PB_CAPITALIZE_ENUMS').and_return(true) } + let(:values) { [{ :name => 'boom', :number => 1 }] } + + it 'returns a string with the given enum name in ALL CAPS' do + expect(subject.build_value(enum.value.first)).to eq("define :Boom, 1") + end + end end end diff --git a/spec/lib/protobuf/generators/field_generator_spec.rb b/spec/lib/protobuf/generators/field_generator_spec.rb index e4d78ea2..d1ec7635 100644 --- a/spec/lib/protobuf/generators/field_generator_spec.rb +++ b/spec/lib/protobuf/generators/field_generator_spec.rb @@ -71,6 +71,15 @@ specify { expect(subject).to eq " optional ::Foo::Bar::Baz, :foo_bar, 3, :default => ::Foo::Bar::Baz::QUUX\n" } end + context 'when type is an enum with lowercase default value with PB_CAPITALIZE_ENUMS set' do + let(:type_enum) { :TYPE_ENUM } + let(:type_name) { '.foo.bar.Baz' } + let(:default_value) { 'quux' } + before { allow(ENV).to receive(:key?).with('PB_CAPITALIZE_ENUMS').and_return(true) } + + specify { expect(subject).to eq " optional ::Foo::Bar::Baz, :foo_bar, 3, :default => ::Foo::Bar::Baz::Quux\n" } + end + context 'when the type is a string' do let(:type_enum) { :TYPE_STRING } let(:default_value) { "a default \"string\"" } From e59fdf4fe3dd428b48bb0c641790d55691cbcd43 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Wed, 24 Aug 2022 10:17:38 -0600 Subject: [PATCH 85/93] Fix rspec to work with different receiver args --- spec/lib/protobuf/generators/enum_generator_spec.rb | 2 ++ spec/lib/protobuf/generators/field_generator_spec.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/spec/lib/protobuf/generators/enum_generator_spec.rb b/spec/lib/protobuf/generators/enum_generator_spec.rb index 95637aac..767a5d9d 100644 --- a/spec/lib/protobuf/generators/enum_generator_spec.rb +++ b/spec/lib/protobuf/generators/enum_generator_spec.rb @@ -71,6 +71,7 @@ class TestEnum < ::Protobuf::Enum context 'with PB_UPCASE_ENUMS set' do before { allow(ENV).to receive(:key?).with('PB_UPCASE_ENUMS').and_return(true) } + before { allow(ENV).to receive(:key?).with('PB_CAPITALIZE_ENUMS').and_return(false) } let(:values) { [{ :name => 'boom', :number => 1 }] } it 'returns a string with the given enum name in ALL CAPS' do @@ -79,6 +80,7 @@ class TestEnum < ::Protobuf::Enum end context 'with PB_CAPITALIZE_ENUMS set' do + before { allow(ENV).to receive(:key?).with('PB_UPCASE_ENUMS').and_return(false) } before { allow(ENV).to receive(:key?).with('PB_CAPITALIZE_ENUMS').and_return(true) } let(:values) { [{ :name => 'boom', :number => 1 }] } diff --git a/spec/lib/protobuf/generators/field_generator_spec.rb b/spec/lib/protobuf/generators/field_generator_spec.rb index d1ec7635..fc7c3def 100644 --- a/spec/lib/protobuf/generators/field_generator_spec.rb +++ b/spec/lib/protobuf/generators/field_generator_spec.rb @@ -67,6 +67,7 @@ let(:type_name) { '.foo.bar.Baz' } let(:default_value) { 'quux' } before { allow(ENV).to receive(:key?).with('PB_UPCASE_ENUMS').and_return(true) } + before { allow(ENV).to receive(:key?).with('PB_CAPITALIZE_ENUMS').and_return(false) } specify { expect(subject).to eq " optional ::Foo::Bar::Baz, :foo_bar, 3, :default => ::Foo::Bar::Baz::QUUX\n" } end @@ -75,6 +76,7 @@ let(:type_enum) { :TYPE_ENUM } let(:type_name) { '.foo.bar.Baz' } let(:default_value) { 'quux' } + before { allow(ENV).to receive(:key?).with('PB_UPCASE_ENUMS').and_return(false) } before { allow(ENV).to receive(:key?).with('PB_CAPITALIZE_ENUMS').and_return(true) } specify { expect(subject).to eq " optional ::Foo::Bar::Baz, :foo_bar, 3, :default => ::Foo::Bar::Baz::Quux\n" } From b866fc5667226d0582f328ab24c648e578c5a380 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Wed, 24 Aug 2022 10:18:08 -0600 Subject: [PATCH 86/93] Bump version to 3.10.7 --- lib/protobuf/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protobuf/version.rb b/lib/protobuf/version.rb index 28251aa8..f29d2675 100644 --- a/lib/protobuf/version.rb +++ b/lib/protobuf/version.rb @@ -1,3 +1,3 @@ module Protobuf - VERSION = '3.10.6' # rubocop:disable Style/MutableConstant + VERSION = '3.10.7' # rubocop:disable Style/MutableConstant end From 869dcfd3613c3f4f7078fa83cd7abc776c3a25c0 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Wed, 8 Nov 2023 20:01:25 +0100 Subject: [PATCH 87/93] Require `active_support` before cherry-picking features It's part of the Active Support contract, the entry point must be loaded, otherwise requiring individual components may fail. Fixes: ``` active_support/core_ext/time/conversions.rb:62:in `': undefined method `deprecator' for ActiveSupport:Module (NoMethodError) from gems/activesupport-7.1.1/lib/active_support/core_ext/time/conversions.rb:7:in `' from gems/activesupport-7.1.1/lib/active_support/core_ext/object/json.rb:14:in `require' from gems/activesupport-7.1.1/lib/active_support/core_ext/object/json.rb:14:in `' from gems/activesupport-7.1.1/lib/active_support/json/encoding.rb:3:in `require' from gems/activesupport-7.1.1/lib/active_support/json/encoding.rb:3:in `' from gems/activesupport-7.1.1/lib/active_support/json.rb:4:in `require' from gems/activesupport-7.1.1/lib/active_support/json.rb:4:in `' from gems/protobuf-cucumber-3.10.8/lib/protobuf.rb:10:in `require' ``` --- lib/protobuf.rb | 1 + lib/protobuf/cli.rb | 1 + lib/protobuf/code_generator.rb | 1 + lib/protobuf/deprecation.rb | 1 + lib/protobuf/field/base_field.rb | 1 + spec/support/server.rb | 1 + 6 files changed, 6 insertions(+) diff --git a/lib/protobuf.rb b/lib/protobuf.rb index 69139e2c..c6040fd4 100644 --- a/lib/protobuf.rb +++ b/lib/protobuf.rb @@ -4,6 +4,7 @@ require 'socket' require 'stringio' +require 'active_support' require 'active_support/core_ext/object/blank' require 'active_support/core_ext/object/try' require 'active_support/inflector' diff --git a/lib/protobuf/cli.rb b/lib/protobuf/cli.rb index 35c6d936..0a84443b 100644 --- a/lib/protobuf/cli.rb +++ b/lib/protobuf/cli.rb @@ -1,3 +1,4 @@ +require 'active_support' require 'active_support/core_ext/hash/keys' require 'active_support/inflector' diff --git a/lib/protobuf/code_generator.rb b/lib/protobuf/code_generator.rb index 7068800b..0a006f56 100644 --- a/lib/protobuf/code_generator.rb +++ b/lib/protobuf/code_generator.rb @@ -1,3 +1,4 @@ +require 'active_support' require 'active_support/core_ext/module/aliasing' require 'protobuf/generators/file_generator' diff --git a/lib/protobuf/deprecation.rb b/lib/protobuf/deprecation.rb index 8c0d415e..97b56698 100644 --- a/lib/protobuf/deprecation.rb +++ b/lib/protobuf/deprecation.rb @@ -1,3 +1,4 @@ +require 'active_support' require 'active_support/deprecation' module Protobuf diff --git a/lib/protobuf/field/base_field.rb b/lib/protobuf/field/base_field.rb index 6f2f4f7f..86472738 100644 --- a/lib/protobuf/field/base_field.rb +++ b/lib/protobuf/field/base_field.rb @@ -1,3 +1,4 @@ +require 'active_support' require 'active_support/core_ext/hash/slice' require 'protobuf/field/field_array' require 'protobuf/field/field_hash' diff --git a/spec/support/server.rb b/spec/support/server.rb index 8a0203b6..16fc5678 100644 --- a/spec/support/server.rb +++ b/spec/support/server.rb @@ -1,5 +1,6 @@ require 'ostruct' +require 'active_support' require 'active_support/core_ext/hash/reverse_merge' require 'spec_helper' From ee5f73bb270b1a7b7ab44c95c8099a7790fc4882 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Mon, 27 Nov 2023 09:30:22 -0700 Subject: [PATCH 88/93] Bump version to 3.10.8 --- lib/protobuf/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protobuf/version.rb b/lib/protobuf/version.rb index f29d2675..f570feaa 100644 --- a/lib/protobuf/version.rb +++ b/lib/protobuf/version.rb @@ -1,3 +1,3 @@ module Protobuf - VERSION = '3.10.7' # rubocop:disable Style/MutableConstant + VERSION = '3.10.8' # rubocop:disable Style/MutableConstant end From cfde698227e8b2fe0076625b7c653f10501bb7d6 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Mon, 13 Apr 2020 12:11:15 +0200 Subject: [PATCH 89/93] Load correct versions of pry and pry-byebug on older Rubies This does two things: - Move complex dependency logic out of the gemspec. The gemspec logic is only evaluated at build time, so keeping Ruby version dependendent logic in there causes different gems to be published depending on the source machine. - Load slightly older pry versions on Ruby 2.3 and lower, so they work with the pry-byebug version that supports those older Ruby versions. --- Gemfile | 23 +++++++++++++++++++++++ protobuf.gemspec | 19 ------------------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/Gemfile b/Gemfile index fa75df15..a19bf744 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,26 @@ source 'https://rubygems.org/' gemspec + +group :development do + # debuggers only work in MRI + if RUBY_ENGINE.to_sym == :ruby + if RUBY_VERSION < '2.0.0' + gem 'pry-debugger' + elsif RUBY_VERSION < '2.4.0' + gem 'pry-byebug' + gem 'pry', '~> 0.12.0' + else + gem 'pry-byebug', '~> 3.9.0' + gem 'pry', '~> 0.13.0' + end + + gem 'pry-stack_explorer' + + gem 'varint' + gem 'ruby-prof' + elsif RUBY_PLATFORM =~ /java/i + gem 'fast_blank_java' + gem 'pry' + end +end diff --git a/protobuf.gemspec b/protobuf.gemspec index 4f182c4e..9cad244b 100644 --- a/protobuf.gemspec +++ b/protobuf.gemspec @@ -35,23 +35,4 @@ require "protobuf/version" s.add_development_dependency 'simplecov' s.add_development_dependency 'timecop' s.add_development_dependency 'yard' - - # debuggers only work in MRI - if RUBY_ENGINE.to_sym == :ruby - # we don't support MRI < 1.9.3 - pry_debugger = if RUBY_VERSION < '2.0.0' - 'pry-debugger' - else - 'pry-byebug' - end - - s.add_development_dependency pry_debugger - s.add_development_dependency 'pry-stack_explorer' - - s.add_development_dependency 'varint' - s.add_development_dependency 'ruby-prof' - elsif RUBY_PLATFORM =~ /java/i - s.add_development_dependency 'fast_blank_java' - s.add_development_dependency 'pry' - end end From b00d91e7df255536428843723e0b18cb768d6751 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Mon, 13 Apr 2020 08:50:16 +0200 Subject: [PATCH 90/93] Update development dependencies --- protobuf.gemspec | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/protobuf.gemspec b/protobuf.gemspec index 9cad244b..055be259 100644 --- a/protobuf.gemspec +++ b/protobuf.gemspec @@ -28,10 +28,9 @@ require "protobuf/version" s.add_development_dependency 'benchmark-ips' s.add_development_dependency 'ffi-rzmq' - s.add_development_dependency 'rake', '< 11.0' # Rake 11.0.1 removes the last_comment method which rspec-core (< 3.4.4) uses - s.add_development_dependency 'rspec', '>= 3.0' - s.add_development_dependency "rubocop", "~> 0.38.0" - s.add_development_dependency "parser", "2.3.0.6" # Locked this down since 2.3.0.7 causes issues. https://github.com/bbatsov/rubocop/pull/2984 + s.add_development_dependency 'rake', '~> 13.0' + s.add_development_dependency 'rspec', '~> 3.5' + s.add_development_dependency "rubocop", "~> 0.81.0" s.add_development_dependency 'simplecov' s.add_development_dependency 'timecop' s.add_development_dependency 'yard' From 4faecead1fb12419295db78bc24b8e795f0d3304 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Mon, 13 Apr 2020 08:58:31 +0200 Subject: [PATCH 91/93] Update RuboCop configuration for RuboCop 0.81.0 --- .rubocop.yml | 29 ++- .rubocop_todo.yml | 516 ++++++++++++++++++++++++++++++++----- lib/protobuf/rpc/buffer.rb | 4 +- 3 files changed, 476 insertions(+), 73 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 310aa0c8..c4fa04ce 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,8 +6,8 @@ AllCops: - 'spec/support/protos/*.pb.rb' - 'varint_prof.rb' -Lint/EndAlignment: - AlignWith: keyword +Layout/EndAlignment: + EnforcedStyleAlignWith: keyword Lint/Loop: Enabled: false @@ -18,25 +18,25 @@ Metrics/ClassLength: Metrics/ModuleLength: Enabled: false -Style/CaseIndentation: - IndentWhenRelativeTo: end +Layout/CaseIndentation: + EnforcedStyle: end Style/ClassAndModuleChildren: Exclude: - '**/*.pb.rb' -Style/ClassAndModuleCamelCase: +Naming/ClassAndModuleCamelCase: Exclude: - '**/*.pb.rb' -Style/EmptyLineBetweenDefs: +Layout/EmptyLineBetweenDefs: AllowAdjacentOneLineDefs: true -Style/EmptyLines: +Layout/EmptyLines: Exclude: - '**/*.pb.rb' -Style/FileName: +Naming/FileName: Exclude: - '**/protoc-gen-ruby*' @@ -46,7 +46,7 @@ Style/GuardClause: Style/HashSyntax: EnforcedStyle: hash_rockets -Style/IndentHash: +Layout/FirstHashElementIndentation: EnforcedStyle: consistent Style/Semicolon: @@ -55,16 +55,23 @@ Style/Semicolon: Style/SingleLineBlockParams: Enabled: false -Style/TrailingBlankLines: +Layout/TrailingEmptyLines: Exclude: - '**/*.pb.rb' Style/TrailingCommaInArguments: EnforcedStyleForMultiline: comma -Style/TrailingCommaInLiteral: +Style/TrailingCommaInArrayLiteral: + EnforcedStyleForMultiline: comma + +Style/TrailingCommaInHashLiteral: EnforcedStyleForMultiline: comma Style/TrivialAccessors: AllowDSLWriters: true AllowPredicates: true + +Style/Encoding: + Exclude: + - '**/*.pb.rb' diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 611730ad..bd670fea 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,30 +1,208 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2015-09-25 12:31:31 -0700 using RuboCop version 0.34.2. +# on 2020-04-13 09:00:39 +0200 using RuboCop version 0.81.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 31 +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: TreatCommentsAsGroupSeparators, Include. +# Include: **/*.gemspec +Gemspec/OrderedDependencies: + Exclude: + - 'protobuf.gemspec' + +# Offense count: 2 +# Configuration parameters: Include. +# Include: **/*.gemspec +Gemspec/RubyVersionGlobalsUsage: + Exclude: + - 'protobuf.gemspec' + +# Offense count: 2 +# Cop supports --auto-correct. +Layout/ClosingParenthesisIndentation: + Exclude: + - 'spec/lib/protobuf/generators/base_spec.rb' + - 'spec/lib/protobuf/rpc/service_spec.rb' + +# Offense count: 42 +# Cop supports --auto-correct. +Layout/EmptyLineAfterGuardClause: + Enabled: false + +# Offense count: 1 +# Cop supports --auto-correct. +Layout/EmptyLineAfterMagicComment: + Exclude: + - 'protobuf.gemspec' + +# Offense count: 83 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty_lines, no_empty_lines +Layout/EmptyLinesAroundBlockBody: + Enabled: false + +# Offense count: 75 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only +Layout/EmptyLinesAroundClassBody: + Enabled: false + +# Offense count: 39 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines +Layout/EmptyLinesAroundModuleBody: + Enabled: false + +# Offense count: 30 +# Cop supports --auto-correct. +# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. +# SupportedHashRocketStyles: key, separator, table +# SupportedColonStyles: key, separator, table +# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit +Layout/HashAlignment: + Exclude: + - 'Rakefile' + - 'lib/protobuf/field.rb' + - 'lib/protobuf/rpc/connectors/base.rb' + - 'spec/lib/protobuf/enum_spec.rb' + - 'spec/lib/protobuf/rpc/middleware/response_encoder_spec.rb' + +# Offense count: 7 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: squiggly, active_support, powerpack, unindent +Layout/HeredocIndentation: + Exclude: + - 'spec/lib/protobuf/generators/enum_generator_spec.rb' + - 'spec/lib/protobuf/generators/file_generator_spec.rb' + - 'spec/lib/protobuf/generators/service_generator_spec.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: symmetrical, new_line, same_line +Layout/MultilineArrayBraceLayout: + Exclude: + - 'spec/lib/protobuf/generators/field_generator_spec.rb' + - 'spec/lib/protobuf/message_spec.rb' + +# Offense count: 10 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: symmetrical, new_line, same_line +Layout/MultilineMethodCallBraceLayout: + Exclude: + - 'spec/functional/code_generator_spec.rb' + - 'spec/lib/protobuf/generators/field_generator_spec.rb' + - 'spec/lib/protobuf/optionable_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: aligned, indented, indented_relative_to_receiver +Layout/MultilineMethodCallIndentation: + Exclude: + - 'spec/lib/protobuf/generators/file_generator_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Layout/RescueEnsureAlignment: + Exclude: + - 'lib/protobuf/rpc/servers/socket/server.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +Layout/SpaceAfterNot: + Exclude: + - 'lib/protobuf/field/base_field.rb' + - 'lib/protobuf/rpc/connectors/zmq.rb' + - 'lib/protobuf/rpc/servers/socket/worker.rb' + - 'lib/protobuf/tasks/compile.rake' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator. +# SupportedStylesForExponentOperator: space, no_space +Layout/SpaceAroundOperators: + Exclude: + - 'lib/protobuf/field/base_field.rb' + +# Offense count: 6 +Lint/DuplicateMethods: + Exclude: + - 'lib/protobuf/generators/field_generator.rb' + - 'lib/protobuf/rpc/buffer.rb' + - 'lib/protobuf/rpc/stat.rb' + +# Offense count: 1 +Lint/EmptyWhen: + Exclude: + - 'lib/protobuf/rpc/servers/socket/server.rb' + +# Offense count: 1 +Lint/InterpolationCheck: + Exclude: + - 'spec/lib/protobuf/message_spec.rb' + +# Offense count: 1 +# Configuration parameters: MaximumRangeSize. +Lint/MissingCopEnableDirective: + Exclude: + - 'lib/protobuf/message/fields.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +Lint/RedundantCopDisableDirective: + Exclude: + - 'lib/protobuf.rb' + - 'lib/protobuf/message/fields.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +Lint/RedundantRequireStatement: + Exclude: + - 'lib/protobuf/rpc/servers/zmq/broker.rb' + - 'lib/protobuf/rpc/servers/zmq/server.rb' + - 'lib/protobuf/rpc/servers/zmq/worker.rb' + - 'lib/protobuf/rpc/servers/zmq_runner.rb' + - 'lib/protobuf/rpc/service_directory.rb' + +# Offense count: 2 +# Configuration parameters: AllowComments. +Lint/SuppressedException: + Exclude: + - 'lib/protobuf.rb' + +# Offense count: 44 +# Configuration parameters: IgnoredMethods. Metrics/AbcSize: - Max: 59 + Max: 55 + +# Offense count: 116 +# Configuration parameters: CountComments, ExcludedMethods. +# ExcludedMethods: refine +Metrics/BlockLength: + Max: 742 # Offense count: 1 +# Configuration parameters: CountBlocks. Metrics/BlockNesting: Max: 5 -# Offense count: 6 +# Offense count: 19 +# Configuration parameters: IgnoredMethods. Metrics/CyclomaticComplexity: Max: 12 -# Offense count: 493 -# Configuration parameters: AllowURI, URISchemes. -Metrics/LineLength: - Max: 199 - -# Offense count: 44 -# Configuration parameters: CountComments. +# Offense count: 65 +# Configuration parameters: CountComments, ExcludedMethods. Metrics/MethodLength: Max: 38 @@ -33,21 +211,73 @@ Metrics/MethodLength: Metrics/ParameterLists: Max: 7 -# Offense count: 6 +# Offense count: 18 +# Configuration parameters: IgnoredMethods. Metrics/PerceivedComplexity: - Max: 17 + Max: 13 -# Offense count: 1 +# Offense count: 5 +# Configuration parameters: ForbiddenDelimiters. +# ForbiddenDelimiters: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$)) +Naming/HeredocDelimiterNaming: + Exclude: + - 'spec/lib/protobuf/generators/file_generator_spec.rb' + - 'spec/lib/protobuf/generators/service_generator_spec.rb' + +# Offense count: 13 +# Configuration parameters: EnforcedStyleForLeadingUnderscores. +# SupportedStylesForLeadingUnderscores: disallowed, required, optional +Naming/MemoizedInstanceVariableName: + Exclude: + - 'lib/protobuf/field/base_field.rb' + - 'lib/protobuf/logging.rb' + - 'lib/protobuf/rpc/client.rb' + - 'lib/protobuf/rpc/connectors/base.rb' + - 'lib/protobuf/rpc/connectors/socket.rb' + - 'lib/protobuf/rpc/connectors/zmq.rb' + - 'lib/protobuf/rpc/server.rb' + - 'lib/protobuf/rpc/servers/socket/server.rb' + - 'lib/protobuf/rpc/servers/socket/worker.rb' + - 'lib/protobuf/rpc/servers/zmq/server.rb' + - 'lib/protobuf/rpc/stat.rb' + - 'spec/support/server.rb' + +# Offense count: 2 +# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. +# AllowedNames: io, id, to, by, on, in, at, ip, db, os, pp +Naming/MethodParameterName: + Exclude: + - 'lib/protobuf/logging.rb' + - 'spec/lib/protobuf/rpc/service_filters_spec.rb' + +# Offense count: 6 # Cop supports --auto-correct. -Performance/StringReplacement: +# Configuration parameters: PreferredName. +Naming/RescuedExceptionsVariableName: Exclude: - - 'lib/protobuf/rpc/buffer.rb' + - 'lib/protobuf/rpc/connectors/base.rb' + - 'lib/protobuf/rpc/middleware/exception_handler.rb' + - 'lib/protobuf/rpc/middleware/request_decoder.rb' + - 'lib/protobuf/rpc/middleware/response_encoder.rb' + - 'lib/protobuf/rpc/service_filters.rb' -Performance/TimesMap: - Enabled: false +# Offense count: 6 +# Cop supports --auto-correct. +# Configuration parameters: AutoCorrect, EnforcedStyle. +# SupportedStyles: nested, compact +Style/ClassAndModuleChildren: + Exclude: + - '**/*.pb.rb' + - 'spec/lib/protobuf/generators/field_generator_spec.rb' + - 'spec/lib/protobuf/generators/service_generator_spec.rb' + +# Offense count: 2 +Style/CommentedKeyword: + Exclude: + - 'lib/protobuf/rpc/servers/socket_runner.rb' + - 'lib/protobuf/rpc/servers/zmq_runner.rb' -# Offense count: 127 -# Configuration parameters: Exclude. +# Offense count: 203 Style/Documentation: Enabled: false @@ -62,84 +292,250 @@ Style/DoubleNegation: - 'lib/protobuf/rpc/servers/zmq/worker.rb' - 'lib/protobuf/rpc/service_directory.rb' +# Offense count: 9 +# Cop supports --auto-correct. +Style/EmptyCaseCondition: + Exclude: + - 'lib/protobuf/enum.rb' + - 'lib/protobuf/field/base_field.rb' + - 'lib/protobuf/rpc/connectors/zmq.rb' + - 'lib/protobuf/rpc/servers/socket/server.rb' + - 'lib/protobuf/rpc/servers/socket_runner.rb' + - 'lib/protobuf/rpc/servers/zmq_runner.rb' + # Offense count: 2 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty, nil, both Style/EmptyElse: Exclude: - 'lib/protobuf/enum.rb' - 'lib/protobuf/message/fields.rb' -# Offense count: 77 +# Offense count: 1 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -Style/EmptyLinesAroundBlockBody: - Enabled: false +# Configuration parameters: EnforcedStyle. +# SupportedStyles: compact, expanded +Style/EmptyMethod: + Exclude: + - 'lib/protobuf/code_generator.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +Style/Encoding: + Exclude: + - '**/*.pb.rb' + - 'protobuf.gemspec' + - 'spec/lib/protobuf/field/string_field_spec.rb' + - 'spec/lib/protobuf/message_spec.rb' -# Offense count: 90 +# Offense count: 1 +Style/EvalWithLocation: + Exclude: + - 'lib/protobuf/message/fields.rb' + +# Offense count: 2 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -Style/EmptyLinesAroundClassBody: +Style/ExpandPathArguments: + Exclude: + - 'spec/benchmark/tasks.rb' + - 'spec/lib/protobuf/cli_spec.rb' + +# Offense count: 167 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: always, always_true, never +Style/FrozenStringLiteralComment: Enabled: false -# Offense count: 50 +# Offense count: 1 +# Configuration parameters: MinBodyLength. +Style/GuardClause: + Exclude: + - 'lib/protobuf/generators/base.rb' + +# Offense count: 22 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -Style/EmptyLinesAroundModuleBody: +Style/IfUnlessModifier: Enabled: false -# Offense count: 2 -Style/IndentationWidth: +# Offense count: 1 +Style/MethodMissingSuper: Exclude: - - 'protobuf.gemspec' - - 'lib/protobuf/cli.rb' + - 'lib/protobuf/rpc/client.rb' -# Offense count: 3 -Style/ElseAlignment: +# Offense count: 1 +Style/MissingRespondToMissing: Exclude: - - 'protobuf.gemspec' - - 'lib/protobuf/cli.rb' + - 'lib/protobuf/rpc/client.rb' -# Offense count: 8 +# Offense count: 17 # Cop supports --auto-correct. -# Configuration parameters: AllowForAlignment. -Style/ExtraSpacing: +Style/MultilineWhenThen: Exclude: - - 'lib/protobuf/rpc/connectors/common.rb' - - 'lib/protobuf/rpc/connectors/socket.rb' + - 'lib/protobuf/generators/field_generator.rb' + - 'lib/protobuf/generators/printable.rb' - 'lib/protobuf/rpc/connectors/zmq.rb' - - 'lib/protobuf/rpc/servers/socket/server.rb' - - 'spec/lib/protobuf/rpc/service_directory_spec.rb' + - 'lib/protobuf/rpc/servers/socket_runner.rb' + - 'lib/protobuf/rpc/servers/zmq_runner.rb' + +# Offense count: 1 +Style/MultipleComparison: + Exclude: + - 'lib/protobuf/generators/group_generator.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: literals, strict +Style/MutableConstant: + Exclude: + - 'lib/protobuf/generators/field_generator.rb' + - 'lib/protobuf/rpc/buffer.rb' + - 'lib/protobuf/rpc/servers/zmq/util.rb' -# Offense count: 46 +# Offense count: 51 # Cop supports --auto-correct. +# Configuration parameters: Strict. Style/NumericLiterals: MinDigits: 21 +# Offense count: 10 +# Cop supports --auto-correct. +# Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods. +# SupportedStyles: predicate, comparison +Style/NumericPredicate: + Exclude: + - 'spec/**/*' + - 'lib/protobuf/generators/file_generator.rb' + - 'lib/protobuf/generators/message_generator.rb' + - 'lib/protobuf/rpc/buffer.rb' + - 'lib/protobuf/rpc/servers/socket/server.rb' + - 'lib/protobuf/rpc/servers/zmq/broker.rb' + - 'lib/protobuf/rpc/servers/zmq/server.rb' + - 'lib/protobuf/rpc/servers/zmq/worker.rb' + +# Offense count: 15 +# Cop supports --auto-correct. +# Configuration parameters: PreferredDelimiters. +Style/PercentLiteralDelimiters: + Exclude: + - 'lib/protobuf/cli.rb' + - 'spec/lib/protobuf/field/field_array_spec.rb' + - 'spec/lib/protobuf/rpc/service_directory_spec.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +Style/RedundantBegin: + Exclude: + - 'lib/protobuf/message/fields.rb' + - 'lib/protobuf/rpc/servers/zmq/server.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/RedundantCondition: + Exclude: + - 'lib/protobuf/rpc/connectors/base.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/RedundantInterpolation: + Exclude: + - 'lib/protobuf.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +# Configuration parameters: AllowMultipleReturnValues. +Style/RedundantReturn: + Exclude: + - 'lib/protobuf/field/int64_field.rb' + - 'lib/protobuf/rpc/connectors/base.rb' + - 'lib/protobuf/rpc/connectors/zmq.rb' + +# Offense count: 23 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: implicit, explicit +Style/RescueStandardError: + Exclude: + - 'lib/protobuf/cli.rb' + - 'lib/protobuf/field/int64_field.rb' + - 'lib/protobuf/field/varint_field.rb' + - 'lib/protobuf/generators/file_generator.rb' + - 'lib/protobuf/message.rb' + - 'lib/protobuf/rpc/connectors/base.rb' + - 'lib/protobuf/rpc/connectors/ping.rb' + - 'lib/protobuf/rpc/connectors/socket.rb' + - 'lib/protobuf/rpc/middleware/exception_handler.rb' + - 'lib/protobuf/rpc/middleware/request_decoder.rb' + - 'lib/protobuf/rpc/middleware/response_encoder.rb' + - 'lib/protobuf/rpc/servers/zmq/broker.rb' + - 'lib/protobuf/rpc/servers/zmq/server.rb' + - 'lib/protobuf/rpc/servers/zmq/worker.rb' + - 'lib/protobuf/rpc/service_directory.rb' + +# Offense count: 9 +# Cop supports --auto-correct. +# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods. +# AllowedMethods: present?, blank?, presence, try, try! +Style/SafeNavigation: + Exclude: + - 'lib/protobuf/generators/field_generator.rb' + - 'lib/protobuf/generators/service_generator.rb' + - 'lib/protobuf/message/serialization.rb' + - 'lib/protobuf/rpc/connectors/base.rb' + - 'lib/protobuf/rpc/connectors/ping.rb' + - 'lib/protobuf/rpc/servers/zmq/server.rb' + +# Offense count: 71 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: only_raise, only_fail, semantic Style/SignalException: Enabled: false -# Offense count: 473 +# Offense count: 6 +# Cop supports --auto-correct. +Style/StderrPuts: + Exclude: + - 'lib/protobuf/cli.rb' + - 'lib/protobuf/code_generator.rb' + - 'lib/protobuf/rpc/servers/zmq/server.rb' + +# Offense count: 627 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. +# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. +# SupportedStyles: single_quotes, double_quotes Style/StringLiterals: Enabled: false -# Offense count: 7 +# Offense count: 26 # Cop supports --auto-correct. -# Configuration parameters: IgnoredMethods. -Style/SymbolProc: +# Configuration parameters: MinSize. +# SupportedStyles: percent, brackets +Style/SymbolArray: + EnforcedStyle: brackets + +# Offense count: 4 +# Cop supports --auto-correct. +Style/UnpackFirst: Exclude: - - 'lib/protobuf/generators/printable.rb' - - 'lib/protobuf/rpc/servers/socket/server.rb' - - 'spec/encoding/all_types_spec.rb' - - 'spec/encoding/extreme_values_spec.rb' - - 'spec/functional/socket_server_spec.rb' - - 'spec/functional/zmq_server_spec.rb' - - 'spec/lib/protobuf/rpc/servers/socket_server_spec.rb' + - 'lib/protobuf/field/double_field.rb' + - 'lib/protobuf/field/fixed32_field.rb' + - 'lib/protobuf/field/float_field.rb' + - 'lib/protobuf/field/sfixed32_field.rb' # Offense count: 4 # Cop supports --auto-correct. # Configuration parameters: WordRegex. +# SupportedStyles: percent, brackets Style/WordArray: - MinSize: 4 + EnforcedStyle: percent + MinSize: 3 + +# Offense count: 728 +# Cop supports --auto-correct. +# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# URISchemes: http, https +Layout/LineLength: + Max: 196 diff --git a/lib/protobuf/rpc/buffer.rb b/lib/protobuf/rpc/buffer.rb index 53f163f2..afadec42 100644 --- a/lib/protobuf/rpc/buffer.rb +++ b/lib/protobuf/rpc/buffer.rb @@ -44,7 +44,7 @@ def <<(data) end end - def set_data(data) # rubocop:disable Style/AccessorMethodName + def set_data(data) # rubocop:disable Naming/AccessorMethodName @data = data.to_s @size = @data.size end @@ -61,7 +61,7 @@ def flushed? @flush end - def get_data_size # rubocop:disable Style/AccessorMethodName + def get_data_size # rubocop:disable Naming/AccessorMethodName if @size == 0 || @data.match(SIZE_REGEX) sliced_size = @data.slice!(SIZE_REGEX) @size = sliced_size.delete('-').to_i unless sliced_size.nil? From 32f60567fefe1209e234cd29392eb0a769f98943 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Fri, 12 Jan 2024 12:24:14 -0700 Subject: [PATCH 92/93] Clean up a few remaining rules for specs and rubocop to pass --- .rubocop.yml | 4 ++++ Gemfile | 6 +++--- protobuf.gemspec | 1 - spec/lib/protobuf/field/string_field_spec.rb | 2 -- spec/lib/protobuf/message_spec.rb | 2 -- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index c4fa04ce..ea05f74d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,6 +6,9 @@ AllCops: - 'spec/support/protos/*.pb.rb' - 'varint_prof.rb' +Bundler/DuplicatedGem: + Enabled: false + Layout/EndAlignment: EnforcedStyleAlignWith: keyword @@ -24,6 +27,7 @@ Layout/CaseIndentation: Style/ClassAndModuleChildren: Exclude: - '**/*.pb.rb' + - 'spec/**/*.rb' Naming/ClassAndModuleCamelCase: Exclude: diff --git a/Gemfile b/Gemfile index a19bf744..ea1fdd91 100644 --- a/Gemfile +++ b/Gemfile @@ -8,17 +8,17 @@ group :development do if RUBY_VERSION < '2.0.0' gem 'pry-debugger' elsif RUBY_VERSION < '2.4.0' - gem 'pry-byebug' gem 'pry', '~> 0.12.0' + gem 'pry-byebug' else - gem 'pry-byebug', '~> 3.9.0' gem 'pry', '~> 0.13.0' + gem 'pry-byebug', '~> 3.9.0' end gem 'pry-stack_explorer' - gem 'varint' gem 'ruby-prof' + gem 'varint' elsif RUBY_PLATFORM =~ /java/i gem 'fast_blank_java' gem 'pry' diff --git a/protobuf.gemspec b/protobuf.gemspec index 055be259..698c434b 100644 --- a/protobuf.gemspec +++ b/protobuf.gemspec @@ -1,4 +1,3 @@ -# encoding: UTF-8 $LOAD_PATH.push ::File.expand_path("../lib", __FILE__) require "protobuf/version" diff --git a/spec/lib/protobuf/field/string_field_spec.rb b/spec/lib/protobuf/field/string_field_spec.rb index f666907a..4fe358a3 100644 --- a/spec/lib/protobuf/field/string_field_spec.rb +++ b/spec/lib/protobuf/field/string_field_spec.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - require 'spec_helper' RSpec.describe ::Protobuf::Field::StringField do diff --git a/spec/lib/protobuf/message_spec.rb b/spec/lib/protobuf/message_spec.rb index 96668b67..50513f14 100644 --- a/spec/lib/protobuf/message_spec.rb +++ b/spec/lib/protobuf/message_spec.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - require 'stringio' require 'spec_helper' require PROTOS_PATH.join('resource.pb') From b700faf13ff113abecea2fbc39f0dc7805fb4cd1 Mon Sep 17 00:00:00 2001 From: Garrett Thornburg Date: Fri, 12 Jan 2024 12:40:35 -0700 Subject: [PATCH 93/93] Bump version to 3.10.9 --- lib/protobuf/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protobuf/version.rb b/lib/protobuf/version.rb index f570feaa..0d7d5f38 100644 --- a/lib/protobuf/version.rb +++ b/lib/protobuf/version.rb @@ -1,3 +1,3 @@ module Protobuf - VERSION = '3.10.8' # rubocop:disable Style/MutableConstant + VERSION = '3.10.9' # rubocop:disable Style/MutableConstant end
%Total
100% 0%63.34123.51 0.0063.34123.51 0 (top)
60.08120.19 0.0060.08120.19 1/1 Benchmark::IPS.ips
0.951.03 0.000.952/1121.022/115 Kernel.require
0.900.91 0.040.860.87 1/5##times##times
0.890.87 0.000.896/18650.876/1883 Kernel.require
0.520.50 0.060.460.44 17/19 Kernel.load
0.900.91 0.040.860.87 1/5 (top)
60.08120.19 0.0060.08120.19 2/5 Benchmark::IPS::Job#run
96%98% 0%61.00121.12 0.0560.95121.07 5##times##times
40.0880.18 0.0040.0880.18 1/1 Benchmark::IPS::Job#run_benchmark
20.0040.00 0.0020.0040.00 1/1 Benchmark::IPS::Job#run_warmup
0.420.45 0.010.4210000/7614590.4410000/2123384 Protobuf::Message::Serialization::ClassMethods.decode_from
0.270.28 0.010.2610000/7614590.2710000/4103921 Protobuf::Encoder.encode
0.110.000.1010000/1524359Class#new
0.12 0.00 0.121/762970##flat_map
0.140.000.141/7629701/4105546 Gem::Specification.each_gemspec
0.230.000.2319/7629700.250.010.2419/4105546 Kernel.require
20.001.6918.321/76297040.003.5136.491/4105546 Benchmark::IPS::Job#run_warmup
40.080.0040.071/76297080.180.0280.171/4105546 Benchmark::IPS::Job#run_benchmark
96%97% 2%60.891.7259.17762970##each120.963.56117.404105546##each
57.312.6854.623368410/3368410114.335.40108.926794724/6794724 Benchmark::IPS::Job::Entry#call_times
0.740.310.443368939/33689391.670.810.866795778/6795778 Benchmark::Timing.now
0.180.180.003368414/3368414##<
0.140.140.003368424/23728693##+
0.120.340.34 0.000.122/3Gem::Specification.gemspec_stubs_in6794732/6794732##<
0.110.300.30 0.000.1013/14Gem::Specification.load6794740/46949692##+
60.08120.19 0.0060.08120.19 1/1 (top)
94%97% 0%60.08120.19 0.0060.08120.19 1 Benchmark::IPS.ips
60.08120.19 0.0060.08120.19 1/1 Benchmark::IPS::Job#run
60.08120.19 0.0060.08120.19 1/1 Benchmark::IPS.ips
94%97% 0%60.08120.19 0.0060.08120.19 1 Benchmark::IPS::Job#run
60.08120.19 0.0060.08120.19 2/5##times##times
57.312.6854.623368410/3368410##each114.335.40108.926794724/6794724##each
90%92% 4%57.312.6854.623368410114.335.40108.926794724 Benchmark::IPS::Job::Entry#call_times
53.422.1651.2613506055/13506589106.564.94101.6225271252/25271834 Proc#call
0.650.651.281.28 0.0016874465/19924325##<32065976/32065992##<
0.560.561.081.08 0.0013506055/23728693##+25271252/46949692##+
53.422.1651.2613506055/13506589106.564.94101.6225271252/25271834 Benchmark::IPS::Job::Entry#call_times
84%3%53.452.1751.281350658986%4%106.604.95101.6425271834 Proc#call
22.462.3520.1112754596/12754596Protobuf::Message#to_hash
15.050.2014.85751459/76145927.520.4627.062113384/2123384 Protobuf::Message::Serialization::ClassMethods.decode_from
8.850.278.58751459/76145925.390.8124.584093920/4103921 Protobuf::Encoder.encode
3.220.123.09751459/1524359Class#new23.631.9021.739393746/9393746Protobuf::Message#to_hash_with_string_keys
1.360.211.15751459/761459Test::Resource#status=23.521.9321.609670202/9670202Protobuf::Message#to_hash
0.200.110.09751459/7614591.060.700.376207304/6217305 StringIO.new
0.320.320.004093920/4103921Protobuf::Message#to_proto
0.180.180.002113384/4247921Kernel.dup
40.0880.18 0.0040.0880.18 1/1##times##times
63%64% 0%40.0880.18 0.0040.0880.18 1 Benchmark::IPS::Job#run_benchmark
40.080.0040.071/762970##each
8.371.057.32761459/13516056Protobuf::Message#each_field_for_serialization80.180.0280.171/4105546##each
20.115.3814.7312754596/1351605621.604.5317.069670202/23167870 Protobuf::Message#to_hash
44%10%28.486.4322.0413516056##each_key
5.572.243.3312754596/12754596Protobuf::Field::StringField(singleton)#to_message_hash21.734.3317.399393746/23167870Protobuf::Message#to_hash_with_string_keys
5.182.133.0412754596/12754596Protobuf::Field::Int64Field(singleton)#to_message_hash22.783.5319.244103921/23167870Protobuf::Message#each_field_for_serialization
2.590.212.38761459/761459Protobuf::Field::Int64Field(singleton)#encode_to_stream
53%10%66.1012.4053.7023167870##each_key
2.422.420.0027793569/32362325Protobuf::Message#_protobuf_message_field15.223.2511.9618787492/18787492Protobuf::Field::BaseField#to_message_hash_with_string_key
2.012.010.0027793569/63970204##[]14.753.3011.4519340404/19340404Protobuf::Field::BaseField#to_message_hash
1.890.511.38761459/761459Protobuf::Field::StringField(singleton)#encode_to_stream14.731.6313.118217842/8217842Protobuf::Field::BaseField#encode_to_stream
3.341.69 1.660.211.46761459/761459Protobuf::Field::EnumField(singleton)#encode_to_stream
0.260.070.19761459/14277514Protobuf::Field::StringField(singleton)#value_from_values
0.250.070.18761459/14277514Protobuf::Field::Int64Field(singleton)#value_from_values
0.230.070.16761459/1522918Protobuf::Field::EnumField(singleton)#value_from_values8217842/8217842Protobuf::Field::BaseField#value_from_values_for_serialization
22.462.3520.1112754596/12754596Proc#call
35%3%22.462.3520.1112754596Protobuf::Message#to_hash3.203.200.0046345738/97013401##[]
20.115.3814.7312754596/13516056##each_key2.462.460.0046345738/50632510Test::Resource#_protobuf_message_field
20.0040.00 0.0020.0040.00 1/1##times##times
31%32% 0%20.0040.00 0.0020.0040.00 1 Benchmark::IPS::Job#run_warmup
20.001.6918.321/762970##each40.003.5136.491/4105546##each
0.420.45 0.010.4210000/761459##times0.4410000/2123384##times
15.050.2014.85751459/76145927.520.4627.062113384/2123384 Proc#call
24%22% 0%15.470.2115.2776145927.960.4627.502123384 Protobuf::Message::Serialization::ClassMethods.decode_from
14.760.2214.54761459/76145926.260.4325.832123384/2123384 Protobuf::Message::Serialization.decode_from
0.510.110.40761459/15243591.240.310.942123384/2136384 Class#new
14.760.2214.54761459/76145926.260.4325.832123384/2123384 Protobuf::Message::Serialization::ClassMethods.decode_from
23%21% 0%14.760.2214.5476145926.260.4325.832123384 Protobuf::Message::Serialization.decode_from
14.541.3113.23761459/76145925.832.3923.442123384/2123384 Protobuf::Decoder.decode_each_field
14.541.3113.23761459/76145925.832.3923.442123384/2123384 Protobuf::Message::Serialization.decode_from
22%2%14.541.3113.2376145920%1%25.832.3923.442123384 Protobuf::Decoder.decode_each_field
7.130.816.312284377/2284377Protobuf::Message::Serialization.set_field_bytes11.705.835.888513536/8513536ProtobufJavaHelpers::EncodeDecode.decode
5.562.882.694568754/4568754Protobuf::VarintPure.decode10.641.419.234256768/4256768Protobuf::Message::Serialization.set_field_bytes
0.150.150.310.31 0.003045836/30458366380152/6380152 StringIO#eof
0.130.130.250.25 0.003045836/3048922##==6380152/6383519##==
0.100.100.230.23 0.00761459/7614592123384/2123384 StringIO#read
0.180.180.004256768/4256768##>>
0.120.120.004256768/40271449##&
0.270.28 0.010.2610000/761459##times0.2710000/4103921##times
8.850.278.58751459/76145925.390.8124.584093920/4103921 Proc#call
14%20% 0%9.120.288.8476145925.670.8224.854103921 Protobuf::Encoder.encode
8.840.328.52761459/76145924.851.3223.524103921/4103921 Protobuf::Message#each_field_for_serialization
8.840.328.52761459/76145924.851.3223.524103921/4103921 Protobuf::Encoder.encode
13%0%8.840.328.5276145920%1%24.851.3223.524103921 Protobuf::Message#each_field_for_serialization
8.371.057.32761459/13516056##each_key22.783.5319.244103921/23167870##each_key
0.110.110.560.56 0.00761459/2284378Protobuf::Message#_protobuf_message_required_field_tags4103921/6237307Test::Resource#_protobuf_message_unset_required_field_tags
7.130.816.312284377/2284377Protobuf::Decoder.decode_each_field23.631.9021.739393746/9393746Proc#call
11%19% 1%7.130.816.312284377Protobuf::Message::Serialization.set_field_bytes23.631.9021.739393746Protobuf::Message#to_hash_with_string_keys
2.460.192.27761459/761459Protobuf::Field::EnumField(singleton)#set21.734.3317.399393746/23167870##each_key
1.710.211.49761459/761459Protobuf::Field::Int64Field(singleton)#set23.521.9321.609670202/9670202Proc#call
19%1%23.521.9321.609670202Protobuf::Message#to_hash
1.400.191.21761459/761459Protobuf::Field::StringField(singleton)#set21.604.5317.069670202/23167870##each_key
0.530.400.132284377/32362325Protobuf::Message#_protobuf_message_field15.223.2511.9618787492/18787492##each_key
12%2%15.223.2511.9618787492Protobuf::Field::BaseField#to_message_hash_with_string_key
0.210.210.002284377/63970204##[]11.963.658.3118787492/18787492Protobuf::Field::BaseFieldObjectDefinitions::BaseToMessageHashWithStringKey#call
0.940.120.82761459/4568756Protobuf::Field::EnumField(singleton)#set14.753.3011.4519340404/19340404##each_key
11%2%14.753.3011.4519340404Protobuf::Field::BaseField#to_message_hash
1.000.160.84761459/4568756Protobuf::Field::StringField(singleton)#set
1.070.120.95761459/4568756Protobuf::Field::Int64Field(singleton)#set
1.180.190.98761459/4568756Test::Resource#status=11.453.647.8219340404/19340404Protobuf::Field::BaseFieldObjectDefinitions::BaseToMessageHash#call
2.550.412.151522920/4568756##each14.731.6313.118217842/8217842##each_key
10%11% 1%6.741.005.744568756Protobuf::Message#set_field14.731.6313.118217842Protobuf::Field::BaseField#encode_to_stream
1.800.391.421522919/1522919Protobuf::Field::Int64Field(singleton)#set_field7.092.095.004103921/4103921Protobuf::Field::BaseFieldObjectDefinitions::StringEncodeToStream#call
1.660.351.311522918/1522918Protobuf::Field::EnumField(singleton)#set_field6.021.034.994113921/4113921Protobuf::Field::BaseFieldObjectDefinitions::BaseEncodeToStream#call
1.600.601.001522919/1522919Protobuf::Field::StringField(singleton)#set_field6.273.133.1418787492/38127896Protobuf::Field::BaseFieldObjectDefinitions::BaseToMessageHashWithStringKey#call
0.470.340.132284379/32362325Protobuf::Message#_protobuf_message_field6.453.193.2619340404/38127896Protobuf::Field::BaseFieldObjectDefinitions::BaseToMessageHash#call
10%5%12.726.326.4038127896Protobuf::Field::BaseField#value_from_values
0.200.200.002284379/63970204##[]6.404.142.2638127896/38127896Protobuf::Field::BaseFieldObjectDefinitions::BaseFieldValueFromValues#call
5.572.243.3312754596/12754596##each_key11.963.658.3118787492/18787492Protobuf::Field::BaseField#to_message_hash_with_string_key
8%3%5.572.243.3312754596Protobuf::Field::StringField(singleton)#to_message_hash9%2%11.963.658.3118787492Protobuf::Field::BaseFieldObjectDefinitions::BaseToMessageHashWithStringKey#call
2.371.530.8412754596/14277514Protobuf::Field::StringField(singleton)#value_from_values6.273.133.1418787492/38127896Protobuf::Field::BaseField#value_from_values
0.960.962.042.04 0.0012754596/30084503##[]=18787492/42419312##[]=
5.562.882.694568754/456875411.705.835.888513536/8513536 Protobuf::Decoder.decode_each_field
8%9% 4%5.562.882.694568754Protobuf::VarintPure.decode11.705.835.888513536ProtobufJavaHelpers::EncodeDecode.decode
0.892.041.38 0.660.226853131/685313114883688/14883688 IO::GenericReadable.readbyte
0.470.471.001.00 0.0013706262/21322798##&29767376/40271449##&
0.280.280.590.59 0.006853131/6853284##<<14883688/17017539Numeric#nonzero?
0.270.270.580.58 0.006853131/8376374Numeric#nonzero?14883688/14883841##<<
0.270.270.560.56 0.006853131/23728693##+14883688/46949692##+
0.260.260.560.56 0.006853131/9139607##|14883688/14883841##|
0.260.260.540.54 0.006853131/6853756##*14883688/14884832##*
5.182.133.0412754596/12754596##each_key11.453.647.8219340404/19340404Protobuf::Field::BaseField#to_message_hash
8%3%5.182.133.0412754596Protobuf::Field::Int64Field(singleton)#to_message_hash9%2%11.453.647.8219340404Protobuf::Field::BaseFieldObjectDefinitions::BaseToMessageHash#call
2.141.480.6612754596/14277514Protobuf::Field::Int64Field(singleton)#value_from_values6.453.193.2619340404/38127896Protobuf::Field::BaseField#value_from_values
0.900.901.371.37 0.0012754596/30084503##[]=19340404/42419312##[]=
0.110.000.1010000/1524359##times10.641.419.234256768/4256768Protobuf::Decoder.decode_each_field
8%1%10.641.419.234256768Protobuf::Message::Serialization.set_field_bytes
0.110.020.0915/1524359Kernel.eval8.480.877.604256768/4256768Protobuf::Field::BaseField#set
0.150.010.14153/1524359Protobuf::Field.build0.420.420.004256768/97013401##[]
0.240.010.231/1524359Bundler::Dsl#to_definition0.330.330.004256768/50632510Test::Resource#_protobuf_message_field
0.510.110.40761459/1524359Protobuf::Message::Serialization::ClassMethods.decode_from8.480.877.604256768/4256768Protobuf::Message::Serialization.set_field_bytes
6%0%8.480.877.604256768Protobuf::Field::BaseField#set
7.601.026.584256768/4256768Protobuf::Field::BaseFieldObjectDefinitions::BaseSetMethod#call
3.220.123.09751459/1524359Proc#call7.601.026.584256768/4256768Protobuf::Field::BaseField#set
7%6% 0%4.590.354.251524359Class#new7.601.026.584256768Protobuf::Field::BaseFieldObjectDefinitions::BaseSetMethod#call
3.600.593.001522919/1522919Protobuf::Message#initialize5.010.624.394256768/4286772Protobuf::Message#set_field
0.230.000.231/1Bundler::Definition#initialize1.080.780.302123384/2123384Protobuf::Field::IntegerField#decode
0.140.010.14153/153Protobuf::Field::BaseField#initialize0.460.300.162123384/2123384Protobuf::Field::StringField#decode
0.140.147.092.095.004103921/4103921Protobuf::Field::BaseField#encode_to_stream
5%1%7.092.095.004103921Protobuf::Field::BaseFieldObjectDefinitions::StringEncodeToStream#call
2.361.201.1612311763/20539605IO::GenericWritable.<<
1.410.530.884103921/8217995Protobuf::Field::VarintField.encode
0.580.400.184103921/4104743BasicObject#!=
0.280.28 0.002284377/63970204Protobuf::Enum.enum_for_tag_integer4103921/4104065##+
0.210.210.004103921/4103921##encoding
0.17 0.17 0.001525107/63970204Protobuf::Field::VarintField.cached_varint4103921/4103921##bytesize
0.200.206.404.142.2638127896/38127896Protobuf::Field::BaseField#value_from_values
5%3%6.404.142.2638127896Protobuf::Field::BaseFieldObjectDefinitions::BaseFieldValueFromValues#call
2.262.26 0.002284379/63970204Protobuf::Message#set_field38127896/97013401##[]
0.210.210.420.42 0.002284377/639702044256768/97013401 Protobuf::Message::Serialization.set_field_bytes
0.710.710.480.48 0.0013516055/63970204Protobuf::Field::Int64Field(singleton)#value_from_values8217842/97013401Protobuf::Field::BaseFieldObjectDefinitions::BaseFieldValueFromValuesForSerialization#call
0.900.902.262.26 0.0013516055/63970204Protobuf::Field::StringField(singleton)#value_from_values38127896/97013401Protobuf::Field::BaseFieldObjectDefinitions::BaseFieldValueFromValues#call
2.012.013.203.20 0.0027793569/63970204##each_key46345738/97013401##each_key
6%6%4.424.395%5%6.396.36 0.0363970204##[]97013401##[]
3.600.593.001522919/1522919Class#new6.021.034.994113921/4113921Protobuf::Field::BaseField#encode_to_stream
5%4% 0%3.600.593.001522919Protobuf::Message#initialize
2.870.322.551522919/1523130##each6.021.034.994113921Protobuf::Field::BaseFieldObjectDefinitions::BaseEncodeToStream#call
0.470.340.132284379/32362325Protobuf::Message#set_field3.351.481.864103921/4103921Protobuf::Field::IntegerField#encode
0.530.400.132284377/32362325Protobuf::Message::Serialization.set_field_bytes1.610.800.818227842/20539605IO::GenericWritable.<<
2.422.420.0027793569/32362325##each_key5.010.624.394256768/4286772Protobuf::Field::BaseFieldObjectDefinitions::BaseSetMethod#call
5% 4%3.433.160.2632362325Protobuf::Message#_protobuf_message_field0%5.100.634.474286772Protobuf::Message#set_field
0.200.200.001522919/1523730Protobuf::Message::Fields::ClassMethods.field_store4.460.903.564286772/4286772Protobuf::Field::BaseField#set_field
2.870.322.551522919/1523130Protobuf::Message#initialize4.460.903.564286772/4286772Protobuf::Message#set_field
4%3% 0%2.890.332.561523130##each4.460.903.564286772Protobuf::Field::BaseField#set_field
2.550.412.151522920/4568756Protobuf::Message#set_field1.780.571.212153386/2153386Protobuf::Field::BaseFieldObjectDefinitions::BaseSetField#call
0.540.160.38761459/2286579Protobuf::Field::EnumField#encode1.780.691.092133386/2133386Protobuf::Field::BaseFieldObjectDefinitions::RequiredStringSetField#call
0.580.170.41761459/2286579Protobuf::Field::StringField(singleton)#encode_to_stream1.610.800.818227842/20539605Protobuf::Field::BaseFieldObjectDefinitions::BaseEncodeToStream#call
1.630.840.79761459/2286579Protobuf::Field::IntegerField#encode2.361.201.1612311763/20539605Protobuf::Field::BaseFieldObjectDefinitions::StringEncodeToStream#call
4%3% 1%2.771.181.592286579Protobuf::Field::VarintField.encode
0.660.390.271523058/1525107Protobuf::Field::VarintField.cached_varint3.972.001.9720539605IO::GenericWritable.<<
0.210.211.971.97 0.003049844/3051803##<<20539605/20539605StringIO#write
0.120.120.180.18 0.00763521/763523##pack2153386/42419312Protobuf::Field::BaseFieldObjectDefinitions::BaseSetField#call
0.120.120.200.20 0.003049844/19924325##<2133386/42419312Protobuf::Field::BaseFieldObjectDefinitions::RequiredStringSetField#call
0.110.111.371.37 0.002284530/3809398##<=19340404/42419312Protobuf::Field::BaseFieldObjectDefinitions::BaseToMessageHash#call
0.110.112.042.04 0.002286323/4570700##>>18787492/42419312Protobuf::Field::BaseFieldObjectDefinitions::BaseToMessageHashWithStringKey#call
0.260.070.19761459/14277514##each_key
3%3%3.803.790.0142419312##[]=
2.371.530.8412754596/14277514Protobuf::Field::StringField(singleton)#to_message_hash3.351.481.864103921/4103921Protobuf::Field::BaseFieldObjectDefinitions::BaseEncodeToStream#call
4% 2%2.621.591.0314277514Protobuf::Field::StringField(singleton)#value_from_values1%3.351.481.864103921Protobuf::Field::IntegerField#encode
0.900.901.450.500.954103921/8217995Protobuf::Field::VarintField.encode
0.410.41 0.0013516055/63970204##[]4103921/40271449##&
2.590.212.38761459/761459##each_key3.341.691.668217842/8217842##each_key
4%0%2.590.212.38761459Protobuf::Field::Int64Field(singleton)#encode_to_stream2%1%3.341.691.668217842Protobuf::Field::BaseField#value_from_values_for_serialization
2.060.341.73761459/761459Protobuf::Field::IntegerField#encode1.661.180.488217842/8217842Protobuf::Field::BaseFieldObjectDefinitions::BaseFieldValueFromValuesForSerialization#call
0.320.150.171522918/5330213IO::GenericWritable.<<1.410.530.884103921/8217995Protobuf::Field::BaseFieldObjectDefinitions::StringEncodeToStream#call
2.460.192.27761459/761459Protobuf::Message::Serialization.set_field_bytes1.450.500.954103921/8217995Protobuf::Field::IntegerField#encode
3%2% 0%2.460.192.27761459Protobuf::Field::EnumField(singleton)#set
1.330.331.00761459/761459Protobuf::Field::EnumField#decode2.871.031.848217995Protobuf::Field::VarintField.encode
0.940.120.82761459/4568756Protobuf::Message#set_field1.840.930.918217995/8217995ProtobufJavaHelpers::EncodeDecode.encode
0.250.070.18761459/14277514##each_key0.330.330.004256768/50632510Protobuf::Message::Serialization.set_field_bytes
2.141.480.6612754596/14277514Protobuf::Field::Int64Field(singleton)#to_message_hash2.462.460.0046345738/50632510##each_key
3% 2%2.381.550.8414277514Protobuf::Field::Int64Field(singleton)#value_from_values
0.710.712%2.792.79 0.0013516055/63970204##[]50632510Test::Resource#_protobuf_message_field
0.420.41 0.030.392/18650.382/1883 Kernel.load
0.890.87 0.000.896/18650.876/1883 (top)
0.951.02 0.000.95112/18651.02115/1883 Kernel.require
3%1% 0%2.262.30 0.032.2318652.271883 Kernel.require
0.810.86 0.000.810.86 1/1 Bundler.setup
0.230.000.2319/762970##each0.250.010.2419/4105546##each
0.140.12 0.000.140.12 1/1 Gem::Specification.load_defaults
0.110.000.11109/109Protobuf::Message::Fields::ClassMethods.optional0.280.010.271/2136384Bundler::Dsl#to_definition
0.120.121.240.310.942123384/2136384Protobuf::Message::Serialization::ClassMethods.decode_from
1%0%2.060.501.562136384Class#new
1.020.690.342133386/2133386Protobuf::Message#initialize
0.27 0.001522919/30084503Protobuf::Field::Int64Field(singleton)#set_field0.271/1Bundler::Definition#initialize
0.120.122.041.380.6614883688/14883688ProtobufJavaHelpers::EncodeDecode.decode
1%1%2.041.380.6614883688IO::GenericReadable.readbyte
0.660.66 0.001522918/30084503Protobuf::Field::EnumField(singleton)#set_field14883688/14883688StringIO#getbyte
0.130.131.971.970.0020539605/20539605IO::GenericWritable.<<
1%1%1.971.97 0.001522919/30084503Protobuf::Field::StringField(singleton)#set_field20539605StringIO#write
0.900.900.300.30 0.0012754596/30084503Protobuf::Field::Int64Field(singleton)#to_message_hash6794740/46949692##each
0.960.960.560.56 0.0012754596/30084503Protobuf::Field::StringField(singleton)#to_message_hash14883688/46949692ProtobufJavaHelpers::EncodeDecode.decode
3%3%2.242.240.0130084503##[]=
2.060.341.73761459/761459Protobuf::Field::Int64Field(singleton)#encode_to_stream1.081.080.0025271252/46949692Benchmark::IPS::Job::Entry#call_times
3%0%2.060.341.73761459Protobuf::Field::IntegerField#encode1%1%1.941.940.0046949692##+
1.630.840.79761459/22865791.840.930.918217995/8217995 Protobuf::Field::VarintField.encode
1%0%1.840.930.918217995ProtobufJavaHelpers::EncodeDecode.encode
0.100.100.910.91 0.00761459/21322798##&8217995/8217995ProtobufJavaHelpers::Varinter.to_varint
1.890.511.38761459/761459##each_key1.780.571.212153386/2153386Protobuf::Field::BaseField#set_field
2%1% 0%1.890.511.38761459Protobuf::Field::StringField(singleton)#encode_to_stream1.780.571.212153386Protobuf::Field::BaseFieldObjectDefinitions::BaseSetField#call
0.580.170.41761459/2286579Protobuf::Field::VarintField.encode0.920.630.292133386/2133386Protobuf::Field::VarintField#coerce!
0.470.230.242284377/5330213IO::GenericWritable.<<
0.140.100.04761459/762229BasicObject#!=0.180.180.002153386/42419312##[]=
1.800.391.421522919/1522919Protobuf::Message#set_field1.780.691.092133386/2133386Protobuf::Field::BaseField#set_field
2%1% 0%1.800.391.421522919Protobuf::Field::Int64Field(singleton)#set_field1.780.691.092133386Protobuf::Field::BaseFieldObjectDefinitions::RequiredStringSetField#call
1.240.440.801522919/1522919Protobuf::Field::VarintField#coerce!0.610.430.182133386/6237307Test::Resource#_protobuf_message_unset_required_field_tags
0.120.120.200.20 0.001522919/30084503##[]=2133386/42419312##[]=
1.710.211.49761459/761459Protobuf::Message::Serialization.set_field_bytes
2%0%1.710.211.49761459Protobuf::Field::Int64Field(singleton)#set0.160.160.002133386/2133570##delete
1.07 0.120.95761459/4568756Protobuf::Message#set_field0.120.002133386/4298337Kernel.kind_of?
0.430.320.11761459/761459Protobuf::Field::IntegerField#decode0.120.120.004256768/40271449Protobuf::Decoder.decode_each_field
1.66 0.211.46761459/761459##each_key
2%0%1.66 0.211.46761459Protobuf::Field::EnumField(singleton)#encode_to_stream0.002123384/40271449Protobuf::Field::IntegerField#decode
1.180.340.84761459/761459Protobuf::Field::EnumField#encode0.410.410.004103921/40271449Protobuf::Field::IntegerField#encode
0.280.150.131522918/5330213IO::GenericWritable.<<1.001.000.0029767376/40271449ProtobufJavaHelpers::EncodeDecode.decode
1%1%1.761.760.0040271449##&
1.660.351.311522918/1522918Protobuf::Message#set_field1.670.810.866795778/6795778##each
2%1% 0%1.660.351.311522918Protobuf::Field::EnumField(singleton)#set_field
1.130.271.670.81 0.861522918/1522918Protobuf::Field::EnumField#coerce!6795778Benchmark::Timing.now
0.120.120.860.86 0.001522918/30084503##[]=6795778/6795779Process.clock_gettime
1.600.601.001522919/1522919Protobuf::Message#set_field1.661.180.488217842/8217842Protobuf::Field::BaseField#value_from_values_for_serialization
2%1% 0%1.600.601.001522919Protobuf::Field::StringField(singleton)#set_field
0.660.410.251522919/2284378Protobuf::Message#_protobuf_message_required_field_tags1.661.180.488217842Protobuf::Field::BaseFieldObjectDefinitions::BaseFieldValueFromValuesForSerialization#call
0.130.130.480.48 0.001522919/30084503##[]=8217842/97013401##[]
1.400.191.21761459/761459Protobuf::Message::Serialization.set_field_bytes1.281.280.0032065976/32065992Benchmark::IPS::Job::Entry#call_times
2%0%1.400.191.21761459Protobuf::Field::StringField(singleton)#set
1.000.160.84761459/4568756Protobuf::Message#set_field1%1%1.281.280.0032065992##<
0.210.140.07761459/761459Protobuf::Field::StringField#decode0.560.560.004103921/6237307Protobuf::Message#each_field_for_serialization
1.360.211.15751459/761459Proc#call0.610.430.182133386/6237307Protobuf::Field::BaseFieldObjectDefinitions::RequiredStringSetField#call
2% 0%1.400.220% 1.18761459Test::Resource#status=1.000.186237307Test::Resource#_protobuf_message_unset_required_field_tags
1.180.190.98761459/4568756Protobuf::Message#set_field0.180.180.002133386/4247921Kernel.dup
1.330.331.00761459/761459Protobuf::Field::EnumField(singleton)#set1.080.780.302123384/2123384Protobuf::Field::BaseFieldObjectDefinitions::BaseSetMethod#call
2% 0%1.330.331.00761459Protobuf::Field::EnumField#decode0%1.080.780.302123384Protobuf::Field::IntegerField#decode
0.880.280.60761459/761459Protobuf::Field::EnumField#acceptable?0.210.210.002123384/40271449##&
1.240.440.801522919/1522919Protobuf::Field::Int64Field(singleton)#set_field1.060.700.376207304/6217305Proc#call
1% 0%1.240.440.801522919Protobuf::Field::VarintField#coerce!
0.650.420.221522919/1522919Protobuf::Field::Int64Field#acceptable?0%1.070.700.376217305StringIO.new
0.450.160.28761459/2284386Protobuf::Field::EnumField#acceptable?0.370.370.006217305/6217305StringIO#initialize
0.760.270.501522918/2284386Protobuf::Field::EnumField#coerce!1.030.001.022/115(top)
1% 0%1.210.430.782284386Protobuf::Enum.fetch
0.670.410.262284377/2284377Protobuf::Enum.enum_for_tag_integer0%1.030.001.02115Kernel.require
0.110.111.02 0.002284386/5331568Kernel.kind_of?1.02115/1883Kernel.require
1.181.020.69 0.340.84761459/761459Protobuf::Field::EnumField(singleton)#encode_to_stream2133386/2133386Class#new
1% 0%1.180%1.020.69 0.340.84761459Protobuf::Field::EnumField#encode2133386Protobuf::Message#initialize
0.54 0.160.38761459/2286579Protobuf::Field::VarintField.encode0.100.062133386/2133600##each
0.180.110.07761459/761727Protobuf::Enum#to_i0.920.630.292133386/2133386Protobuf::Field::BaseFieldObjectDefinitions::BaseSetField#call
0%0%0.920.630.292133386Protobuf::Field::VarintField#coerce!
0.11 0.11 0.00761459/21322798##&2133386/4298337Kernel.kind_of?
1.130.270.861522918/1522918Protobuf::Field::EnumField(singleton)#set_field0.910.910.008217995/8217995ProtobufJavaHelpers::EncodeDecode.encode
1% 0%1.130.270.861522918Protobuf::Field::EnumField#coerce!0%0.910.910.008217995ProtobufJavaHelpers::Varinter.to_varint
0.760.270.501522918/2284386Protobuf::Enum.fetch
0.100.100.001522918/2285051Protobuf::Field::BaseField#type_class
0.280.150.131522918/5330213Protobuf::Field::EnumField(singleton)#encode_to_stream
0.320.150.171522918/5330213Protobuf::Field::Int64Field(singleton)#encode_to_stream
0.470.230.242284377/5330213Protobuf::Field::StringField(singleton)#encode_to_stream
1%0%1.060.520.545330213IO::GenericWritable.<<
0.540.540.005330213/5330213StringIO#write
0.100.100.00761459/21322798Protobuf::Field::IntegerField#encode
0.110.110.00761459/21322798Protobuf::Field::EnumField#encode
0.470.470.0013706262/21322798Protobuf::VarintPure.decode
1%1%1.001.000.0021322798##&
0.140.140.003368424/23728693##each
0.270.270.006853131/23728693Protobuf::VarintPure.decode
0.560.560.0013506055/23728693Benchmark::IPS::Job::Entry#call_times
1%1%0.970.970.0023728693##+
0.950.000.952/112(top)
1%0%0.950.000.95112Kernel.require
0.950.000.95112/1865Kernel.require
0.890.660.226853131/6853131Protobuf::VarintPure.decode
1%1%0.890.660.226853131IO::GenericReadable.readbyte
0.220.220.006853131/6853131StringIO#getbyte
0.880.280.60761459/761459Protobuf::Field::EnumField#decode
1%0%0.880.280.60761459Protobuf::Field::EnumField#acceptable?
0.450.160.28761459/2284386Protobuf::Enum.fetch
0.810.000.811/1Kernel.require
1%0%0.810.000.811Bundler.setup
0.440.010.431/2Bundler.definition
0.360.000.361/1Bundler::Runtime#setup
0.110.110.00761459/2284378Protobuf::Message#each_field_for_serialization
0.660.410.251522919/2284378Protobuf::Field::StringField(singleton)#set_field
1%0%0.770.520.252284378Protobuf::Message#_protobuf_message_required_field_tags
0.200.200.001522919/1522926Protobuf::Message::Fields::ClassMethods.required_field_tags
0.120.120.003049844/19924325Protobuf::Field::VarintField.encode
0.650.650.0016874465/19924325Benchmark::IPS::Job::Entry#call_times
1%1%0.760.760.0019924325##<
0.740.310.443368939/3368939##each
1%0%0.740.310.443368939Benchmark::Timing.now
0.440.440.003368939/3368940Process.clock_gettime
0.660.390.271523058/1525107Protobuf::Field::VarintField.encode
1%0%0.680.390.281525107Protobuf::Field::VarintField.cached_varint
0.170.170.001525107/63970204##[]
0.670.410.262284377/2284377Protobuf::Enum.fetch
1%0%0.670.410.262284377Protobuf::Enum.enum_for_tag_integer
0.140.140.002284377/63970204##[]
0.120.120.002284377/2284829##first
0.650.420.221522919/1522919Protobuf::Field::VarintField#coerce!
1%0%0.650.420.221522919Protobuf::Field::Int64Field#acceptable?
0.540.540.005330213/5330213IO::GenericWritable.<<
0%0%0.540.540.005330213StringIO#write
0.520.060.4617/19(top)
0%0%0.520.060.4619Kernel.load
0.420.030.392/1865Kernel.require
0.440.010.431/2Bundler.setup
0%0%0.440.010.432Bundler.definition
0.350.000.341/1Bundler::Definition.build
0.440.440.003368939/3368940Benchmark::Timing.now
0%0%0.440.440.003368940Process.clock_gettime
0.430.320.11761459/761459Protobuf::Field::Int64Field(singleton)#set
0%0%0.430.320.11761459Protobuf::Field::IntegerField#decode
0.330.000.331/822Bundler::Runtime#requested_specs
0%0%0.410.000.41822Kernel.send
0.330.000.331/1Bundler::Definition#requested_specs
0.360.000.361/1Bundler.setup
0%0%0.360.000.361Bundler::Runtime#setup
0.330.000.331/1Bundler::Runtime#requested_specs
0.260.260.860.86 0.006853131/9139607Protobuf::VarintPure.decode6795778/6795779Benchmark::Timing.now
0% 0%0.350.350.860.86 0.009139607##|6795779Process.clock_gettime
0.350.000.341/1Bundler.definition
0%0%0.350.000.341Bundler::Definition.build
0.330.000.331/1Bundler::Dsl.evaluate
0.330.86 0.000.330.86 1/1Bundler::Definition.buildKernel.require
0% 0%0.330.86 0.000.330.86 1Bundler::Dsl.evaluateBundler.setup
0.240.000.241/1Bundler::Dsl#to_definition0.480.010.481/2Bundler.definition
0.330.37 0.000.330.37 1/1 Bundler::Runtime#setup
0%0%0.330.000.331Bundler::Runtime#requested_specs
0.330.000.331/822Kernel.send
0.330.000.331/1Kernel.send
0%0%0.330.000.331Bundler::Definition#requested_specs
0.330.000.331/1Bundler::Definition#specs_for
0.330.590.59 0.000.331/1Bundler::Definition#requested_specs14883688/17017539ProtobufJavaHelpers::EncodeDecode.decode
0% 0%0.330.000.331Bundler::Definition#specs_for
0.320.680.68 0.000.321/1Bundler::Definition#specs17017539Numeric#nonzero?
0.270.270.660.66 0.006853131/8376374Protobuf::VarintPure.decode14883688/14883688IO::GenericReadable.readbyte
0% 0%0.330.330.660.66 0.008376374Numeric#nonzero?14883688StringIO#getbyte
0.320.000.321/1Bundler::Definition#specs_for0.580.400.184103921/4104743Protobuf::Field::BaseFieldObjectDefinitions::StringEncodeToStream#call
0% 0%0.320.000.321Bundler::Definition#specs0.590.400.184104743BasicObject#!=
0.210.180.18 0.000.211/1Bundler::SpecSet#materialize4104167/4104503BasicObject#==
0.280.280.580.58 0.006853131/6853284Protobuf::VarintPure.decode14883688/14883841ProtobufJavaHelpers::EncodeDecode.decode
0% 0%0.280.280.580.58 0.006853284##<<14883841##<<
0.110.110.560.56 0.002284386/5331568Protobuf::Enum.fetch14883688/14883841ProtobufJavaHelpers::EncodeDecode.decode
0% 0%0.270.270.560.56 0.005331568Kernel.kind_of?14883841##|
0.260.260.540.54 0.006853131/6853756Protobuf::VarintPure.decode14883688/14884832ProtobufJavaHelpers::EncodeDecode.decode
0% 0%0.260.260.540.54 0.006853756##*14884832##*
0.240.000.241/1Bundler::Dsl.evaluate0.500.060.4417/19(top)
0% 0%0.240.000.241Bundler::Dsl#to_definition0.500.060.4419Kernel.load
0.240.010.231/1524359Class#new0.410.030.382/1883Kernel.require
0.230.000.231/1Class#new0.480.010.481/2Bundler.setup
0% 0%0.230.000.231Bundler::Definition#initialize0.480.010.482Bundler.definition
0.230.070.16761459/1522918##each_key
0%0%0.230.070.161522918Protobuf::Field::EnumField(singleton)#value_from_values0.390.000.381/1Bundler::Definition.build
0.190.000.191/392Bundler::SpecSet#materialize0.460.300.162123384/2123384Protobuf::Field::BaseFieldObjectDefinitions::BaseSetMethod#call
0% 0%0.230.020.21392##map!0.460.300.162123384Protobuf::Field::StringField#decode
0.190.160.16 0.000.1938/38Bundler::LazySpecification#__materialize__2123384/2123384##force_encoding
0.220.220.34 0.006853131/6853131IO::GenericReadable.readbyte0.341/874Bundler::Runtime#requested_specs
0% 0%0.220.220.42 0.006853131StringIO#getbyte0.42874Kernel.send
0%0%0.220.22
0.34 0.005331092Kernel.nil?0.341/1Bundler::Definition#requested_specs
0.210.140.07761459/761459Protobuf::Field::StringField(singleton)#set0.390.000.381/1Bundler.definition
0% 0%0.210.140.07761459Protobuf::Field::StringField#decode0.390.000.381Bundler::Definition.build
0.370.000.371/1Bundler::Dsl.evaluate
0.210.37 0.000.210.37 1/1Bundler::Definition#specsBundler::Definition.build
0% 0%0.210.37 0.000.210.37 1Bundler::SpecSet#materializeBundler::Dsl.evaluate
0.190.28 0.000.191/392##map!0.281/1Bundler::Dsl#to_definition
0.210.210.370.37 0.003049844/3051803Protobuf::Field::VarintField.encode6217305/6217305StringIO.new
0% 0%0.210.210.370.37 0.003051803##<<6217305StringIO#initialize
0.200.110.09751459/761459Proc#call0.370.000.371/1Bundler.setup
0% 0%0.210.110.09761459StringIO.new0.370.000.371Bundler::Runtime#setup
0.200.200.34 0.001522919/1523730Protobuf::Message#_protobuf_message_field0.341/1Bundler::Runtime#requested_specs
0%0%0.200.20
0.180.18 0.001523730Protobuf::Message::Fields::ClassMethods.field_store2113384/4247921Proc#call
0.110.110.180.18 0.002286323/4570700Protobuf::Field::VarintField.encode2133386/4247921Test::Resource#_protobuf_message_unset_required_field_tags
0% 0%0.200.200.360.36 0.004570700##>>4247921Kernel.dup
0.200.200.340.34 0.001522919/1522926Protobuf::Message#_protobuf_message_required_field_tags6794732/6794732##each
0% 0%0.200.200.340.34 0.001522926Protobuf::Message::Fields::ClassMethods.required_field_tags6794732##<
0.190.34 0.000.1938/38##map!0.341/1Bundler::Runtime#setup
0% 0%0.190.34 0.000.1938Bundler::LazySpecification#__materialize__0.341Bundler::Runtime#requested_specs
0.150.34 0.000.1537/37Bundler::Source::Rubygems#specs0.341/874Kernel.send
0.180.110.07761459/761727Protobuf::Field::EnumField#encode0.340.000.341/1Kernel.send
0% 0%0.180.110.07761727Protobuf::Enum#to_i0.340.000.341Bundler::Definition#requested_specs
0.100.100.001522918/2285051Protobuf::Field::EnumField#coerce!
0%0%0.180.180.34 0.002285051Protobuf::Field::BaseField#type_class0.341/1Bundler::Definition#specs_for
0.180.180.34 0.003368414/3368414##each0.341/1Bundler::Definition#requested_specs
0% 0%0.180.180.34 0.003368414##<0.341Bundler::Definition#specs_for
0.110.110.002284530/3809398Protobuf::Field::VarintField.encode
0%0%0.180.180.33 0.003809398##<=0.331/1Bundler::Definition#specs
0.110.33 0.000.11109/153Protobuf::Message::Fields::ClassMethods.optional0.331/1Bundler::Definition#specs_for
0% 0%0.160.33 0.000.16153Protobuf::Message::Fields::ClassMethods.define_field0.331Bundler::Definition#specs
0.160.22 0.000.15153/153Protobuf::Field.build0.221/1Bundler::SpecSet#materialize
0.120.320.32 0.000.123/285Gem::Specification.gemspec_stubs_in4093920/4103921Proc#call
0% 0%0.160.020.15285##select0.320.320.004103921Protobuf::Message#to_proto
0.120.310.31 0.000.1268/68Gem::StubSpecification#valid?6380152/6380152Protobuf::Decoder.decode_each_field
0% 0%0.160.160.310.31 0.003807453##>=6380152StringIO#eof
0.150.280.28 0.000.151/2Bundler::Source::Rubygems#installed_specs4103921/4104065Protobuf::Field::BaseFieldObjectDefinitions::StringEncodeToStream#call
0% 0%0.160.000.162Bundler::Index.build
0.140.280.28 0.000.141/1Bundler::RubygemsIntegration::MoreFuture#all_specs4104065##+
0.160.28 0.000.15153/153Protobuf::Message::Fields::ClassMethods.define_field0.281/1Bundler::Dsl.evaluate
0% 0%0.160.28 0.000.15153Protobuf::Field.build0.281Bundler::Dsl#to_definition
0.150.28 0.010.14153/15243590.271/2136384 Class#new
0.150.27 0.000.1537/37Bundler::LazySpecification#__materialize__0.271/1Class#new
0% 0%0.150.27 0.000.1537Bundler::Source::Rubygems#specs0.271Bundler::Definition#initialize
0.150.10 0.000.150.10 1/1Bundler::Source::Rubygems#installed_specsBundler::Definition#converge_paths
0.150.250.25 0.000.151/1Bundler::Source::Rubygems#specs6380152/6383519Protobuf::Decoder.decode_each_field
0% 0%0.150.250.25 0.000.151Bundler::Source::Rubygems#installed_specs6383519##==
0.150.230.23 0.000.151/2Bundler::Index.build2123384/2123384Protobuf::Decoder.decode_each_field
0%0%0.230.230.002123384StringIO#read
0.140.100.04761459/762229Protobuf::Field::StringField(singleton)#encode_to_stream0.190.000.191/425Bundler::SpecSet#materialize
0% 0%0.150.100.05762229BasicObject#!=0.230.020.21425##map!
0.150.150.19 0.003045836/3045836Protobuf::Decoder.decode_each_field0.1939/39Bundler::LazySpecification#__materialize__
0%0%0.150.15
0.110.11 0.003045836StringIO#eof2133386/4298337Protobuf::Field::VarintField#coerce!
0.140.010.14153/153Class#new0.120.120.002133386/4298337Protobuf::Field::BaseFieldObjectDefinitions::RequiredStringSetField#call
0% 0%0.140.010.14153Protobuf::Field::BaseField#initialize0.230.230.004298337Kernel.kind_of?
0.140.22 0.000.140.22 1/1Bundler::Index.buildBundler::Definition#specs
0% 0%0.140.22 0.000.140.22 1Bundler::RubygemsIntegration::MoreFuture#all_specsBundler::SpecSet#materialize
0.140.19 0.000.141/1Gem::Specification.stubs0.191/425##map!
0.210.210.004103921/4103921Protobuf::Field::BaseFieldObjectDefinitions::StringEncodeToStream#call
0% 0%0.140.060.081136BasicObject#instance_eval0.210.210.004103921##encoding
0.140.19 0.000.141/1Kernel.require0.1939/39##map!
0% 0%0.140.19 0.000.141Gem::Specification.load_defaults0.1939Bundler::LazySpecification#__materialize__
0.140.16 0.000.141/1Gem::Specification.each_spec0.1637/37Bundler::Source::Rubygems#specs
0.160.100.062133386/2133600Protobuf::Message#initialize
0% 0%0.140.030.1160Kernel.eval
0.110.020.0915/1524359Class#new0.190.120.072133600##each
0.140.180.18 0.000.141/1Gem::Specification.load_defaults4256768/4256768Protobuf::Decoder.decode_each_field
0% 0%0.140.180.18 0.000.141Gem::Specification.each_spec4256768##>>
0%0%0.180.020.16697##map
0.140.180.18 0.000.141/1Gem::Specification.each_gemspec4104167/4104503BasicObject#!=
0%0%0.180.180.004104503BasicObject#==
0.140.170.17 0.000.141/1Gem::Specification.each_spec4103921/4103921Protobuf::Field::BaseFieldObjectDefinitions::StringEncodeToStream#call
0% 0%0.140.000.141Gem::Specification.each_gemspec
0.140.170.17 0.000.141/762970##each4103921##bytesize
0.140.15 0.000.141/1Bundler::RubygemsIntegration::MoreFuture#all_specs0.151/2Bundler::Source::Rubygems#installed_specs
0% 0%0.140.16 0.000.141Gem::Specification.stubs0.162Bundler::Index.build
0.120.15 0.000.120.15 1/1Gem::Specification.installed_stubsBundler::RubygemsIntegration::MoreFuture#all_specs
0.130.130.160.16 0.003045836/3048922Protobuf::Decoder.decode_each_field2133386/2133570Protobuf::Field::BaseFieldObjectDefinitions::RequiredStringSetField#call
0% 0%0.130.130.160.16 0.003048922##==2133570##delete
0.120.160.16 0.000.122/3##each2123384/2123384Protobuf::Field::StringField#decode
0% 0%0.130.000.133Gem::Specification.gemspec_stubs_in
0.120.160.16 0.000.123/285##select2123384##force_encoding
0.120.120.16 0.00763521/763523Protobuf::Field::VarintField.encode0.1637/37Bundler::LazySpecification#__materialize__
0% 0%0.120.120.160.000.1637Bundler::Source::Rubygems#specs
0.15 0.00763523##pack0.151/1Bundler::Source::Rubygems#installed_specs
0.120.120.15 0.002284377/2284829Protobuf::Enum.enum_for_tag_integer0.151/1Bundler::Source::Rubygems#specs
0% 0%0.120.120.150.000.151Bundler::Source::Rubygems#installed_specs
0.15 0.002284829##first0.151/2Bundler::Index.build
0.120.15 0.000.1268/1220Gem::StubSpecification#valid?0.151/1Bundler::Index.build
0% 0%0.120.15 0.000.121220Gem::StubSpecification#data0.151Bundler::RubygemsIntegration::MoreFuture#all_specs
0.120.010.1168/68Kernel.open
0%0%0.120.120.14 0.003046840Kernel.class0.141/1Gem::Specification.stubs
0.120.14 0.000.1268/68##select0.141/1Bundler::RubygemsIntegration::MoreFuture#all_specs
0% 0%0.120.14 0.000.1268Gem::StubSpecification#valid?0.141Gem::Specification.stubs
0.12
0%0%0.140.030.1161Kernel.eval
0%0%0.13 0.000.1268/1220Gem::StubSpecification#data0.133Gem::Specification.gemspec_stubs_in
0.00 0.12 1/1Gem::Specification.stubsKernel.require
0% 0.00 0.12 1Gem::Specification.installed_stubsGem::Specification.load_defaults
0.12 0.00 0.12 1/1Gem::Specification.map_stubsGem::Specification.each_spec
0.00 0.12 1/1Gem::Specification.installed_stubsGem::Specification.load_defaults
0% 0.00 0.12 1Gem::Specification.map_stubsGem::Specification.each_spec
0.12 0.00 0.12 1/1##flat_mapGem::Specification.each_gemspec
0.00 0.12 1/1Gem::Specification.map_stubsGem::Specification.each_spec
0% 0.00 0.12 1##flat_mapGem::Specification.each_gemspec
0.12 0.00 0.121/762970##each1/4105546##each
0.120.010.1168/68Gem::StubSpecification#data0.100.000.101/178Bundler::Definition#converge_paths
0% 0%0.120.01 0.1168Kernel.open0.000.11178##any?
0.100.000.102/2Bundler::Definition#specs_changed?
0.110.10 0.000.11109/109Kernel.require0.101/1Bundler::Definition#initialize
0% 0%0.110.10 0.000.11109Protobuf::Message::Fields::ClassMethods.optional0.101Bundler::Definition#converge_paths
0.110.10 0.000.11109/153Protobuf::Message::Fields::ClassMethods.define_field0.101/178##any?
0.110.10 0.00 0.1013/14##each2/2##any?
0% 0%0.110.000.1114Gem::Specification.load
0.10 0.10 0.00761459/761459Protobuf::Decoder.decode_each_field0.102Bundler::Definition#specs_changed?
0% 0% 0.100.10 0.00761459StringIO#read0.10153Protobuf::Message::Fields::ClassMethods.define_field