Tom<adatgyujto<at> gmail.com> writes:
Why is it so much slower to run the same command via grep than
via the command line?
Turns out it was the way I ran the command.
I created a small convenience function which always started the
search from the root directory of the project
(let ((default-directory rootdir))
(grep-find (concat "c:/xampp/perl/bin/perl.exe c:/bin/ack -i " pattern)))
Looks like default-directory caused the problem, because if I change it
to this:
(with-current-buffer (find-file-noselect rootdir)
(grep-find (concat "c:/xampp/perl/bin/perl.exe c:/bin/ack -i " pattern)))
then it's not slow anymore.
It fixed the problem, though I don't really get the difference. Isn't
setting default-directory temporarily a usual way to make a directory
current for the duration of a function?