Skip to content

[LOGBACK-1409] FileFilterUtil.filesInFolderMatchingStemRegex resuses compiled pattern - #581

Merged
ceki merged 1 commit into
qos-ch:masterfrom
schlosna:ds/file-filter-regex
Aug 22, 2022
Merged

ceki merged 1 commit into
qos-ch:masterfrom
schlosna:ds/file-filter-regex

Conversation

@schlosna

@schlosna schlosna commented Aug 1, 2022 •

Copy link
Copy Markdown
Contributor

Fixes LOGBACK-1409

While reviewing some JFR from a service using logback, I noticed some significant allocations and processing being done by ch.qos.logback.core.rolling.helper.FileFilterUtil$3.accept(File, String) where it was recompiling a regex for each listed file as part of the FileFilter.

image

This PR compiles the pattern once and reuses it for each file.

@schlosna
schlosna force-pushed the ds/file-filter-regex branch from a141401 to f8b9369 Compare August 1, 2022 22:53
@schlosna schlosna changed the title FileFilterUtil.filesInFolderMatchingStemRegex resuses compiled pattern [LOGBACK-1409] FileFilterUtil.filesInFolderMatchingStemRegex resuses compiled pattern Aug 3, 2022
FileFilterUtil.filesInFolderMatchingStemRegex resuses compiled pattern
to avoid expensive regex recompilation for each file comparison.

Signed-off-by: David Schlosnagle <davids@palantir.com>
@schlosna
schlosna force-pushed the ds/file-filter-regex branch from f8b9369 to ac823db Compare August 22, 2022 14:36
@schlosna

Copy link
Copy Markdown
Contributor Author

Hi @ceki , I am curious if you would consider this PR.

@ceki
ceki merged commit cbb1e3d into qos-ch:master Aug 22, 2022
@ceki

ceki commented Aug 22, 2022

Copy link
Copy Markdown
Member

@schlosna Thank you for this PR.

@schlosna
schlosna deleted the ds/file-filter-regex branch August 23, 2022 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants