Add optional parallel compression steps#18
Conversation
📝 WalkthroughWalkthroughThis pull request introduces parallel execution capabilities for PDF optimization steps in the worker. A new environment variable Changes
Sequence Diagram(s)sequenceDiagram
participant Coord as Orchestrator
participant ImgOpt as Image<br/>Optimization
participant PdfOpt as pdfsizeopt<br/>Task
participant GS as Ghostscript<br/>Task
participant TempMgr as Temp File<br/>Manager
rect rgba(100, 150, 200, 0.5)
Note over Coord: Parallelism > 1 Flow
Coord->>Coord: Evaluate task thresholds
par Concurrent Execution
Coord->>ImgOpt: Execute async
ImgOpt->>ImgOpt: Optimize images
ImgOpt-->>Coord: Return (steps, temps, candidates)
and
Coord->>PdfOpt: Execute async
PdfOpt->>PdfOpt: Run pdfsizeopt
PdfOpt-->>Coord: Return (steps, temps, candidates)
and
Coord->>GS: Execute async
GS->>GS: Probe + Full run + Retry
GS-->>Coord: Return (steps, temps, candidates)
end
end
rect rgba(150, 200, 100, 0.5)
Note over Coord: Post-Execution
Coord->>Coord: Aggregate results<br/>from all tasks
Coord->>TempMgr: Collect & deduplicate<br/>temp files
TempMgr->>TempMgr: Remove artifacts
Coord-->>Coord: Return optimized PDF
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
ZENPDF_COMPRESS_PARALLELISMTesting