Skip to content

Conversation

@chesswithmihir
Copy link
Contributor

Problem:

  • Singer repeatedly compiles the same regex patterns when processing log files, causing unnecessary CPU overhead in high-throughput scenarios.

Solution:

  • Added PatternCache utility class with thread-safe caching of compiled Pattern objects
  • Integrated caching into TextLogFileReaderFactory and LogStreamManager
  • Added comprehensive unit tests to verify caching behavior

Impact:

  • Reduces regex compilation overhead by reusing cached patterns, improving performance for log processing pipelines with frequent pattern matching.

@chesswithmihir chesswithmihir requested a review from a team as a code owner August 13, 2025 06:39
@jfzunigac jfzunigac merged commit 17639bc into pinterest:master Aug 15, 2025
1 check passed
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