Skip to content

Optimize writeback#53

Merged
VDFaller merged 2 commits into
mainfrom
optimize-writeback
Dec 9, 2025
Merged

Optimize writeback#53
VDFaller merged 2 commits into
mainfrom
optimize-writeback

Conversation

@VDFaller
Copy link
Copy Markdown
Owner

@VDFaller VDFaller commented Dec 2, 2025

Make it so we only writeback once per file. Seems to be faster especially on rust.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread src/writeback/python.rs Outdated
Comment thread src/writeback/python.rs Outdated
Comment thread src/writeback/rust.rs Outdated
Comment thread src/writeback/rust.rs
remove redundant merge functionality
@VDFaller VDFaller merged commit f5bd6dc into main Dec 9, 2025
1 check 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