![]() In my testing on Windows, normalize_path() overwhelmingly spent its time calling realpath(). All but one of these were redundant, because is_local() calls normalize_path(sys.prefix), and sys.prefix shouldn't be changing while executing an uninstall. ~1500 were from calls to UninstallPathSet._permitted(), which calls is_local().Since the vast majority of directories have several files in them, this meant we were repeating the path normalization of the "head" portion of the path. ~2500 were in calls to UninstallPathSet.add(), when normalizing the "head" of a file path.When using pip's uninstall, either via pip uninstall or pip install -force-reinstall, I found that UninstallPathSet was generating thousands of calls to normalize_path(), the vast majority of which are being called on identical paths.įor instance, when running pip install -force-reinstall -no-deps.
0 Comments
Leave a Reply. |