Speeding up importing Phobos files
Vladimir Panteleev
thecybershadow.lists at gmail.com
Mon Jan 21 19:10:11 UTC 2019
On Monday, 21 January 2019 at 19:01:57 UTC, Steven Schveighoffer
wrote:
> I still find it difficult to believe that calling exists x4 is
> a huge culprit. But certainly, caching a directory structure is
> going to be more efficient than reading it every time.
For large directories, opendir+readdir, especially with stat, is
much slower than open/access. Most filesystems already use a hash
table or equivalent, so looking up a known file name is faster
because it's a hash table lookup.
This whole endeavor generally seems like poorly reimplementing
what the OS should already be doing.
More information about the Digitalmars-d
mailing list