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

Re: [PATCH] Interpret :/<pattern> as a regular expression

From
Sam Vilain <sam@vilain.net>
Date
Jun 14, 2007, 07:48 UTC
Message-ID
<4670F2BB.5060909@vilain.net>
In-Reply-To
<Pine.LNX.4.64.0706132317240.4059@racer.site>
Johannes Schindelin wrote:
Show 7 quoted lines
> Actually, that's funny. Yesterday, I repeated my claim that pcre is 
> slow on IRC, and Sam Villain on IRC accused me of trolling. But as you can 
> see from my postings on this list ($gmane/41682), you can see that _I_ had 
> numbers to back up my claim.
>
> So no, I think pcre is just not worth it.
>   

A strange thing to conclude from your figures, which show pcre as the fastest out of several libraries that you tested.

Your figures show exactly what I was saying on IRC - that a DFA (external grep) vs NFA engine (most regex libraries) is inherently faster. The paper I linked to, specially selected as I had previously read a significant amount of the peer review the paper received, explained this in detail. The one piece of feedback your numbers got on-list also mentioned this.

However there is a further flaw in your study. All but one of the performance tests use an external program, which on a given system may or may not be faster because of pipeline performance characteristics. You could improve the quality of the result by using the 'pcregrep' program as a data point. It might also be worth trying a few more complex patterns. I suggest reading the paper (http://swtch.com/~rsc/regexp/regexp1.html) for some background before repeating the experiment.

Apologies for not reviewing your numbers at the time; it sure is hard to keep on top of this list. But very interesting that they seem to suggest pcre would be the best choice from a performance perspective, even though the figures are very preliminary. Perhaps it is worth pursuing after all.

Sam.
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 12 of 14 in “Interpret :/<pattern> as a regular expression”
  1. Interpret :/<pattern> as a regular expressionJohannes Schindelin, Jun 13, 2007
  2. Junio C HamanoJun 13, 2007
  3. Johannes SchindelinJun 13, 2007
  4. Junio C HamanoJun 13, 2007
  5. Johannes SchindelinJun 13, 2007
  6. (unknown)Johannes Schindelin, Jun 13, 2007
  7. Interpret :/<pattern> as a regular expressionJohannes Schindelin, Jun 13, 2007
  8. Jeff KingJun 13, 2007
  9. Johannes SchindelinJun 13, 2007
  10. Jeff KingJun 13, 2007
  11. Johannes SchindelinJun 13, 2007
  12. Sam VilainJun 14, 2007
  13. Johannes SchindelinJun 14, 2007
  14. Sam VilainJun 14, 2007

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.