msgpack 1.4.2 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yaml +57 -0
- data/ChangeLog +60 -0
- data/README.md +25 -1
- data/Rakefile +1 -2
- data/bench/bench.rb +78 -0
- data/bin/console +8 -0
- data/doclib/msgpack/factory.rb +47 -3
- data/doclib/msgpack/packer.rb +5 -4
- data/doclib/msgpack/unpacker.rb +2 -2
- data/ext/java/org/msgpack/jruby/Buffer.java +23 -16
- data/ext/java/org/msgpack/jruby/Decoder.java +29 -21
- data/ext/java/org/msgpack/jruby/Encoder.java +68 -30
- data/ext/java/org/msgpack/jruby/ExtensionRegistry.java +37 -49
- data/ext/java/org/msgpack/jruby/ExtensionValue.java +5 -8
- data/ext/java/org/msgpack/jruby/Factory.java +47 -7
- data/ext/java/org/msgpack/jruby/Packer.java +29 -17
- data/ext/java/org/msgpack/jruby/Unpacker.java +66 -42
- data/ext/msgpack/buffer.c +38 -57
- data/ext/msgpack/buffer.h +19 -10
- data/ext/msgpack/buffer_class.c +90 -52
- data/ext/msgpack/compat.h +0 -99
- data/ext/msgpack/extconf.rb +9 -22
- data/ext/msgpack/factory_class.c +133 -43
- data/ext/msgpack/packer.c +60 -36
- data/ext/msgpack/packer.h +27 -18
- data/ext/msgpack/packer_class.c +84 -77
- data/ext/msgpack/packer_class.h +11 -0
- data/ext/msgpack/packer_ext_registry.c +24 -32
- data/ext/msgpack/packer_ext_registry.h +40 -33
- data/ext/msgpack/sysdep.h +5 -2
- data/ext/msgpack/unpacker.c +128 -97
- data/ext/msgpack/unpacker.h +17 -10
- data/ext/msgpack/unpacker_class.c +75 -80
- data/ext/msgpack/unpacker_class.h +11 -0
- data/ext/msgpack/unpacker_ext_registry.c +42 -18
- data/ext/msgpack/unpacker_ext_registry.h +23 -16
- data/lib/msgpack/bigint.rb +69 -0
- data/lib/msgpack/factory.rb +103 -0
- data/lib/msgpack/symbol.rb +21 -4
- data/lib/msgpack/time.rb +1 -1
- data/lib/msgpack/version.rb +1 -1
- data/lib/msgpack.rb +5 -7
- data/msgpack.gemspec +2 -2
- data/spec/bigint_spec.rb +26 -0
- data/spec/cruby/buffer_spec.rb +17 -0
- data/spec/factory_spec.rb +351 -12
- data/spec/msgpack_spec.rb +1 -1
- data/spec/packer_spec.rb +18 -0
- data/spec/spec_helper.rb +20 -3
- data/spec/timestamp_spec.rb +38 -0
- data/spec/unpacker_spec.rb +54 -4
- metadata +25 -41
- data/.travis.yml +0 -39
- data/bench/pack.rb +0 -23
- data/bench/pack_log.rb +0 -33
- data/bench/pack_log_long.rb +0 -65
- data/bench/pack_symbols.rb +0 -28
- data/bench/run.sh +0 -14
- data/bench/run_long.sh +0 -35
- data/bench/run_symbols.sh +0 -26
- data/bench/unpack.rb +0 -21
- data/bench/unpack_log.rb +0 -34
- data/bench/unpack_log_long.rb +0 -67
data/bench/unpack_log_long.rb
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
# viiite report --regroup bench,threads bench/pack_log_long.rb
|
2
|
-
|
3
|
-
require 'viiite'
|
4
|
-
require 'msgpack'
|
5
|
-
|
6
|
-
data_plain = MessagePack.pack({
|
7
|
-
'message' => '127.0.0.1 - - [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326 "http://www.example.com/start.html" "Mozilla/4.08 [en] (Win98; I ;Nav)"'
|
8
|
-
})
|
9
|
-
data_structure = MessagePack.pack({
|
10
|
-
'remote_host' => '127.0.0.1',
|
11
|
-
'remote_user' => '-',
|
12
|
-
'date' => '10/Oct/2000:13:55:36 -0700',
|
13
|
-
'request' => 'GET /apache_pb.gif HTTP/1.0',
|
14
|
-
'method' => 'GET',
|
15
|
-
'path' => '/apache_pb.gif',
|
16
|
-
'protocol' => 'HTTP/1.0',
|
17
|
-
'status' => 200,
|
18
|
-
'bytes' => 2326,
|
19
|
-
'referer' => 'http://www.example.com/start.html',
|
20
|
-
'agent' => 'Mozilla/4.08 [en] (Win98; I ;Nav)',
|
21
|
-
})
|
22
|
-
|
23
|
-
seconds = 3600 # 1 hour
|
24
|
-
|
25
|
-
Viiite.bench do |b|
|
26
|
-
b.range_over([1, 2, 4, 8, 16], :threads) do |threads|
|
27
|
-
b.report(:plain) do
|
28
|
-
ths = []
|
29
|
-
end_at = Time.now + seconds
|
30
|
-
threads.times do
|
31
|
-
t = Thread.new do
|
32
|
-
packs = 0
|
33
|
-
while Time.now < end_at
|
34
|
-
10000.times do
|
35
|
-
MessagePack.unpack(data_plain)
|
36
|
-
end
|
37
|
-
packs += 10000
|
38
|
-
end
|
39
|
-
packs
|
40
|
-
end
|
41
|
-
ths.push t
|
42
|
-
end
|
43
|
-
sum = ths.reduce(0){|r,t| r + t.value }
|
44
|
-
puts "MessagePack.unpack, plain, #{threads} threads: #{sum} times, #{sum / seconds} times/second."
|
45
|
-
end
|
46
|
-
|
47
|
-
b.report(:structure) do
|
48
|
-
ths = []
|
49
|
-
end_at = Time.now + seconds
|
50
|
-
threads.times do
|
51
|
-
t = Thread.new do
|
52
|
-
packs = 0
|
53
|
-
while Time.now < end_at
|
54
|
-
10000.times do
|
55
|
-
MessagePack.unpack(data_structure)
|
56
|
-
end
|
57
|
-
packs += 10000
|
58
|
-
end
|
59
|
-
packs
|
60
|
-
end
|
61
|
-
ths.push t
|
62
|
-
end
|
63
|
-
sum = ths.reduce(0){|r,t| r + t.value }
|
64
|
-
puts "MessagePack.unpack, structured, #{threads} threads: #{sum} times, #{sum / seconds} times/second."
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|