protobuf 3.8.5 → 3.9.0.pre

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,6 +26,7 @@ require "protobuf/version"
26
26
  s.add_dependency 'thor'
27
27
  s.add_dependency 'thread_safe'
28
28
 
29
+ s.add_development_dependency 'benchmark-ips'
29
30
  s.add_development_dependency 'ffi-rzmq'
30
31
  s.add_development_dependency 'rake', '< 11.0' # Rake 11.0.1 removes the last_comment method which rspec-core (< 3.4.4) uses
31
32
  s.add_development_dependency 'rspec', '>= 3.0'
@@ -49,7 +50,8 @@ require "protobuf/version"
49
50
 
50
51
  s.add_development_dependency 'varint'
51
52
  s.add_development_dependency 'ruby-prof'
52
- else
53
+ elsif RUBY_PLATFORM =~ /java/i
54
+ s.add_development_dependency 'fast_blank_java'
53
55
  s.add_development_dependency 'pry'
54
56
  end
55
57
  end
@@ -0,0 +1,82 @@
1
+ require 'base64'
2
+ require 'benchmark/ips'
3
+ require 'pry'
4
+ require "./spec/support/protos/resource.pb"
5
+ #require "jruby/profiler/flame_graph_profile_printer"
6
+
7
+ VALUES = {
8
+ 0 => "AA==",
9
+ 5 => "BQ==",
10
+ 51 => "Mw==",
11
+ 9_192 => "6Ec=",
12
+ 80_389 => "hfQE",
13
+ 913_389 => "7d83",
14
+ 516_192_829_912_693 => "9eyMkpivdQ==",
15
+ 9_999_999_999_999_999_999 => "//+fz8jgyOOKAQ==",
16
+ }.freeze
17
+
18
+ #DECODEME = ::Derp.encode_cache_hash(2576)
19
+ #DECODEME2 = ::Derp.encode_cache_hash(25763111)
20
+
21
+ 10_000.times do
22
+ t = ::Test::Resource.new(:name => "derp", :date_created => 123456789)
23
+ t.status = 3
24
+ ss = StringIO.new
25
+ ::Protobuf::Encoder.encode(t.to_proto, ss)
26
+ ss.rewind
27
+ t2 = ::Test::Resource.decode_from(ss)
28
+ end
29
+
30
+ if ENV["FLAME"]
31
+ result = JRuby::Profiler.profile do
32
+ 1_000_000.times do
33
+ t = ::Test::Resource.new(:name => "derp", :date_created => 123456789)
34
+ t.status = 3
35
+ ss = StringIO.new
36
+ ::Protobuf::Encoder.encode(t.to_proto, ss)
37
+ ss.rewind
38
+ t2 = ::Test::Resource.decode_from(ss)
39
+ #fail "derp" unless t == t2
40
+
41
+ #t = ::Test::Resource.new(:name => "derp", :date_created => 123456789)
42
+ #t.field?(:name)
43
+ #t.field?(:date_created)
44
+ #t.field?(:derp_derp)
45
+ #t.respond_to_has_and_present?(:name)
46
+ #t.respond_to_has_and_present?(:date_created)
47
+ #t.respond_to_has_and_present?(:derp_derp)
48
+ end
49
+ end
50
+
51
+ printer = JRuby::Profiler::FlameGraphProfilePrinter.new(result)
52
+ printer.printProfile(STDOUT)
53
+ else
54
+ TO_HASH = ::Test::Resource.new(:name => "derp", :date_created => 123456789)
55
+ ENCODE = ::Test::Resource.new(:name => "derp", :date_created => 123456789)
56
+ DECODE = begin
57
+ ss = StringIO.new
58
+ ::Protobuf::Encoder.encode(ENCODE.to_proto, ss)
59
+ ss.rewind
60
+ ss.string
61
+ end
62
+
63
+ Benchmark.ips do |x|
64
+ x.config(:time => 20, :warmup => 10)
65
+ x.report("to_hash") do
66
+ TO_HASH.to_hash
67
+ end
68
+
69
+ x.report("to_hash_with_string_keys") do
70
+ TO_HASH.to_hash_with_string_keys
71
+ end
72
+
73
+ x.report("encode") do
74
+ ss = StringIO.new
75
+ ::Protobuf::Encoder.encode(ENCODE.to_proto, ss)
76
+ end
77
+
78
+ x.report("decode") do
79
+ ::Test::Resource.decode_from(::StringIO.new(DECODE.dup))
80
+ end
81
+ end
82
+ end
metadata CHANGED
@@ -1,237 +1,223 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protobuf
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.5
4
+ version: 3.9.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - BJ Neilsen
8
8
  - Brandon Dewitt
