![]() |
|
We don't bite newbies here... much | |
PerlMonks |
Re^5: Serialise to binary?by xdg (Monsignor) |
on Nov 04, 2015 at 14:51 UTC ( #1146907=note: print w/replies, xml ) | Need Help?? |
Wrapping an array in a hash adds some mild overhead, but otherwise should work. Unfortunately, for historical reasons, the spec for arrays in BSON is horribly inefficient (index-value pairs!) so I would not recommend it for storing large arrays. I have been considering supporting a TO_BSON method (or even just using TO_JSON, but don't want to do that until I have a broader think about the general case of mappings to and from BSON. (If you think about how JSON::XS is using Types::Serialiser, you can see the general case problem.) -xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
In Section
Seekers of Perl Wisdom
|
|