rgheck wrote: > Vincent van Ravesteijn - TNW wrote: >> I might be a bit annoying, but let's pretend we don't know the problem >> with the filesystem checks. Then, how would you explain to someone that >> you're implementing administrative tools, touching many files and >> thinking of all different special cases with the risk you forget one, >> while you can find out whether a file is loaded just by looping over all >> buffers in the memory and comparing a handful of strings to each other. >> As I have said somewhere else, you can probably do very very many string >> comparisons before the user will notice. >> >> > Yes, but the problem is that you CAN'T do this just by comparing > strings. In many cases, to be sure, you could tell that the file is > loaded by comparing strings. But you can't be sure it isn't loaded just > by comparing strings. Maybe it's loaded, but under a different pathname.
But you can first compare strings and only do the expensive equivalence test if the strings don't match. loadIfNeeded() can only cause performance problems if it is called very often. If it is called very often, then all needed files will be loaded after few iterations, and the simple string comparison will always succeed. Georg
