https://github.com/python/cpython
Revision abfa16b44bb9426312613893b6e193b02ee0304f authored by Barney Gale on 05 April 2024, 12:35:01 UTC, committed by GitHub on 05 April 2024, 12:35:01 UTC
Apply the following optimizations to `posixpath.realpath()`:

- Remove use of recursion
- Construct child paths directly rather than using `join()`
- Use `os.getcwd[b]()` rather than `abspath()`
- Use `startswith(sep)` rather than `isabs()`
- Use slicing rather than `split()`

Co-authored-by: Petr Viktorin <encukou@gmail.com>
1 parent 9ceaee7
History
Tip revision: abfa16b44bb9426312613893b6e193b02ee0304f authored by Barney Gale on 05 April 2024, 12:35:01 UTC
GH-114847: Speed up `posixpath.realpath()` (#114848)
Tip revision: abfa16b
File Mode Size
.azure-pipelines
.devcontainer
.github
Android
Doc
Grammar
Include
Lib
Mac
Misc
Modules
Objects
PC
PCbuild
Parser
Programs
Python
Tools
iOS
.coveragerc -rw-r--r-- 526 bytes
.editorconfig -rw-r--r-- 214 bytes
.gitattributes -rw-r--r-- 3.9 KB
.gitignore -rw-r--r-- 3.1 KB
.mailmap -rw-r--r-- 175 bytes
.pre-commit-config.yaml -rw-r--r-- 1.1 KB
.readthedocs.yml -rw-r--r-- 1014 bytes
LICENSE -rw-r--r-- 13.5 KB
Makefile.pre.in -rw-r--r-- 117.1 KB
README.rst -rw-r--r-- 8.6 KB
aclocal.m4 -rw-r--r-- 23.7 KB
config.guess -rwxr-xr-x 48.2 KB
config.sub -rwxr-xr-x 36.1 KB
configure -rwxr-xr-x 857.2 KB
configure.ac -rw-r--r-- 239.3 KB
install-sh -rwxr-xr-x 15.0 KB
pyconfig.h.in -rw-r--r-- 53.5 KB

README.rst

back to top