classification
Title: See if os.scandir() could help speed up importlib
Type: enhancement Stage: needs patch
Components: Interpreter Core Versions: Python 3.5
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: brett.cannon
Priority: low Keywords:

Created on 2015-03-10 14:41 by brett.cannon, last changed 2015-03-13 17:25 by brett.cannon. This issue is now closed.

Messages (2)
msg237771 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2015-03-10 14:41
With os.scandir() now committed and implemented in C, it would be interesting to see if os.scandir() could provide any performance benefit to importlib. If finders can pass the DirEntry to loaders then some stat calls could potentially be saved at the expense of stale file metadata.

Even if the performance is flat and the sharing of cached information is deemed not worth it, os.scandir() might still be beneficial by ditching some custom code in importlib that exists purely to replicate Python code from os.py, like _path_isfile().
msg238041 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2015-03-13 17:25
The answer is no.
History
Date User Action Args
2015-03-13 17:25:56brett.cannonsetstatus: open -> closed
resolution: rejected
messages: + msg238041
2015-03-10 14:41:42brett.cannoncreate