-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
optimize std.fs.Dir.makeOpenPath for the case that the path already exists #12474
Labels
contributor friendly
This issue is limited in scope and/or knowledge of Zig internals.
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
optimization
standard library
This issue involves writing Zig code for the standard library.
Milestone
Comments
andrewrk
added
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
contributor friendly
This issue is limited in scope and/or knowledge of Zig internals.
optimization
standard library
This issue involves writing Zig code for the standard library.
labels
Aug 18, 2022
joedavis
added a commit
to joedavis/zig
that referenced
this issue
Aug 18, 2022
…xists Uses a single NtCreateFile syscall on windows. Resolves ziglang#12474
joedavis
added a commit
to joedavis/zig
that referenced
this issue
Aug 18, 2022
…xists Uses a single NtCreateFile syscall on windows. Resolves ziglang#12474
joedavis
added a commit
to joedavis/zig
that referenced
this issue
Aug 18, 2022
…xists Uses a single NtCreateFile syscall on windows. Resolves ziglang#12474
nice |
matu3ba
pushed a commit
to matu3ba/zig
that referenced
this issue
Dec 8, 2022
Uses a single NtCreateFile syscall on windows. Closes ziglang#12474. Thanks to @joedavis for the PR.
matu3ba
pushed a commit
to matu3ba/zig
that referenced
this issue
Dec 8, 2022
Uses a single NtCreateFile syscall on windows. Closes ziglang#12474. Thanks to @joedavis for the PR.
matu3ba
pushed a commit
to matu3ba/zig
that referenced
this issue
Dec 8, 2022
Uses a single NtCreateFile syscall on windows. Closes ziglang#12474. Thanks to @joedavis for the PR.
matu3ba
pushed a commit
to matu3ba/zig
that referenced
this issue
Dec 8, 2022
Uses a single NtCreateFile syscall on windows. Closes ziglang#12474. Thanks to @joedavis for the PR.
matu3ba
pushed a commit
to matu3ba/zig
that referenced
this issue
Dec 10, 2022
Uses a single NtCreateFile syscall on windows. Closes ziglang#12474. Thanks to @joedavis for the PR.
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Mar 4, 2023
…y exists Uses a single NtCreateFile syscall on windows. Closes ziglang#12474. Thanks to @joedavis and @matu3ba.
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Mar 5, 2023
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Mar 6, 2023
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Mar 7, 2023
…y exists Uses a single NtCreateFile syscall on windows. Closes ziglang#12474. Thanks to @joedavis and @matu3ba.
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Mar 7, 2023
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Mar 7, 2023
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Mar 10, 2023
…y exists Uses a single NtCreateFile syscall on windows. Closes ziglang#12474. Thanks to @joedavis and @matu3ba.
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Mar 10, 2023
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Mar 10, 2023
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Mar 10, 2023
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Mar 10, 2023
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Mar 10, 2023
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Mar 10, 2023
andrewrk
pushed a commit
to QusaiHroub/zig
that referenced
this issue
Jun 18, 2023
andrewrk
pushed a commit
to QusaiHroub/zig
that referenced
this issue
Jun 18, 2023
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Jun 19, 2023
…case See this discussion ziglang#14833 (comment) for more Info
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Jun 19, 2023
…y exists Uses a single NtCreateFile syscall on windows. Closes ziglang#12474. Thanks to @joedavis and @matu3ba.
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Jun 19, 2023
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Jun 19, 2023
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Jun 19, 2023
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Jun 19, 2023
…case See this discussion ziglang#14833 (comment) for more Info
squeek502
pushed a commit
to squeek502/zig
that referenced
this issue
Jul 27, 2023
…y exists Uses a single NtCreateFile syscall on windows. Closes ziglang#12474. Thanks to @joedavis and @matu3ba.
squeek502
pushed a commit
to squeek502/zig
that referenced
this issue
Jul 27, 2023
squeek502
pushed a commit
to squeek502/zig
that referenced
this issue
Jul 27, 2023
squeek502
pushed a commit
to squeek502/zig
that referenced
this issue
Jul 27, 2023
squeek502
pushed a commit
to squeek502/zig
that referenced
this issue
Jul 27, 2023
…case See this discussion ziglang#14833 (comment) for more Info
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Jul 28, 2023
…y exists Uses a single NtCreateFile syscall on windows. Closes ziglang#12474. Thanks to @joedavis and @matu3ba.
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Jul 28, 2023
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Jul 28, 2023
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Jul 28, 2023
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Jul 28, 2023
…case See this discussion ziglang#14833 (comment) for more Info
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Jul 28, 2023
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Aug 3, 2023
…y exists Uses a single NtCreateFile syscall on windows. Closes ziglang#12474. Thanks to @joedavis and @matu3ba.
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Aug 3, 2023
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Aug 3, 2023
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Aug 3, 2023
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Aug 3, 2023
…case See this discussion ziglang#14833 (comment) for more Info
QusaiHroub
added a commit
to QusaiHroub/zig
that referenced
this issue
Aug 3, 2023
andrewrk
pushed a commit
to QusaiHroub/zig
that referenced
this issue
Oct 19, 2023
Uses a single NtCreateFile syscall on windows. Closes ziglang#12474. Thanks to @joedavis and @matu3ba.
andrewrk
added a commit
that referenced
this issue
Oct 22, 2023
…nPath_12474 #12474: std.fs.Dir.makeOpenPath: optimize case, if path already exists
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
contributor friendly
This issue is limited in scope and/or knowledge of Zig internals.
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
optimization
standard library
This issue involves writing Zig code for the standard library.
Current implementation:
zig/lib/std/fs.zig
Lines 1406 to 1413 in 79757f2
Typically, something like this will happen:
We can optimize for the common case by first attempting the openat() and then falling back to mkdirat() if we get ENOENT. This will make the common case one syscall instead of two.
As a bonus, consider solving the TODO above as well regarding Windows. NtCreateFile is capable of creating and opening a directory with a single call.
The text was updated successfully, but these errors were encountered: