asciipack 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/asciipack/unpacker.c +6 -9
- data/lib/asciipack/version.rb +1 -1
- data/spec/bench.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ff7b4041e8fa775567861e681624314b5c30725
|
4
|
+
data.tar.gz: d13eabb400af0ca2b595ed227759869722619725
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4bffcf8fe72cbf45bb954b60f77e6dfdab0c9368c33c9e8430e7288272165b20fe8143f20ef5c2b4177784b9430fb98f554bfd6e387ab4d7ad355f886aa753b
|
7
|
+
data.tar.gz: b22019fc12434cac3925b41166ed365a4cbc32ff1deab600239a632b36fb7af90c5c35e2b813f51034f6ad7c448c80cee6ee5e3a9163c069826cf048e0b68f27
|
data/ext/asciipack/unpacker.c
CHANGED
@@ -318,16 +318,13 @@ Unpacker_clear (VALUE self)
|
|
318
318
|
}
|
319
319
|
|
320
320
|
static VALUE
|
321
|
-
AsciiPack_unpack (int argc, VALUE *argv)
|
321
|
+
AsciiPack_unpack (int argc, VALUE *argv, VALUE self)
|
322
322
|
{
|
323
|
-
VALUE
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
Unpacker_buffer_feed(ptr, v);
|
329
|
-
|
330
|
-
return Unpacker_buffer_read(ptr);
|
323
|
+
VALUE unpacker = rb_funcall(cAsciiPack_Unpacker, rb_intern("new"), 0);
|
324
|
+
rb_funcall(unpacker, rb_intern("feed"), 1, argv[0]);
|
325
|
+
VALUE res = rb_funcall(unpacker, rb_intern("read"), 0);
|
326
|
+
rb_funcall(unpacker, rb_intern("clear"), 0);
|
327
|
+
return res;
|
331
328
|
}
|
332
329
|
|
333
330
|
void
|
data/lib/asciipack/version.rb
CHANGED
data/spec/bench.rb
CHANGED
@@ -48,8 +48,8 @@ end
|
|
48
48
|
puts("|object|" + reports(0).keys.join("|") + "|")
|
49
49
|
puts("|---|" + reports(0).keys.map{"---:"}.join("|") + "|")
|
50
50
|
|
51
|
-
|
52
|
-
0x10000.times {|i|
|
51
|
+
map32 = {}
|
52
|
+
0x10000.times {|i| map32[i.to_s] = 0 }
|
53
53
|
|
54
54
|
tt = Time.now
|
55
55
|
{
|
@@ -57,7 +57,7 @@ tt = Time.now
|
|
57
57
|
"str (1KB)" => ['a' * 1024],
|
58
58
|
"str (1MB)" => ['a' * 1024*1024],
|
59
59
|
"str (100MB)" => ['a' * 100*1024*1024],
|
60
|
-
"map 32" =>
|
60
|
+
"map 32" => map32,
|
61
61
|
"array 32" => Array.new(0x10000,0),
|
62
62
|
}.each { |key, value|
|
63
63
|
json_asciipack key, value
|