feat(pdf): adopt performance-oriented core-pdfminer.six fork - #4411
feat(pdf): adopt performance-oriented core-pdfminer.six fork#4411KRRT7 wants to merge 4 commits into
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
core-pdfminer.six retains the original project’s license, and I have no intention of changing it. I also plan to actively maintain the fork and continue improving its performance. |
|
@badGarnet @cragwolfe for your review. |
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Shadow auto-approve: would auto-approve. Migrates to a performance-oriented fork of pdfminer.six while preserving semantics, removing a now-included monkey-patch. The change is bounded and clearly beneficial with no new exposure or tradeoffs.
Re-trigger cubic
Unstructured performance comparisonI benchmarked upstream
This is a 23.4% reduction in warm partition latency. Element counts matched exactly for every document. Methodology:
Cold process performance was effectively unchanged (7.027 seconds on The broader CI partition benchmark also passes. |
There was a problem hiding this comment.
All reported issues were addressed
Shadow auto-approve: would not auto-approve because issues were found.
Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Shadow auto-approve: would auto-approve. Bounded, mechanical migration to a compatible performance-oriented fork, preserving all semantics; only import paths and a now-included monkey-patch removal change.
Re-trigger cubic
Summary
This migrates Unstructured’s PDF extraction path to
core-pdfminer.six, a performance-oriented fork ofpdfminer.six.core-pdfminer.sixpreserves the parsing and extraction semantics of upstreampdfminer.sixunder thecore_pdfminer_sixnamespace. It passes the same upstream test cases, with only the import namespace adjusted.This PR:
core-pdfminer-sixas a dependency.core_pdfminer_six.PSBaseParsermonkey patch because the corresponding fixes are already included in the fork.pdfminer.siximage-extra dependency unchanged for now.Performance
Benchmarks against the upstream baseline across Python 3.10, 3.11, and 3.12 showed:
Compatibility
The fork maintains upstream parsing and extraction behavior. The package namespace is intentionally distinct, allowing
core-pdfminer.sixandpdfminer.sixto coexist in the same environment.Testing