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

Re: [RFC PATCH v5 0/3] grep: almost no more leaks, hopefully no crashes

From
René Scharfe <l.s.r@web.de>
Date
Aug 10, 2019, 07:56 UTC
Message-ID
<d8e55007-27bd-fcac-c918-bb712ec1bb8b@web.de>
In-Reply-To
<CAPUEspjVMbjdgBrW3qS3jwbd2ZfqMinfgGiasEZGwyZB-1c+QA@mail.gmail.com>
Am 10.08.19 um 05:05 schrieb Carlo Arenas:
> in macOS (obviously testing without NED) the following is the output
> of (a hacked version) of p7801 for maint (against chromium's
> repository), with René's patch on top

Do you mean p7820? And what did you change? Looking at the results you removed basic and extended from the list of regex engines, right?

Ugh, cloning https://chromium.googlesource.com/chromium/src.git sends more than 16GB across the wire. Is that even the right repository? Not sure if my machine can keep the relevant parts cached while grepping -- I/O times could drown out any difference due to context allocation and memory allocator choice. Let's see...

Show 41 quoted lines
>
> Test                                       HEAD^               HEAD
> --------------------------------------------------------------------------------------
> 7820.1: perl grep 'how.to'                 0.51(0.35+1.11)
> 0.48(0.33+1.16) -5.9%
> 7820.2: perl grep '^how to'                0.47(0.33+1.08)
> 0.45(0.34+1.11) -4.3%
> 7820.3: perl grep '[how] to'               0.49(0.40+1.11)
> 0.53(0.41+1.13) +8.2%
> 7820.4: perl grep '(e.t[^ ]*|v.ry) rare'   68.72(68.77+1.14)
> 72.10(72.15+1.20) +4.9%
> 7820.5: perl grep 'm(ú|u)lt.b(æ|y)te'      0.48(0.35+1.12)
> 0.50(0.40+1.23) +4.2%
>
> and this is with my squashed[2] changed on top of that :
>
> Test                                       HEAD^               HEAD
> --------------------------------------------------------------------------------------
> 7820.1: perl grep 'how.to'                 0.48(0.36+1.16)
> 0.46(0.33+1.09) -4.2%
> 7820.2: perl grep '^how to'                0.45(0.34+1.12)
> 0.42(0.29+0.99) -6.7%
> 7820.3: perl grep '[how] to'               0.48(0.40+1.13)
> 0.52(0.43+1.16) +8.3%
> 7820.4: perl grep '(e.t[^ ]*|v.ry) rare'   69.12(69.10+1.07)
> 69.19(69.19+1.18) +0.1%
> 7820.5: perl grep 'm(ú|u)lt.b(æ|y)te'      0.49(0.38+1.17)
> 0.46(0.35+1.13) -6.1%
>
> the degenerate case is not something we can't fix anyway, since it is
> likely a locking issue inside PCRE2 (I see at most 1 CPU doing work),
> and the numbers are noisy because of the other problems I mentioned
> before (hardcoded to 8 threads, running in a laptop with low number of
> cores), which is why testing for performance regressions in windows is
> strongly encouraged, regardless
>
> Carlo
>
> [1] https://public-inbox.org/git/CAPUEspgH1v1zo7smzQWCV4rX9pKVKLV84gDSfCPdT7LffQxUWw@mail.gmail.com/
> [2] https://public-inbox.org/git/20190810030315.7519-1-carenas@gmail.com/
>

So I pointed GIT_PERF_LARGE_REPO to the monster mentioned above, ran the test once for warmup and here are the results of the second run:

