Speeding up importing Phobos files

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Jan 21 19:42:57 UTC 2019


On Mon, Jan 21, 2019 at 07:10:11PM +0000, Vladimir Panteleev via Digitalmars-d wrote:
> 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.

I can't help wondering why we're making so much noise about a few
milliseconds on opening/reading import files, when there's the elephant
in the room of the 3-5 *seconds* of compile-time added by the mere act
of using a single instance of std.regex.Regex.

Shouldn't we be doing something about that first??


T

-- 
Verbing weirds language. -- Calvin (& Hobbes)


More information about the Digitalmars-d mailing list