bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#43040: grep 3.4: memory leak


From: Paul Eggert
Subject: bug#43040: grep 3.4: memory leak
Date: Mon, 7 Sep 2020 19:59:09 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

I don't see the extra memory consumption as necessarily being a bug, if grep is trading space (which is relatively cheap) for time (which is less so). Perhaps someone with some time to spare could look into that in more detail.

The excess CPU consumption is clearly problematic, though. I installed the attached patches, which on your example causes 'grep' to be 3x faster than grep 3.3 was. I hope this addresses any practical performance problems uncovered by that artificial test case. The first patch is a bit of a hack but does the real work; the rest are merely cleanups or very minor performance improvements.

Attachment: 0001-Omit-duplicate-regexps.patch
Description: Text Data

Attachment: 0002-Simplify-regex_compile.patch
Description: Text Data

Attachment: 0003-Simplify-pattern_file_name.patch
Description: Text Data

Attachment: 0004-Prefer-rawmemchr-to-memchr-when-it-s-easy.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]