Skip to content

Make os.DirEntry.is_symlink ~twice as fast #108985

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

Closed
sobolevn opened this issue Sep 6, 2023 · 1 comment
Closed

Make os.DirEntry.is_symlink ~twice as fast #108985

sobolevn opened this issue Sep 6, 2023 · 1 comment
Assignees
Labels
extension-modules C modules in the Modules dir performance Performance or resource usage

Comments

@sobolevn
Copy link
Member

sobolevn commented Sep 6, 2023

While fixing a merge conflict in #108718 I've noticed that I've missed the same problem in os.DirEntry.is_symlink.

I will send a new PR since the original one was already merged

Refs #108717

Linked PRs

@sobolevn sobolevn added performance Performance or resource usage extension-modules C modules in the Modules dir labels Sep 6, 2023
@sobolevn sobolevn self-assigned this Sep 6, 2023
sobolevn added a commit to sobolevn/cpython that referenced this issue Sep 6, 2023
@sobolevn
Copy link
Member Author

sobolevn commented Sep 6, 2023

False alarm:

#elif defined(HAVE_DIRENT_D_TYPE)
    /* POSIX */
    if (self->d_type != DT_UNKNOWN)
        return self->d_type == DT_LNK;
    else
        return DirEntry_test_mode(defining_class, self, 0, S_IFLNK);
#else
    /* POSIX without d_type */
    return DirEntry_test_mode(defining_class, self, 0, S_IFLNK);
#endif

@sobolevn sobolevn closed this as not planned Won't fix, can't repro, duplicate, stale Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir performance Performance or resource usage
Projects
None yet
Development

No branches or pull requests

1 participant