[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master 11cf3e9: Implement a new function directory-fil

From: Lars Magne Ingebrigtsen
Subject: Re: [Emacs-diffs] master 11cf3e9: Implement a new function directory-files-recursively
Date: Sat, 13 Dec 2014 15:42:53 +0100
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

Thierry Volpiatto <address@hidden> writes:

> I am not sure the speed is 10X faster vs directory-files, especially
> when sorting the resulting list of `file-name-all-completions'.

I benchmarked a bit with

# for i in `seq 1 3`; do echo $i > /proc/sys/vm/drop_caches; done

in between each run to flush the cache.  This is on a machine with an

`file-name-all-completions' version:

(benchmark-run 1 (length (directory-files-recursively "~/" "ChangeLog")))
=> (38.707872137 204 2.599332819999997)

`directory-files' + `file-directory-p' version:

(benchmark-run 1 (length (directory-files-recursively-dir "~/" "ChangeLog")))
=> (89.957997652 1483 25.952981247000064)

So it's faster.  The difference is probably more significant on a
mechanical disk.

(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

reply via email to

[Prev in Thread] Current Thread [Next in Thread]