Open-EO / openeo-earthengine-driver

openEO back-end driver for Google Earth Engine.
Apache License 2.0
21 stars 7 forks source link

Broadcasting performance may be low #6

Closed christophfriedrich closed 4 years ago

christophfriedrich commented 6 years ago

If we keep the way subscriptions are currently stored (which is: per user and then per topic+parameter hash) it is necessary to loop through all users and check whether they subscribed to the topic+parameter in order to broadcast a message concerning that topic+parameter. This may be slow if there are many open connections.

If it was the other way round (i.e. having a Map of topic+parameter hash to a list of all subscribers) the need for this search would be eliminated.

On the other hand this would mean that we would have to loop through all topic+parameter settings to remove the user's subscriptions once the connection is closed.

So it's a trade-off between the two operations broadcast vs. close connection. I think the first case (broadcasting messages) will happen more often, so the subscriptions storage should be organised by topic+parameter to improve overall performance.

Thoughts?

m-mohr commented 4 years ago

Closing as subscriptions are not part of the API any longer.