Merge links into nodes: Fix performance regression topological node output - #1556
Conversation
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
|
@marhofmann would you be able to run the benchmark to see if this fixes the issue for you as well? |
|
@mgovers Thanks and I am glad it was useful! I'm benchmarking your version now. I had the same fix in mind, but it drops call_count from 2 to 1 and means removing the recorded_edges[1] / recorded_loads[1] assertions. Those looked deliberate and I couldn't tell whether they were guarding something I was overlooking. Good to see you've made the same call. |
Hi @marhofmann, thanks! I already sent it to merge queue to get it out quickly, but feel free to reply once you have the numbers! Indeed the calls were deliberate and that also amounts to my comment in #1556 (comment) |
@mgovers Benchmarked it:
Whole batch run 4.24 s → 2.30 s. The remaining ~1.9× above pre-#1536 looks like the extra per-node vectors, so that should line up with what you expect from #1555. |



Fixes #1554
Relates to #1555
There are potentially some other locations remaining where SmallVector can make a difference (in particular, topological node construction on the input side and the vectors internally in the link solver implementation), but for that, #1555 needs to be merged first. This fix is standalone. Instead, this PR fixes on the big fish.
Credits to @marhofmann for finding the issue.