9
9
  - Devin Christensen
10
10
  - Adam Hutchison
11
- autorequire:
11
+ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-11-13 00:00:00.000000000 Z
14
+ date: 2019-01-15 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
- name: activesupport
18
17
  requirement: !ruby/object:Gem::Requirement
19
18
  requirements:
20
19
  - - ">="
21
20
  - !ruby/object:Gem::Version
22
21
  version: '3.2'
23
- type: :runtime
22
+ name: activesupport
24
23
  prerelease: false
24
+ type: :runtime
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: '3.2'
30
30
  - !ruby/object:Gem::Dependency
31
- name: middleware
32
31
  requirement: !ruby/object:Gem::Requirement
33
32
  requirements:
34
33
  - - ">="
35
34
  - !ruby/object:Gem::Version
36
35
  version: '0'
37
- type: :runtime
36
+ name: middleware
38
37
  prerelease: false
38
+ type: :runtime
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
43
  version: '0'
44
44
  - !ruby/object:Gem::Dependency
45
- name: thor
46
45
  requirement: !ruby/object:Gem::Requirement
47
46
  requirements:
48
47
  - - ">="
49
48
  - !ruby/object:Gem::Version
50
49
  version: '0'
51
- type: :runtime
50
+ name: thor
52
51
  prerelease: false
52
+ type: :runtime
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - ">="
56
56
  - !ruby/object:Gem::Version
57
57
  version: '0'
58
58
  - !ruby/object:Gem::Dependency
59
- name: thread_safe
60
59
  requirement: !ruby/object:Gem::Requirement
61
60
  requirements:
62
61
  - - ">="
63
62
  - !ruby/object:Gem::Version
64
63
  version: '0'
65
- type: :runtime
64
+ name: thread_safe
66
65
  prerelease: false
66
+ type: :runtime
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
69
  - - ">="
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  - !ruby/object:Gem::Dependency
73
- name: ffi-rzmq
74
73
  requirement: !ruby/object:Gem::Requirement
75
74
  requirements:
76
75
  - - ">="
77
76
  - !ruby/object:Gem::Version
78
77
  version: '0'
78
+ name: benchmark-ips
79
+ prerelease: false
79
80
  type: :development
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ - !ruby/object:Gem::Dependency
87
+ requirement: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ name: ffi-rzmq
80
93
  prerelease: false
94
+ type: :development
81
95
  version_requirements: !ruby/object:Gem::Requirement
82
96
  requirements:
83
97
  - - ">="
84
98
  - !ruby/object:Gem::Version
85
99
  version: '0'
86
100
  - !ruby/object:Gem::Dependency
87
- name: rake
88
101
  requirement: !ruby/object:Gem::Requirement
89
102
  requirements:
90
103
  - - "<"
91
104
  - !ruby/object:Gem::Version
92
105
  version: '11.0'
93
- type: :development
106
+ name: rake
94
107
  prerelease: false
108
+ type: :development
95
109
  version_requirements: !ruby/object:Gem::Requirement
96
110
  requirements:
97
111
  - - "<"
98
112
  - !ruby/object:Gem::Version
99
113
  version: '11.0'
100
114
  - !ruby/object:Gem::Dependency
101
- name: rspec
102
115
  requirement: !ruby/object:Gem::Requirement
103
116
  requirements:
104
117
  - - ">="
105
118
  - !ruby/object:Gem::Version
106
119
  version: '3.0'
107
- type: :development
120
+ name: rspec
108
121
  prerelease: false
122
+ type: :development
109
123
  version_requirements: !ruby/object:Gem::Requirement
110
124
  requirements:
111
125
  - - ">="
112
126
  - !ruby/object:Gem::Version
113
127
  version: '3.0'
114
128
  - !ruby/object:Gem::Dependency
