On Sat, 19 Apr 2008, Linus Torvalds wrote: > > Notice how this patch doesn' actually change the fundamental O(n^2) > behaviour, but it makes it much cheaper by generally avoiding the > expensive 'fnmatch' and 'strlen/strncmp' when they are obviously not > needed. Side note: on the kenrel tree, it makes the (insane!) operation git add $(git ls-files) go from 49 seconds down to 17 sec. So it does make a huge difference for me, but I also want to point out that this really isn't a sane operation to do (I also think that 17 sec is totally unacceptable, but I cannot find it in me to care, since I don't think this is an operation that anybody should ever do!) The optimization is probably worth doing just to avoid the bad worst case, but we should teach people not to do "git add *" (or that insane ls-files thing), and instead do "git add ." and "git add -u". But in the absense of teaching people that, the patch should at least makes that bad pattern behavior be slightly more acceptable for git, even if it's still not very nice. (Btw, we need to stop using "fnmatch()" entirely some day, if only because we can't ever use it for case-insensitive stuff. That patch doesn't help us with that, but it doesn't hurt either, and conceptually it's moving in the direction of doing more in "native" git code than in "fnmatch()") Linus -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html