Test origin/master pcre2-xmalloc pcre2-xmalloc+nedmalloc --------------------------------------------------------------------------------------------------------------------- 7820.1: basic grep 'how.to' 1.59(2.93+1.75) 1.60(3.04+1.74) +0.6% 1.64(2.87+1.90) +3.1% 7820.2: extended grep 'how.to' 1.59(2.98+1.66) 1.55(2.83+1.76) -2.5% 1.67(3.15+1.70) +5.0% 7820.3: perl grep 'how.to' 1.25(1.21+2.13) 1.25(1.24+2.08) +0.0% 1.29(1.32+2.08) +3.2% 7820.5: basic grep '^how to' 1.52(2.82+1.66) 1.51(2.68+1.77) -0.7% 1.64(3.07+1.69) +7.9% 7820.6: extended grep '^how to' 1.57(2.84+1.75) 1.51(2.76+1.73) -3.8% 1.61(2.95+1.75) +2.5% 7820.7: perl grep '^how to' 1.21(1.15+2.10) 1.22(1.26+1.98) +0.8% 1.27(1.22+2.09) +5.0% 7820.9: basic grep '[how] to' 1.95(4.51+1.68) 1.96(4.48+1.69) +0.5% 2.00(4.66+1.65) +2.6% 7820.10: extended grep '[how] to' 1.96(4.54+1.65) 1.94(4.46+1.70) -1.0% 2.04(4.78+1.65) +4.1% 7820.11: perl grep '[how] to' 1.29(1.58+1.88) 1.28(1.50+1.94) -0.8% 1.34(1.51+2.06) +3.9% 7820.13: basic grep '\(e.t[^ ]*\|v.ry\) rare' 8.17(13.18+1.50) 8.29(13.36+1.37) +1.5% 8.31(13.33+1.60) +1.7% 7820.14: extended grep '(e.t[^ ]*|v.ry) rare' 8.13(13.03+1.59) 8.14(13.12+1.47) +0.1% 8.30(13.35+1.56) +2.1% 7820.15: perl grep '(e.t[^ ]*|v.ry) rare' 34.96(35.80+1.68) 34.99(35.60+1.91) +0.1% 35.18(35.83+1.90) +0.6% 7820.17: basic grep 'm\(ú\|u\)lt.b\(æ\|y\)te' 1.57(3.03+1.64) 1.53(2.76+1.75) -2.5% 1.60(2.89+1.77) +1.9% 7820.18: extended grep 'm(ú|u)lt.b(æ|y)te' 1.52(2.83+1.69) 1.52(2.89+1.63) +0.0% 1.58(2.80+1.84) +3.9% 7820.19: perl grep 'm(ú|u)lt.b(æ|y)te' 1.20(1.25+2.02) 1.21(1.30+1.96) +0.8% 1.25(1.22+2.11) +4.2%

pcre2-xmalloc is my patch on top of master, +nedmalloc has the warning fixes I sent earlier and sets USE_NED_MALLOC.

I don't understand why my performance is lower by factor 2.5 than yours for all perl regex tests except 7820.15 (your 7820.4), where my system is two times faster. Debian Testing, GCC 9.1.0, i5-9600K, 16GB RAM.

Anyway, nedmalloc is slower across the board, but the impact of my patch is in the noise. Right?

