Implement Factory#pool - #266
Conversation
138a184 to
108d343
Compare
|
As always I forgot to check JRuby was passing. It should be fixed now. |
108d343 to
8298759
Compare
| FACTORY(self, fc); | ||
|
|
||
| if (RTEST(fc->pkrg.hash)) { | ||
| rb_hash_freeze(fc->pkrg.hash); |
There was a problem hiding this comment.
I squeezed an extra optimization here. When we freeze the factory, the types registry hash gets frozen as well. This way all packers can share it safely.
8298759 to
65e4cc7
Compare
tagomoris
left a comment
There was a problem hiding this comment.
The implementation looks good to me.
The name PooledFactory looks misleading. That name looks to mean to pool Factory instances, not Packers nor Unpackers.
I don't have any good idea though...
c27668d to
5f66b4a
Compare
|
All comments addressed I think. As for |
|
How about |
Fix: msgpack#255 When handling small payload creating the Packer and Unpacker instance can easily account for the majority of the serialization and deserialization time. For this reason it is recommanded to reuse these objects, and `Factory#pool` is a helper for that.
5f66b4a to
5f9e9f4
Compare
Done. Also since the class isn't that big I moved it inside |
|
LGTM. Thank you! |
Fix: #255
When handling small payload creating the Packer and Unpacker
instance can easily account for the majority of the serialization
and deserialization time.
For this reason it is recommended to reuse these objects, and
Factory#poolis a helper for that.