Closed rentruewang closed 1 year ago
Strange report. Ugrep is tested extensively and compared to ag it runs a lot faster. There is not anything here that helps to point to a problem.
To pin down a potential problem:
Try option -P
to use PCRE2 matching.
Then try -U
to use non-Unicode matching.
Then try ugrep
instead of ug
.
These should not make much of a difference. If there is a difference, then something might be wrong with the installation.
Also use option -I
to skip binary files. Perhaps there are many large binary files on the search path?
@genivia-inc Thanks for the reply. Turned out that it was because ag
automatically ignores .gitignore
files, and ug
has it on by default.
@genivia-inc I'm wondering, if I turned on --ignore-files
in .ugrep
, is there a way for me to undo this while using ug
? For example, I may have --pretty
and --ignore-files
turned on, and I just wanted to disable --ignore-files
.
@genivia-inc I'm wondering, if I turned on
--ignore-files
in.ugrep
, is there a way for me to undo this while usingug
? For example, I may have--pretty
and--ignore-files
turned on, and I just wanted to disable--ignore-files
.
Sure, you can use --no-ignore-files
to turn it off.
Most options support --no-
to disable. Which comes in handy when you enable options in a .ugrep file and sometimes you want to overrule them.
Or just use the ugrep
command.
Or define a local .ugrep in the working directory where you often search. You can do this to generate it and remove the --ignore-files
when defined in the .ugrep in your home directory:
ug --no-ignore-files --save-config
@genivia-inc Thanks for the reply! Does --no-
work for all options? In that case, would you like to document it in the README
? For example, --no-ignore-files
I don't think is documented.
I'll update the man page. It says this at the end of the long options list. I'll move it up.
Thanks!
I was using
ugrep
in wsl to grep yaml files from my github repositories, with the commandug -. -r 'pattern'
and it took so long I killed it (and somehow slows down my laptop), whereas the same pattern in the silver searcherag --hidden 'pattern'
finished in 2 seconds.My ugrep version :
ugrep 3.12.1 x86_64-pc-linux-gnu +avx2 +pcre2jit +zlib +bzip2 +lzma +zstd
I installedugrep
with./build.sh --enable-pretty
if that helps. Let me know if there's anything I could do to help debug this issue.Thanks for reading.