Mango-information-systems / twitto_be

twitto_be is a real-time tweets analytics dashboard
https://twitto.be
Other
12 stars 2 forks source link

bad performance for top trends #117

Closed mef closed 7 years ago

mef commented 7 years ago

top hashtags / mentions take several seconds to get computed, before each visitor's page load.

refactoring is needed to fix this design flaw.

mef commented 7 years ago

cc @11digitlabs

PanosSynetos commented 7 years ago

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 ;)

mef commented 7 years ago

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.