-
Notifications
You must be signed in to change notification settings - Fork 1.6k
enhancements for <filesystem>
#3850
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
Changes from all commits
799099e
13bdc66
eaa143f
0a1a255
0693958
db751a5
6264009
9b90aec
37a0393
c93c0c5
c5ed88c
04ee85d
f948375
a81598e
74f2aa8
9e58b1d
9f89fe9
fef6883
df24c8d
dac591c
753f9b6
426b64e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
#include <benchmark/benchmark.h> | ||
#include <filesystem> | ||
#include <string_view> | ||
|
||
namespace { | ||
void BM_lexically_normal(benchmark::State& state) { | ||
using namespace std::literals; | ||
static constexpr std::wstring_view args[5]{ | ||
LR"(X:DriveRelative)"sv, | ||
LR"(\\server\\\share)"sv, | ||
LR"(STL/.github/workflows/../..)"sv, | ||
LR"(C:\Program Files\Azure Data Studio\resources\app\extensions\bat\snippets\batchfile.code-snippets)"sv, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it better to replace these two test cases with more generic ones? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems fine to me since it's a realistic Microsoft path. If it were from some other program then I'd request a generic meow-style example. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, it is a real path in my computer. for (I'm not sure whether I can make pushes to ready-to-merge prs) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you want to add more tests, it's probably better to do it in a new PR to not reset the review process. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Generally, when a PR has been moved to Ready To Merge, changes should only be pushed when they're big enough to be worth it (fixing bugs or major omissions), or they're small enough to be unquestionably safe like comment typo fixes. You should ping the maintainers who approved, on GitHub and/or Discord, so they notice and can take another look. Basically, we maintainers love doing work, but we want to focus it on necessary work that keeps PRs flowing and the codebase moving forward. We try to minimize avoidable work, so we prefer to avoid scenarios like:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hm, thanks for clarification 👀 |
||
LR"(/\server/\share/\a/\b/\c/\./\./\d/\../\../\../\../\../\../\../\other/x/y/z/.././..\meow.txt)"sv, | ||
}; | ||
|
||
const auto index = state.range(0); | ||
const std::filesystem::path p(args[index]); | ||
for (auto _ : state) { | ||
benchmark::DoNotOptimize(p.lexically_normal()); | ||
} | ||
} | ||
} // namespace | ||
|
||
BENCHMARK(BM_lexically_normal)->DenseRange(0, 4, 1); | ||
|
||
BENCHMARK_MAIN(); |
Uh oh!
There was an error while loading. Please reload this page.