STL
STL copied to clipboard
`<filesystem>`: Preallocate memory in `path::operator/`
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
Thank you! :heart_eyes_cat: Apologies for the (somewhat holiday-related) delay in getting this reviewed. I've pushed a conflict-free merge with main, followed by changes to address previous feedback, followed by changes for things I noticed, including test coverage. The logic looks solid (the only thing that needed a small patch was _Right being empty, and even that was probably technically well-defined due to basic_string null termination) - I really appreciate how you handled the strange corner cases.
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.
I've pushed a conflict-free merge with main, followed by changes to address previous feedback, followed by changes for things I noticed, including test coverage.
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! :rocket: :heart_eyes_cat: :tada:
This is expected to ship in VS 2022 17.10 Preview 2.