intelvwi / DSG

Distributed Scene Graph
20 stars 13 forks source link

TODO: Performance optimization in sending DSG sync messages #12

Open kittyfly opened 11 years ago

kittyfly commented 11 years ago

In our current implemenation, at each heart beat, a thread goes through the queued list of updated objects, figure out the properties that have changed, encode the updated properties into a message and insert them into an outQueue to be send out for synchronization.

The problem is, the message may be queued for a while under heavyload. By the time it is to sent out, it is possible that the same object whose updates encoded in the message has new updates (hence another message might be inserted into the queue as well). In such a case, the message is already out-dated -- the newest updates of the same object should be sent, not the stale information encoded in this message.

The algorithm should be updated such that the message encoding won't happen until the wire is clear (e.g. tokens avaible). Then the most recent values of the object's updated properties are encoded and sent out.

This might not be the highest priority task for now, but needs to be fixed down the road.