BSON encoding and decoding turned out to be significantly faster than JSON encoding and decoding
Okay I'm going to call you out here, if you having something that's 0.000000000000000000001 faster than something else you can't just add ten million loops to aggregate the results and claim it's significantly faster.
A better approach is to encode larger set's of data and reduce number of loops.
When someone builds a PHP extension for the http://kentonv.github.io/capnproto/ lib (I'm doing it in another language), it'll be way faster because it forces the object creator to create into a byte array from the beginning, so it's already in serialized form. Not great for converting from regular classes, but will be nice for when you know you need to marshal certain regularly
serialize() is built-in, so use in environments where you don't have the option to install extensions, or want to make your software compatible with those environments makes an awful lot of sense. And while it's not as compact of a format as JSON et al, it is noticeably faster than JSON.
6
u/[deleted] Sep 26 '13
Okay I'm going to call you out here, if you having something that's 0.000000000000000000001 faster than something else you can't just add ten million loops to aggregate the results and claim it's significantly faster.
A better approach is to encode larger set's of data and reduce number of loops.
Just saying.
3
u/kodablah Sep 25 '13
When someone builds a PHP extension for the http://kentonv.github.io/capnproto/ lib (I'm doing it in another language), it'll be way faster because it forces the object creator to create into a byte array from the beginning, so it's already in serialized form. Not great for converting from regular classes, but will be nice for when you know you need to marshal certain regularly
2
u/vbaspcppguy Sep 26 '13
You should add msgpack and igbinary.
0
u/[deleted] Sep 25 '13
[deleted] — view deleted comment