Skip to content

Advice for allocations when handling very large files #2244

Answered by BurntSushi
T145 asked this question in Q&A
Discussion options

You must be logged in to vote

Umm... I don't know. And literally can't know without seeing source.txt. Why not try some limits and experiment with it? Even given my knowledge, that's what I would do.

Also, unless source.txt is just a simple list of literals (which seems likely given the -F flag) you're probably going to have a bad time with 8MB of regexes. ripgrep is likely not sophisticated enough to handle it well. It might work with sufficient limits, but it really depends on your data.

In theory, given -F, this invocation should just use Aho-Corasick and not a regex engine at all. In which case, I believe the size limits shouldn't apply.

But again, without sharing the inputs here, it's hard to say.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@BurntSushi
Comment options

@BurntSushi
Comment options

@T145
Comment options

@BurntSushi
Comment options

@T145
Comment options

Answer selected by T145
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants