Bugzilla – Bug 87
EventGarbageCollector is a performance bottleneck
Last modified: 2007-10-11 12:41:39 UTC
... and I'm the one to blame for this :-/
Created attachment 75 [details] screenshot of sysprof
Created attachment 76 [details] sysprof profile after patch
Created attachment 79 [details] patch
The comment for the previous patch is: EventGarbageCollector was never supposed to be a singleton. And in fact making it a regular member of Timer makes its performance much much better. The reason is probably that this way we get many EventGarbageCollector instances, but each with a smaller event list. We can see in the profile (previous attachment) that now EventGarbageCollector::Track is now significantly less a performance bottleneck.
Created attachment 81 [details] test patch (debugging bugzilla-- please ignore this patch) Optional comment provided with the test patch
> EventGarbageCollector was never supposed to be a singleton. And in fact making > it a regular member of Timer makes its performance much much better. The > reason is probably that this way we get many EventGarbageCollector instances, > but each with a smaller event list. Yes, this is quite true. But we cannot really add an EventGarbageCollector instance per Timer: it would be a bit overkill. Instead, we could remove this feature from Timer and ask our users to use the EventGarbageCollector separately. I have done just that in ns-3-dev. I leave the rest of the optimization problems to you.
OK, I optimized this using list (actually multiset) sorted by time; got a 27% improvement in my OLSR simulation script, and now EventGarbageCollector is nowhere to be found in sysprof ;-) It's in the OLSR tree: http://code.nsnam.org/gjc/ns-3-olsr/rev/0ca4a39dca8b