Page MenuHomePhabricator

Pre-serialize array to JSON before saving into cache
Open, Needs TriagePublic


Pre-serializing to a JSON string should be even more space efficient than the normal PHP serialization syntax for arrays. No idea about whether it is significantly slower or faster. A good thing would be that we wouldn't accidentally serialize objects, as they would not round-trip. This might shave of a 7-10 characters for every page (in-case of wikipage), which in turn will further the amount of time after which we have to re-look at this issue. Similarly we would see an improvement in the size of AggregateMessageGroup which are stored as an array in the cache.

I found this StackOverflow thread and this test on that goes into some performance related concerns that we might have.