Skip to content

should --vimgrep run in single threaded mode by default? #2505

@voidus

Description

@voidus

I think I'm hitting #999 again

What version of ripgrep are you using?

ripgrep 13.0.0

How did you install ripgrep?

Via nix' home-manager @nixpkgs rev 402cc3633cc60dfc50378197305c984518b30773

What operating system are you using ripgrep on?

Arch linux with a lot of stuff (including rg) coming from nix

Describe your bug.

Project info:

98M	.
incl gitignore
5717
90682
excl gitignore
410
27827

 > nix run nixpkgs#time -- -v rg a | wc -l        
	Command being timed: "rg a"
	User time (seconds): 0.00
	System time (seconds): 0.00
	Percent of CPU this job got: 160%
	Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.01
	Average shared text size (kbytes): 0
	Average unshared data size (kbytes): 0
	Average stack size (kbytes): 0
	Average total size (kbytes): 0
	Maximum resident set size (kbytes): 10880
	Average resident set size (kbytes): 0
	Major (requiring I/O) page faults: 0
	Minor (reclaiming a frame) page faults: 2214
	Voluntary context switches: 211
	Involuntary context switches: 29
	Swaps: 0
	File system inputs: 0
	File system outputs: 0
	Socket messages sent: 0
	Socket messages received: 0
	Signals delivered: 0
	Page size (bytes): 4096
	Exit status: 0
14008

> nix run nixpkgs#time -- -v rg --vimgrep a | wc -l
Command terminated by signal 9
	Command being timed: "rg --vimgrep a"
	User time (seconds): 4.67
	System time (seconds): 35.86
	Percent of CPU this job got: 85%
	Elapsed (wall clock) time (h:mm:ss or m:ss): 0:47.30
	Average shared text size (kbytes): 0
	Average unshared data size (kbytes): 0
	Average stack size (kbytes): 0
	Average total size (kbytes): 0
	Maximum resident set size (kbytes): 26359456
	Average resident set size (kbytes): 0
	Major (requiring I/O) page faults: 15488
	Minor (reclaiming a frame) page faults: 7088456
	Voluntary context switches: 467064
	Involuntary context switches: 52122
	Swaps: 0
	File system inputs: 1722872
	File system outputs: 0
	Socket messages sent: 0
	Socket messages received: 0
	Signals delivered: 0
	Page size (bytes): 4096
	Exit status: 0
89447

26Gigs of memory to search through a hundred megs of stuff seems like an issue.

I ^c'd the vimgrep one once my 32GB of memory + 18GB of swap were full.

I'm running this in this subfolder: https://gitlab.com/sea-watch.org/planner/-/tree/main/backoffice but I'm working in this repo so it might not be the same.
I did move the big .direnv folder with the python virtualenvs out of the way to run the above test.

I'd be more than happy to debug this further if you have any guidance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionAn issue that is lacking clarity on one or more points.rollupA PR that has been merged with many others in a rollup.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions