My goal is to serialize JavaScript native datatypes for storage into an SQLite database. I'm doing this within a Firefox extension, and so I have access to the Mozilla platform XPCOM api. Initially I was thinking that the easiest thing to do would be to just store JSON strings.
However, if there is a way to serialize native datatypes within the Mozilla platform, I'd like to know where I can find it. And if this is possible, what storage space savings can I expect for the extra work (if any) and would there be a performance cost vs JSON?
Of course, the gains of storing data in a binary format may not outweigh the ease of simply using JSON. Any suggestions?