I need to serialize moderately complex objects with 1-100's of mixed
JSON was used originally, then I switched to BSON which is marginally
Encoding 10000 sample objects (V8 3.3.10)
I want an order of magnitude increase; it is having a ridiculously bad
impact on the rest of the system.
Part of the motivation to move to BSON is the requirement to encode
binary data (BinaryF), so JSON is (now) unsuitable.
Profiled BSON performance hot-spots
- (unavoidable?) conversion of UTF16 V8 JS strings to UTF8.
- malloc and string ops inside the BSON library
The BSON encoder is based on the Mongo BSON library.
A native V8 binary serializer might be wonderful, yet as JSON is
native and quick to serialize I fear even that might not provide the
answer. Perhaps my best bet is to optimize the heck out of the BSON
library or write my own plus figure out far more efficient way to pull
strings out of V8. One tactic might be to add UTF16 support to BSON to
skip that step.
Is there anyway to use the snapshot serializer for this purpose? Would
it even approach the performance I'm looking for.
Is it feasible to cache string conversion results using the object
Any other ideas?