115
- name: rubocop
116
129
  requirement: !ruby/object:Gem::Requirement
117
130
  requirements:
118
131
  - - "~>"
119
132
  - !ruby/object:Gem::Version
120
133
  version: 0.38.0
121
- type: :development
134
+ name: rubocop
122
135
  prerelease: false
136
+ type: :development
123
137
  version_requirements: !ruby/object:Gem::Requirement
124
138
  requirements:
125
139
  - - "~>"
126
140
  - !ruby/object:Gem::Version
127
141
  version: 0.38.0
128
142
  - !ruby/object:Gem::Dependency
129
- name: parser
130
143
  requirement: !ruby/object:Gem::Requirement
131
144
  requirements:
132
145
  - - '='
133
146
  - !ruby/object:Gem::Version
134
147
  version: 2.3.0.6
135
- type: :development
148
+ name: parser
136
149
  prerelease: false
150
+ type: :development
137
151
  version_requirements: !ruby/object:Gem::Requirement
138
152
  requirements:
139
153
  - - '='
140
154
  - !ruby/object:Gem::Version
141
155
  version: 2.3.0.6
142
156
  - !ruby/object:Gem::Dependency
143
- name: simplecov
144
157
  requirement: !ruby/object:Gem::Requirement
145
158
  requirements:
146
159
  - - ">="
147
160
  - !ruby/object:Gem::Version
148
161
  version: '0'
149
- type: :development
162
+ name: simplecov
150
163
  prerelease: false
151
- version_requirements: !ruby/object:Gem::Requirement
152
- requirements:
153
- - - ">="
154
- - !ruby/object:Gem::Version
155
- version: '0'
156
- - !ruby/object:Gem::Dependency
157
- name: timecop
158
- requirement: !ruby/object:Gem::Requirement
159
- requirements:
160
- - - ">="
161
- - !ruby/object:Gem::Version
162
- version: '0'
163
164
  type: :development
164
- prerelease: false
165
165
  version_requirements: !ruby/object:Gem::Requirement
166
166
  requirements:
167
167
  - - ">="
168
168
  - !ruby/object:Gem::Version
169
169
  version: '0'
170
170
  - !ruby/object:Gem::Dependency
171
- name: yard
172
171
  requirement: !ruby/object:Gem::Requirement
173
172
  requirements:
174
173
  - - ">="
175
174
  - !ruby/object:Gem::Version
176
175
  version: '0'
177
- type: :development
176
+ name: timecop
178
177
  prerelease: false
179
- version_requirements: !ruby/object:Gem::Requirement
180
- requirements:
181
- - - ">="
182
- - !ruby/object:Gem::Version
183
- version: '0'
184
- - !ruby/object:Gem::Dependency
185
- name: pry-byebug
186
- requirement: !ruby/object:Gem::Requirement
187
- requirements:
188
- - - ">="
189
- - !ruby/object:Gem::Version
190
- version: '0'
191
178
  type: :development
192
- prerelease: false
193
179
  version_requirements: !ruby/object:Gem::Requirement
194
180
  requirements:
195
181
  - - ">="
196
182
  - !ruby/object:Gem::Version
197
183
  version: '0'
198
184
  - !ruby/object:Gem::Dependency
199
- name: pry-stack_explorer
200
185
  requirement: !ruby/object:Gem::Requirement
201
186
  requirements:
202
187
  - - ">="
203
188
  - !ruby/object:Gem::Version
204
189
  version: '0'
205
- type: :development
190
+ name: yard
206
191
  prerelease: false
192
+ type: :development
207
193
  version_requirements: !ruby/object:Gem::Requirement
208
194
  requirements:
209
195
  - - ">="
210
196
  - !ruby/object:Gem::Version
211
197
  version: '0'
212
198
  - !ruby/object:Gem::Dependency
213
- name: varint
214
199
  requirement: !ruby/object:Gem::Requirement
215
200
  requirements:
216
201
  - - ">="
217
202
  - !ruby/object:Gem::Version
218
203
  version: '0'
219
- type: :development
204
+ name: fast_blank_java
220
205
  prerelease: false
206
+ type: :development
221
207
  version_requirements: !ruby/object:Gem::Requirement
222
208
  requirements:
