[
https://issues.apache.org/jira/browse/TIKA-4796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18099883#comment-18099883
]
Hudson commented on TIKA-4796:
------------------------------
SUCCESS: Integrated in Jenkins build Tika » tika-branch_3x-jdk11 #2527 (See
[https://ci-builds.apache.org/job/Tika/job/tika-branch_3x-jdk11/2527/])
TIKA-4796: compile MagicDetector regex once at construction (#2972) (github:
[https://github.com/apache/tika/commit/0f8067b0f2aad210bed54cb33340e02ae27702b8])
* (edit) CHANGES.txt
* (edit) tika-core/src/main/java/org/apache/tika/detect/MagicDetector.java
* (edit) tika-core/src/test/java/org/apache/tika/detect/MagicDetectorTest.java
> Caching of MagicDetector pattern compilations
> ---------------------------------------------
>
> Key: TIKA-4796
> URL: https://issues.apache.org/jira/browse/TIKA-4796
> Project: Tika
> Issue Type: Improvement
> Reporter: Grant Ingersoll
> Priority: Minor
>
> I've been doing some profiling of Tika as part of a broader focus on a
> document extraction pipeline and one of the areas that shows up more than
> expected and appears to be an easy fix is the
> {code:java}
> Pattern p = Pattern.compile(new String(this.pattern, UTF_8), flags);{code}
> line in `matchesBuffer` (trunk/main) and the `detect` method in the 3.x line.
>
> The fix is to compile the pattern in the initialization. Patch/fix coming
> shortly.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)