Opened 11 years ago
Last modified 5 years ago
#1860 new enhancement
[PATCH] Use a vector for iterating in the ComponentManager — at Version 3
Reported by: | sbte | Owned by: | |
---|---|---|---|
Priority: | Should Have | Milestone: | Backlog |
Component: | Simulation | Keywords: | patch |
Cc: | Patch: |
Description (last modified by )
Using a vector in the ComponentManager instead of a map speeds up iterating considerably. It gives me a speedup of 4ms in Gambia River (14ms->10ms) for the sim interpolation. This, however, is not the only place where the code is called, so the overall speedup might be bigger.
The downside is that you have to keep both a map and a vector of the Components, but since those are just pointers, I don't think it is a problem.
(I edited the description for the vector version of the patch. This is much faster than the list version.)
Change History (5)
by , 11 years ago
Attachment: | 0003-Iterate-over-a-list-instead-of-a-map-in-the-Componen.patch added |
---|
comment:2 by , 11 years ago
I just did some profiling, and found out that a vector is a lot faster than a list, even though I thought otherwise. I'll fix my patch.
Edit: The vector version gives a speedup of 14ms -> 10ms. MUCH faster that is
by , 11 years ago
Attachment: | 0001-Iterate-over-a-vector-instead-of-a-map-in-the-Compon.patch added |
---|
comment:3 by , 11 years ago
Description: | modified (diff) |
---|---|
Summary: | [PATCH] Use a list for iterating in the ComponentManager → [PATCH] Use a vector for iterating in the ComponentManager |
I've been playing with that patch (modified the Vec to List in the variable names) and I haven't encountered anything to indicate it could be failing. Not sure about the speedup, but there is no reason why this wouldn't speed things up slightly.
Edit: Should test MP with that though.