Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^5: Serialise to binary?

by xdg (Monsignor)
on Nov 04, 2015 at 14:51 UTC ( #1146907=note: print w/replies, xml ) Need Help??

in reply to Re^4: Serialise to binary?
in thread Serialise to binary?

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.)


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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1146907]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2020-07-10 13:02 GMT
Find Nodes?
    Voting Booth?

    No recent polls found