Comment 4 for bug 784606

Revision history for this message
Mathieu Bastian (mathieu.bastian) wrote :

Fix in rev 2336.

I made some significant changes:

1. I merged the ADD_NODES and ADD_EDGES event, as well as the REMOVE_NODES and REMOVE_EDGES. Therefore, a ADD_NODES_AND_EDGES can contains both nodes (accessible from addedNodes()) and edges (accessible from addedEdges()). Though this change is breaking the API compatibility, I think it make sense and should be an easy change for API users. That modification allows to dramatically reduce the number of events. When receiving a ADD_NODES_AND_EDGES event, API user should test if the addedNodes() or addedEdges() array are null before proceed.

2. I revised the EventQueueManager class and improved the way events are queued and dispatched. The manager now properly tune it's own event rate so the number of events in the queue should be stable. In other words if the queue becomes very loaded, the manager will speed-up and fires more events until the queue is empty again. I did some profiling and the new strategy seems to keep memory usage stable and use less CPU.

André would you mind test with your example?