-
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
<filesystem>
: Preallocate memory in path::operator/
#4136
Conversation
Now, in the typical case, it will do at most a single allocation. It's a hot path in my program, and a cursory GitHub search showed that path::operator/ is indeed commonly used.
@microsoft-github-policy-service agree |
Co-authored-by: Casey Carter <[email protected]>
We're talking about something in the future that we want to avoid doing, instead of something in the past that we avoided doing.
This doesn't exercise the optimization, it's just a good idea.
With this, I believe all codepaths are exercised.
Thank you! 😻 Apologies for the (somewhat holiday-related) delay in getting this reviewed. I've pushed a conflict-free merge with We have a semi-manual process for simultaneously merging PRs to the GitHub and MSVC-internal repos. To save time, we batch up PRs, so your PR will be part of the next batch (possibly tomorrow but more likely next week). |
Sorry for ignoring the review comments, I got busy with other stuff and then I forgot about this PR.
Thank you! |
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for optimizing this important function, and congratulations on your first microsoft/STL commit! 🚀 😻 🎉 This is expected to ship in VS 2022 17.10 Preview 2. |
Now, in the typical case, it will do at most a single allocation.
It's a hot path in my program, and a cursory GitHub search showed that
path::operator/
is indeed commonly used.