Closed mef closed 7 years ago
cc @11digitlabs
The way I see it is for the server to calculate / sort and emit an event with only the necessary data everytime we have a new tweet.
Otherwise, we cannot do it on the client without the full set of data. Reasoning why:
Comments, thoughts are welcome ;)
After measuring the performance of current implementation, the poor performance is not caused by heavy computation on client, neither on server side, but by the volume of data transmitted to the client. For Belgium, objects with approx 5000 keys for hashtags, and 5000 keys for mentions is sent to the client.
On the client, it takes the following time to update the data:
As @11digitlabs suggested, stats should be updated on the server and only the top trends data sent to the client.
top hashtags / mentions take several seconds to get computed, before each visitor's page load.
refactoring is needed to fix this design flaw.