Reduce memory consumption of two ranges tests - #2657
Stephan T. Lavavej (StephanTLavavej) merged 3 commits into
Conversation
By making the stateful lambda a namespace-scope function object (at the suggestion of the FE team) and reducing the combinatorics of the test matrix of range properties.
Michael Schellenberger Costa (miscco)
left a comment
There was a problem hiding this comment.
Thanks a lot, i started to also rely more on struct these days
Where? 👀 |
Charlie Barto (barcharcraz)
left a comment
There was a problem hiding this comment.
How much time/mem does the struct conversion alone save? Without running only "interesting" specializations?
|
I have pushed a trivial change to remove unnecessary |
I believe that this is happening, not in the |
The body of STL/tests/std/include/range_algorithm_support.hpp Lines 1295 to 1298 in 0349ce1 generates calls to STL/tests/std/include/range_algorithm_support.hpp Lines 1047 to 1086 in 0349ce1 and "all variations of writable iterator properties" (about 15 cases): STL/tests/std/include/range_algorithm_support.hpp Lines 898 to 904 in 0349ce1 for a total of |
I only measured
This further reduced total runtime down to about 2.5 seconds. |
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
|
Thanks for dramatically improving the resource consumption of these tests! 🐱 🎉 📉 |
|
How could this lambda cause this extensive memory consumption? |
Every time when we instantiate the function, we create a new stateful lambda. And we instantiate that function a ton |
By making the stateful lambda a namespace-scope function object (at the suggestion of the FE team) and reducing the combinatorics of the test matrix of range properties.