Skip to content
New issue

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

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

Already on GitHub? # 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 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
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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants