Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"Best" is a subjective value judgement here. Difference scenarios call for different strategies.

Once upon a time, I had to write a serializer that was expected to be run hundreds or thousands of times a second, once for every request in an AJAX app. The solution I chose was to not serialize at all; always keep the data in a binary blob (a byte array) and write a facade of ephemeral objects on top of it, essentially containing nothing more than their offsets into the blob. Because the ratio of read/write operations to serialization operations was so low, this made a lot more sense than building an object graph, only to throw it away a millisecond or two later.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: