Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Aug 22, 2022

Conversation

schlosna
Copy link
Contributor

@schlosna schlosna commented Aug 1, 2022

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 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
Copy link
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
Copy link
Member

ceki commented Aug 22, 2022

@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.

None yet

2 participants