Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new randomized equivalence test is non-deterministic and the new default H2 cache sizing should be configurable to avoid unexpected memory impact in constrained environments.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR targets performance improvements in tika-eval runs by reducing preprocessing overhead in langdetect/junkdetect feature extraction, and by tuning reporting and database defaults to better surface and sustain throughput.
Changes:
- Replace URL/email stripping regex passes in
CharSoupFeatureExtractorwith single-pass ASCII scanners (while aiming to preserve identical output). - Improve
tika-evalprogress logging by adding a “last interval” docs/sec rate alongside the cumulative average. - Tune the default H2 JDBC URL used by tika-eval Profile/Compare and document the changes in
CHANGES.txt.
File summaries
| File | Description |
|---|---|
| tika-langdetect/tika-langdetect-opennlp/src/main/java/org/apache/tika/langdetect/opennlp/OpenNLPDetector.java | Makes bounded URL/mail regex quantifiers possessive for normalization performance while preserving matches. |
| tika-langdetect/tika-langdetect-charsoup-core/src/main/java/org/apache/tika/langdetect/charsoup/core/CharSoupFeatureExtractor.java | Replaces URL/email regex stripping with hand-rolled scanners to avoid regex overhead. |
| tika-langdetect/tika-langdetect-charsoup/src/test/java/org/apache/tika/langdetect/charsoup/core/CharSoupFeatureExtractorTest.java | Adds an equivalence test comparing scanner output vs regex reference behavior. |
| tika-eval/tika-eval-app/src/main/java/org/apache/tika/eval/app/StatusReporter.java | Adds windowed (last-interval) rate reporting. |
| tika-eval/tika-eval-app/src/main/java/org/apache/tika/eval/app/ExtractProfileRunner.java | Adjusts default H2 JDBC URL parameters (retention/cache). |
| tika-eval/tika-eval-app/src/main/java/org/apache/tika/eval/app/ExtractComparerRunner.java | Adjusts default H2 JDBC URL parameters (retention/cache). |
| CHANGES.txt | Notes the performance changes and user-visible logging/db default updates. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+184
to
+187
| //default to h2 | ||
| Path p = Paths.get(dbPath); | ||
| return "jdbc:h2:file:" + p.toAbsolutePath(); | ||
|
|
||
| // drop the 45s MVStore chunk retention (bloat + growing compaction cost); CACHE_SIZE is KB | ||
| return "jdbc:h2:file:" + p.toAbsolutePath() + ";RETENTION_TIME=0;CACHE_SIZE=1048576"; |
Comment on lines
+125
to
+128
| //default to h2 | ||
| Path p = Paths.get(dbPath); | ||
| return "jdbc:h2:file:" + p.toAbsolutePath(); | ||
|
|
||
| // drop the 45s MVStore chunk retention (bloat + growing compaction cost); CACHE_SIZE is KB | ||
| return "jdbc:h2:file:" + p.toAbsolutePath() + ";RETENTION_TIME=0;CACHE_SIZE=1048576"; |
Comment on lines
+151
to
+152
| long seed = new Random().nextLong(); | ||
| Random random = new Random(seed); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for your contribution to Apache Tika! Your help is appreciated!
Before opening the pull request, please verify that
TIKA-XXXX)[TIKA-XXXX] Issue or pull request title)./mvnw clean install(clean testalone cannot resolve the pipes plugin zips)Generated-by: <tool>in the commit message), and consider running the pre-flight in.skills/devs/pr-review/SKILL.md— fix what it finds; don't paste its report heremainbranch. If there are conflicts, please try to rebase the pull request branch on top of a freshly pulledmainbranchtika-bom/pom.xml.We will be able to faster integrate your pull request if these conditions are met. If you have any questions how to fix your problem or about using Tika in general, please sign up for the Tika mailing list. Thanks!