feat: add parallel compilation with Rayon#10
Merged
ryanorendorff merged 1 commit intomainfrom Oct 16, 2025
Merged
Conversation
Refactor preprocessor to compile code blocks in parallel using Rayon thread pool, achieving 2.46x speedup (1.24s -> 0.50s for 13 blocks). Module refactoring: - Split monolithic preprocessor.rs (487 lines) into focused modules - Add compilation.rs: CompilationTask/Result types and parallel execution - Add task_collector.rs: Task collection with validation limits - Add reporting.rs: Error formatting and compilation statistics Key improvements: - Add parallel_jobs config option to control thread count - Add CompilationTask::compile method for zero-copy field moves - Use Arc<PathBuf> for chapter paths to avoid cloning per task - Collect all errors before failing to show all issues at once - Add compilation statistics with per-language timing breakdown Performance: - Statistics show total time, average per block, and per-language breakdown - Individual block timings available at debug log level
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.
Refactor preprocessor to compile code blocks in parallel using Rayon thread pool, achieving 2.46x speedup (1.24s -> 0.50s for 13 blocks in the test fixtures).
Module refactoring:
Key improvements:
Performance: