about 20% of the total time is taken up in wcs2string, much of that coming from universal_barrier() (which is triggered here because it's an external command - this does not happen with builtin true).
And that does wcs2string because it is narrowing the uvar path, again and again and again, even though it stays the same 99.999% of the time.
I propose we cache the narrow versions of these kinds of paths - we still need the wide version for output. Unfortunately this means changing from our nice and friendly "waccess" et al wrappers, because they do the narrowing for you.
The text was updated successfully, but these errors were encountered:
This cuts down on the wcs2string here by ~25%.
The better solution would be to cache narrow versions of $PATH, since
we compute that over and over and over and over again, while it rarely changes.
Or we could add a full path-cache (where which command is), but that's
much harder to invalidate.