by programminggeek · 12y ago · 0 comments
Essentially I already have a giant precalculation service for all the needed calculations on all the data underneath a parent entity. So, I serialize that using ruby marshall and then use lz4 to compress it before storing to db.
Its actually faster and smaller than using json strings in ruby. The whole tree structure for each entity was 200-400k as raw json strings. It took something like 300ms to serialize to json. I was able to do the ruby marshal and the LZ4 HC compression in something like 20-40ms and it drops the size down to more like 15-30k.
JSON is a pretty cool format, but it's a lot slower in ruby than you might realize and it takes up a lot of space.
I didn't think about the size before compression.
Meanwhile, this serves well for Python: https://groups.google.com/forum/#!topic/google-appengine/WPf...
I shall go ahead and write some tests to see how much space will be taken up :)