223
209
  - - ">="
224
210
  - !ruby/object:Gem::Version
225
211
  version: '0'
226
212
  - !ruby/object:Gem::Dependency
227
- name: ruby-prof
228
213
  requirement: !ruby/object:Gem::Requirement
229
214
  requirements:
230
215
  - - ">="
231
216
  - !ruby/object:Gem::Version
232
217
  version: '0'
233
- type: :development
218
+ name: pry
234
219
  prerelease: false
220
+ type: :development
235
221
  version_requirements: !ruby/object:Gem::Requirement
236
222
  requirements:
237
223
  - - ">="
@@ -276,6 +262,7 @@ files:
276
262
  - lib/protobuf/exceptions.rb
277
263
  - lib/protobuf/field.rb
278
264
  - lib/protobuf/field/base_field.rb
265
+ - lib/protobuf/field/base_field_object_definitions.rb
279
266
  - lib/protobuf/field/bool_field.rb
280
267
  - lib/protobuf/field/bytes_field.rb
281
268
  - lib/protobuf/field/double_field.rb
@@ -355,6 +342,7 @@ files:
355
342
  - lib/protobuf/version.rb
356
343
  - lib/protobuf/wire_type.rb
357
344
  - lib/protobuf/zmq.rb
345
+ - profile.html
358
346
  - proto/dynamic_discovery.proto
359
347
  - proto/google/protobuf/compiler/plugin.proto
360
348
  - proto/google/protobuf/descriptor.proto
@@ -448,11 +436,12 @@ files:
448
436
  - spec/support/resource_service.rb
449
437
  - spec/support/server.rb
450
438
  - spec/support/test_app_file.rb
439
+ - varint_prof.rb
451
440
  homepage: https://github.com/localshred/protobuf
452
441
  licenses:
453
442
  - MIT
454
443
  metadata: {}
455
- post_install_message:
444
+ post_install_message:
456
445
  rdoc_options: []
457
446
  require_paths:
458
447
  - lib
@@ -463,101 +452,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
463
452
  version: '0'
464
453
  required_rubygems_version: !ruby/object:Gem::Requirement
465
454
  requirements:
466
- - - ">="
455
+ - - ">"
467
456
  - !ruby/object:Gem::Version
468
- version: '0'
457
+ version: 1.3.1
469
458
  requirements: []
470
- rubyforge_project:
471
- rubygems_version: 2.7.8
472
- signing_key:
459
+ rubyforge_project:
460
+ rubygems_version: 2.7.6
461
+ signing_key:
473
462
  specification_version: 4
474
463
  summary: Google Protocol Buffers serialization and RPC implementation for Ruby.
475
- test_files:
476
- - spec/benchmark/tasks.rb
477
- - spec/bin/protoc-gen-ruby_spec.rb
478
- - spec/encoding/all_types_spec.rb
479
- - spec/encoding/extreme_values_spec.rb
480
- - spec/functional/class_inheritance_spec.rb
481
- - spec/functional/code_generator_spec.rb
482
- - spec/functional/socket_server_spec.rb
483
- - spec/functional/zmq_server_spec.rb
484
- - spec/lib/protobuf/cli_spec.rb
485
- - spec/lib/protobuf/code_generator_spec.rb
486
- - spec/lib/protobuf/enum_spec.rb
487
- - spec/lib/protobuf/field/bool_field_spec.rb
488
- - spec/lib/protobuf/field/double_field_spec.rb
489
- - spec/lib/protobuf/field/enum_field_spec.rb
490
- - spec/lib/protobuf/field/field_array_spec.rb
491
- - spec/lib/protobuf/field/field_hash_spec.rb
492
- - spec/lib/protobuf/field/fixed32_field_spec.rb
493
- - spec/lib/protobuf/field/fixed64_field_spec.rb
494
- - spec/lib/protobuf/field/float_field_spec.rb
495
- - spec/lib/protobuf/field/int32_field_spec.rb
496
- - spec/lib/protobuf/field/int64_field_spec.rb
497
- - spec/lib/protobuf/field/message_field_spec.rb
498
- - spec/lib/protobuf/field/sfixed32_field_spec.rb
499
- - spec/lib/protobuf/field/sfixed64_field_spec.rb
500
- - spec/lib/protobuf/field/sint32_field_spec.rb
501
- - spec/lib/protobuf/field/sint64_field_spec.rb
502
- - spec/lib/protobuf/field/string_field_spec.rb
503
- - spec/lib/protobuf/field/uint32_field_spec.rb
504
- - spec/lib/protobuf/field/uint64_field_spec.rb
505
- - spec/lib/protobuf/field_spec.rb
506
- - spec/lib/protobuf/generators/base_spec.rb
507
- - spec/lib/protobuf/generators/enum_generator_spec.rb
508
- - spec/lib/protobuf/generators/extension_generator_spec.rb
509
- - spec/lib/protobuf/generators/field_generator_spec.rb
510
- - spec/lib/protobuf/generators/file_generator_spec.rb
511
- - spec/lib/protobuf/generators/message_generator_spec.rb
512
- - spec/lib/protobuf/generators/service_generator_spec.rb
513
- - spec/lib/protobuf/lifecycle_spec.rb
514
- - spec/lib/protobuf/message_spec.rb
515
- - spec/lib/protobuf/optionable_spec.rb
516
- - spec/lib/protobuf/rpc/client_spec.rb
517
- - spec/lib/protobuf/rpc/connectors/base_spec.rb
518
- - spec/lib/protobuf/rpc/connectors/ping_spec.rb
519
- - spec/lib/protobuf/rpc/connectors/socket_spec.rb
520
- - spec/lib/protobuf/rpc/connectors/zmq_spec.rb
521
- - spec/lib/protobuf/rpc/middleware/exception_handler_spec.rb
522
- - spec/lib/protobuf/rpc/middleware/logger_spec.rb
523
- - spec/lib/protobuf/rpc/middleware/request_decoder_spec.rb
524
- - spec/lib/protobuf/rpc/middleware/response_encoder_spec.rb
525
- - spec/lib/protobuf/rpc/servers/socket_server_spec.rb
526
- - spec/lib/protobuf/rpc/servers/zmq/server_spec.rb
527
- - spec/lib/protobuf/rpc/servers/zmq/util_spec.rb
528
- - spec/lib/protobuf/rpc/servers/zmq/worker_spec.rb
529
- - spec/lib/protobuf/rpc/service_directory_spec.rb
530
- - spec/lib/protobuf/rpc/service_dispatcher_spec.rb
531
- - spec/lib/protobuf/rpc/service_filters_spec.rb
532
- - spec/lib/protobuf/rpc/service_spec.rb
533
- - spec/lib/protobuf/rpc/stat_spec.rb
534
- - spec/lib/protobuf/varint_spec.rb
535
- - spec/lib/protobuf_spec.rb
536
- - spec/spec_helper.rb
537
- - spec/support/all.rb
538
- - spec/support/packed_field.rb
539
- - spec/support/protos/all_types.data.bin
540
- - spec/support/protos/all_types.data.txt
541
- - spec/support/protos/enum.pb.rb
542
- - spec/support/protos/enum.proto
543
- - spec/support/protos/extreme_values.data.bin
544
- - spec/support/protos/google_unittest.bin
545
- - spec/support/protos/google_unittest.pb.rb
546
- - spec/support/protos/google_unittest.proto
547
- - spec/support/protos/google_unittest_custom_options.bin
548
- - spec/support/protos/google_unittest_custom_options.pb.rb
549
- - spec/support/protos/google_unittest_custom_options.proto
550
- - spec/support/protos/google_unittest_import.pb.rb
551
- - spec/support/protos/google_unittest_import.proto
552
- - spec/support/protos/google_unittest_import_public.pb.rb
553
- - spec/support/protos/google_unittest_import_public.proto
554
- - spec/support/protos/map-test.bin
555
- - spec/support/protos/map-test.pb.rb
556
- - spec/support/protos/map-test.proto
557
- - spec/support/protos/multi_field_extensions.pb.rb
558
- - spec/support/protos/multi_field_extensions.proto
559
- - spec/support/protos/resource.pb.rb
560
- - spec/support/protos/resource.proto
561
- - spec/support/resource_service.rb
562
- - spec/support/server.rb
563
- - spec/support/test_app_file.rb
464
+ test_files: []