libc: glob is making gnu make horribly slow
|Reported by:||bird||Owned by:||bird|
This is what GNU make is doing extremely much of (at least in the kBuild case):
glob("somefile-but-no-wildcard", GLOB_NOCHECK|GLOB_ALTDIRFUNC, NULL, &gl)
If possible glob should not convert this to it's internal 64-bit character strings, and then backagain to multibyte strings in order to do lstat() on the string. It should simply check that there are no wildcards (*?) and return shortest path. I just did this form the GNU make (kmk) code now, and reduced the time it took to figure out that libc.a was built and nothing had to be done from 32 seconds to 5.6 seconds
Other glob() implementations should be considered or at least consulted. We're currently using one from about FreeBSD 5.3 I think.