Hello!
On Tue, Jul 12, 2016 at 4:00 AM, RJoshi wrote:
> I am using cjson library for de/serialization. Recently replaced it with
> msgpack which improved performance and reduced the size but still looking
> for better performance alternatives.
>
Maybe you should consider avoiding serialization/de-serialization on
your hot code paths altogether by caching your Lua data structure
directly with in-VM caches like lua-resty-lrucache. Out-of-VM caches
like lua_shared_dict or even external services like memcached or redis
should only be serve as a secondary cache layer, which can stay out of
the hot code paths.
We did this a lot in our Lua CDN and we no longer bother finding a
faster serialization/de-serialization method since it's barely visible
in our online flame graphs.
Regards,
-agentzh