-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce memory consumption of two ranges tests #2657
Reduce memory consumption of two ranges tests #2657
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot, i started to also rely more on struct these days
Where? 👀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.