Skip to content

perf(extract): skip PDFium image crops when no stage reads them - #2841

Merged
jioffe502 merged 6 commits into
mainfrom
jioffe/skip-unused-image-extraction
Nov 10, 2026
Merged

jioffe502 merged 6 commits into
mainfrom
jioffe/skip-unused-image-extraction

Conversation

@jioffe502

@jioffe502 jioffe502 commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

On main, extract_images defaults to on. It crops image regions out of every PDF page into the images column, but only caption, dedup and the image store read that column, and none of them run by default.

This PR skips the crops unless one of those stages is configured or extract_images=True is set. The docs now say what the flag does, and that it doesn't affect the page render (extract_page_as_image) used by page elements, OCR and image embedding.

main vs this PR (NRB, 8× RTX PRO 6000, BF16)

eval main pps PR pps PDF-extraction CPU (cores) R@10
bo10k, 256 cores 331.1¹ 333.7 27.6 → 13.0 0.748 → 0.750
ViDoRe, 256 cores 31.6¹ 31.1¹ ~halved 0.680 → 0.680
bo10k, 32 cores 141.3 142.6 9.1 → 4.2 0.747 → 0.750

Rows by type are unchanged (within run-to-run noise). PDF-extraction CPU halves; pps is flat where extraction isn't the bottleneck. A follow-up will put the freed CPU to use.

¹ Mean of 2 runs.

Link to Devin session: https://nvidia-cloud.devinenterprise.com/sessions/57f5368b39844a038449e009f6bdd631
Open in Devin Desktop: https://nvidia-cloud.devinenterprise.com/desktop/session/57f5368b39844a038449e009f6bdd631?variant=devin
Requested by: @jioffe502


🟢 Devin Review found nothing to fix · View findings · Follow Devin's work

Devin Review

Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

…raphIngestor

Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

Devin Review found 1 finding. It is left for you to triage below.

View findings in Devin Review · Follow Devin's work

Devin Review

…made

Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review November 9, 2026 22:18
@devin-ai-integration
devin-ai-integration Bot requested review from a team as code owners November 9, 2026 22:18
@greptile-apps

greptile-apps Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Summary

This PR skips PDFium image-region crops when no configured stage needs them.

  • PDF ingests choose image-region crops from configured readers when the flag is unset.
  • PDF extraction keeps full-page renders available when page elements or OCR need them.

Reviews (4) · Last reviewed commit: "Merge branch 'main' into jioffe/skip-unu..." · Reviewed by Greptile

With extract_images resolved off, native-text pages under pdfium_hybrid
lost page_image, but page elements and OCR still read it on every page.
Render whenever those stages run; only the crops stay skipped.

Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@jioffe502
jioffe502 merged commit 8c8416c into main Nov 10, 2026
12 checks 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