Skip to content

improve performance of pcre matches

Carlo Marcelo Arenas Belón selinux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3scripts: respect an initial LD_LIBRARY_PATH with env_use_destdirscripts/env_use_destdir+7 -10 replies
2/3libselinux: improve performance with pcre matcheslibselinux/src/regex.c libselinux/src/selinux_internal.h+64 -482 replies
3/3libselinux: use a static match_data if single threadedlibselinux/src/regex.c+9 -80 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] improve performance of pcre matches

The following series optimizes the way PCRE2 matches are done by using more efficiently the match_data resources and shows over 30% reduction in cpu utilization while only using 1/5 of the memory as shown in the bug report[1] that started it all.

The first patch is just an administrative change that I found useful while building and testing the code with a development version of PCRE2.

The second patch reverts the workaround merged in 30b3e9d2 (libselinux:
Workaround for heap overhead of pcre, 2023-01-12) while addressing the increased memory utilization that it was trying to prevent by changing the way the match_data required for each match was being handled.

The last patch changes the single threaded codepath to allow for a similar performance improvement done to the multithreaded codepath by intentionally leaking one match_data that could be reused for all matches.

Carlo Marcelo Arenas Belón (3):
scripts: respect an initial LD_LIBRARY_PATH with env_use_destdir
libselinux: improve performance with pcre matches
libselinux: use a static match_data if single threaded

 libselinux/src/regex.c            | 111 +++++++++++++++++-------------
 libselinux/src/selinux_internal.h |   4 ++
 scripts/env_use_destdir           |   8 ++-
 3 files changed, 73 insertions(+), 50 deletions(-)

[1] https://github.com/PCRE2Project/pcre2/issues/194

Signature · 1 line
2.39.0