|
Bugzilla – Full Text Bug Listing |
| Summary: | EventGarbageCollector is a performance bottleneck | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Gustavo J. A. M. Carneiro <gjcarneiro> |
| Component: | core | Assignee: | ns-bugs <ns-bugs> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | pre-release | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
screenshot of sysprof
sysprof profile after patch patch test patch (debugging bugzilla-- please ignore this patch) |
||
|
Description
Gustavo J. A. M. Carneiro
2007-10-10 10:52:41 UTC
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 |