git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git grep performance regression on macOS

From
Carlo Marcelo Arenas Bel'on <carenas@gmail.com>
Date
Oct 2, 2023, 03:05 UTC
Message-ID
<dw26ovefqhtvpdxdrj6rlzmosi5wg2avhsurh452jku3vf2ox3@fjkysuygd4ej>
In-Reply-To
<CAPWWTaDE5559vA1qa0zhBid_ep9ht+PxPSDS5YC7Dk0NN8sp9A@mail.gmail.com>
On Fri, Sep 29, 2023 at 04:56:19PM -0700, Benjamin Hiller wrote:
> 
> git grep -E "(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}|(\"|')?(AWS|aws|Aws)?_?(SECRET|secret|Secret)?_?(ACCESS|access|Access)?_?(KEY|key|Key)(\"|')?\s*(:|=>|=)\s*(\"|')?[A-Za-z0-9/\+=]{40}(\"|')?|(\"|')?(AWS|aws|Aws)?_?(ACCOUNT|account|Account)_?(ID|id|Id)?(\"|')?\s*(:|=>|=)\s*(\"|')?[0-9]{4}\-?[0-9]{4}\-?[0-9]{4}(\"|')?"

changing this code to use `git grep -P` instead will make it at least 7x faster even if you have a pcre2 library without JIT.

Carlo
Previous: Junio C Hamano
Message 3 of 3 in “git grep performance regression on macOS”
  1. Benjamin HillerSep 29, 2023
  2. Junio C HamanoSep 30, 2023
  3. Carlo Marcelo Arenas Bel'onOct 2, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.