On 20 July 2017 at 21:43, Skip Montanaro wrote:
> scandir returns an iterator of DirEntry objects which contain more
> > information than the mere name.
> >
>
> As I recall, the motivation for scandir was to avoid subsequent system
> calls, so it will be slower than listdir the way you've tested
On Thu, 20 Jul 2017 03:33 pm, Torsten Bronger wrote:
> Hallöchen!
>
> With a 24,000 files directory on an SSD running Ubuntu,
>
> #!/usr/bin/python3
>
> import os, time
>
>
> start = time.time()
> list(os.listdir("/home/bronger/.saves"))
> print("listdir:", time.time() - s
scandir returns an iterator of DirEntry objects which contain more
> information than the mere name.
>
As I recall, the motivation for scandir was to avoid subsequent system
calls, so it will be slower than listdir the way you've tested it. If you
add in the cost of fetching the other bits Terry m
On 7/20/2017 1:33 AM, Torsten Bronger wrote:
Hallöchen!
With a 24,000 files directory on an SSD running Ubuntu,
#!/usr/bin/python3
import os, time
start = time.time()
list(os.listdir("/home/bronger/.saves"))
listdir returns a list of na
print("listdir:", time.tim
Hallöchen!
With a 24,000 files directory on an SSD running Ubuntu,
#!/usr/bin/python3
import os, time
start = time.time()
list(os.listdir("/home/bronger/.saves"))
print("listdir:", time.time() - start)
start = time.time()
list(os.scandir("/home/bronger/.saves"))