Optimize writeback#53
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to optimize writeback by batching changes per file to reduce redundant I/O and process invocations, improving performance across both Rust and Python writeback paths.
- Introduces grouping of model changes by target file to perform single read/write per file.
- Refactors Python writeback to batch multiple model updates in one helper call and updates the helper script to support batch operations.
- Adds benchmarks to measure check-only, full cycle with fix, and writeback-only scenarios.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/writeback/rust.rs | Batches model changes per file in the Rust writeback path; consolidates YAML reads/writes to once per file. |
| src/writeback/python.rs | Implements per-file batching, consolidates per-model updates, and switches to a batched Python helper invocation. |
| src/writeback/changes.rs | Adds utility to group ModelChanges by file path, including unit tests for grouping behavior. |
| scripts/ruamel_model_changes.py | Updates Python helper to accept a batched request and apply multiple model updates to a single document with one write. |
| benches/my_benchmark.rs | Adds benchmarks to compare check-only, full fix cycle with batched writeback, and writeback-only performance. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
VDFaller
commented
Dec 2, 2025
remove redundant merge functionality
535e6ca to
be7125b
Compare
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.
Make it so we only writeback once per file. Seems to be faster especially on rust.