Sharing data between callbacks

The slow performance is not (only) due to the serialization to JSON, in most cases it’s mainly due to the transfer of data between the server and the client. You can avoid it all by caching the data on the server. I made a small library to ease the pain,

but you could also implement the caching manually.