René
Previous: Carlo ArenasNext: Carlo Arenas
Message 62 of 67 in “Fix a problem with PCRE2 and nedmalloc, found via Azure Pipelines”
  1. 0/1 Fix a problem with PCRE2 and nedmalloc, found via Azure PipelinesJohannes Schindelin via GitGitGadget, Aug 5, 2019
  2. 1/1 pcre2: allow overriding the system allocatorJohannes Schindelin via GitGitGadget, Aug 5, 2019
  3. Carlo ArenasAug 5, 2019
  4. Carlo ArenasAug 5, 2019
  5. Johannes SchindelinAug 5, 2019
  6. Johannes SchindelinAug 5, 2019
  7. Junio C HamanoAug 5, 2019
  8. Carlo ArenasAug 6, 2019
  9. 0/3 grep: no leaks (WIP)Carlo Marcelo Arenas Belón, Aug 6, 2019
  10. 1/3 grep: make PCRE1 aware of custom allocatorCarlo Marcelo Arenas Belón, Aug 6, 2019
  11. Johannes SchindelinAug 8, 2019
  12. Carlo ArenasAug 8, 2019
  13. 3/3 grep: avoid leak of chartables in PCRE2Carlo Marcelo Arenas Belón, Aug 6, 2019
  14. 2/3 grep: make PCRE2 aware of custom allocatorCarlo Marcelo Arenas Belón, Aug 6, 2019
  15. Johannes SchindelinAug 8, 2019
  16. Carlo ArenasAug 8, 2019
  17. 0/3 grep: no leaks or crashes (windows testing needed)Carlo Marcelo Arenas Belón, Aug 6, 2019
  18. 2/3 grep: make PCRE2 aware of custom allocatorCarlo Marcelo Arenas Belón, Aug 6, 2019
  19. René ScharfeAug 7, 2019
  20. Carlo ArenasAug 7, 2019
  21. René ScharfeAug 7, 2019
  22. 1/2 nedmalloc: do assignments only after the declaration sectionRené Scharfe, Aug 7, 2019
  23. 2/2 nedmalloc: avoid compiler warning about unused valueRené Scharfe, Aug 7, 2019
  24. Carlo ArenasAug 8, 2019
  25. René ScharfeAug 8, 2019
  26. Carlo ArenasAug 8, 2019
  27. René ScharfeAug 8, 2019
  28. Johannes SchindelinAug 8, 2019
  29. Junio C HamanoAug 7, 2019
  30. 1/3 grep: make PCRE1 aware of custom allocatorCarlo Marcelo Arenas Belón, Aug 6, 2019
  31. 3/3 grep: avoid leak of chartables in PCRE2Carlo Marcelo Arenas Belón, Aug 6, 2019
  32. Junio C HamanoAug 6, 2019
  33. 0/3 grep: no leaks or crashes (windows testing needed)Carlo Marcelo Arenas Belón, Aug 7, 2019
  34. 1/3 grep: make PCRE1 aware of custom allocatorCarlo Marcelo Arenas Belón, Aug 7, 2019
  35. 2/3 grep: make PCRE2 aware of custom allocatorCarlo Marcelo Arenas Belón, Aug 7, 2019
  36. Junio C HamanoAug 7, 2019
  37. 3/3 grep: avoid leak of chartables in PCRE2Carlo Marcelo Arenas Belón, Aug 7, 2019
  38. 0/3 grep: almost no more leaks, hopefully no crashesCarlo Marcelo Arenas Belón, Aug 9, 2019
  39. 1/3 grep: make PCRE1 aware of custom allocatorCarlo Marcelo Arenas Belón, Aug 9, 2019
  40. 3/3 grep: avoid leak of chartables in PCRE2Carlo Marcelo Arenas Belón, Aug 9, 2019
  41. 2/3 grep: make PCRE2 aware of custom allocatorCarlo Marcelo Arenas Belón, Aug 9, 2019
  42. Johannes SchindelinAug 27, 2019
  43. Carlo ArenasAug 27, 2019
  44. Junio C HamanoOct 3, 2019
  45. Johannes SchindelinOct 3, 2019
  46. Carlo ArenasOct 3, 2019
  47. Johannes SchindelinOct 3, 2019
  48. Junio C HamanoOct 3, 2019
  49. Carlo ArenasAug 9, 2019
  50. René ScharfeAug 9, 2019
  51. Junio C HamanoAug 9, 2019
  52. Johannes SchindelinAug 9, 2019
  53. SQUASHCarlo Marcelo Arenas Belón, Aug 10, 2019
  54. René ScharfeAug 10, 2019
  55. Carlo ArenasAug 10, 2019
  56. René ScharfeAug 10, 2019
  57. Carlo ArenasAug 12, 2019
  58. René ScharfeAug 12, 2019
  59. Carlo ArenasAug 12, 2019
  60. Johannes SchindelinAug 10, 2019
  61. Carlo ArenasAug 10, 2019
  62. René ScharfeAug 10, 2019
  63. Carlo ArenasAug 10, 2019
  64. René ScharfeAug 10, 2019
  65. Johannes SchindelinAug 8, 2019
  66. Carlo ArenasAug 9, 2019
  67. Johannes SchindelinAug 9, 2019

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.