Implementation Plan: Perf — Add CDumper for YAML Writes + Hoist re.compile() to Module Level#2200
Merged
Trecek merged 4 commits intoMay 7, 2026
Conversation
- Add _Dumper (CDumper if libyaml available, else Dumper) to core/io.py and use it in dump_yaml_str() for ~5x faster YAML serialization - Move no_runs_re and timed_out_re regex compilation to module level in rules_ci.py to avoid recompiling on every validate_recipe() call - Add tests for _Dumper type detection and module-level regex constants Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…comment Add pattern string assertions to test_no_runs_re_is_module_level_constant and test_timed_out_re_is_module_level_constant so a silent regex change cannot pass. Remove the section-divider comment that added no navigational value.
…rror A caller passing Dumper= in **kwargs would cause yaml.dump to raise TypeError for duplicate keyword argument. Pop it before forwarding to make the function safe against callers using dump_yaml_str as a transparent yaml.dump wrapper.
Trecek
added a commit
that referenced
this pull request
May 8, 2026
…mpile() to Module Level (#2200) ## Summary Two independent micro-performance fixes: (A) use the C-extension CDumper for YAML writes in `dump_yaml_str()` instead of the pure-Python dumper (~5× speedup), mirroring the existing CSafeLoader pattern for reads; and (B) hoist two `re.compile()` calls from inside `@semantic_rule` function bodies to module-level constants in `rules_ci.py`, since the patterns are static and those rules run on every `validate_recipe()` call (131 rules total). ## Requirements **Labels**: `recipe:implementation` ## Implementation Plan Plan file: `/home/talon/projects/autoskillit-runs/impl-20260507-150035-838422/.autoskillit/temp/make-plan/perf_add_cdumper_yaml_hoist_re_compile_plan_2026-05-07_150500.md` 🤖 Generated with [Claude Code](https://claude.com/claude-code) via AutoSkillit <!-- autoskillit:pipeline-signature steps=prepare_pr,run_arch_lenses,compose_pr,annotate_pr_diff,review_pr --> ## Token Usage Summary | Step | Model | count | uncached | output | cache_read | peak_ctx | turns | cache_write | time | |------|-------|-------|----------|--------|------------|----------|-------|-------------|------| | plan | claude-sonnet-4-6 | 1 | 125 | 7.8k | 497.3k | 55.9k | 46 | 46.9k | 2m 54s | | verify | claude-sonnet-4-6 | 1 | 84 | 7.8k | 422.2k | 61.8k | 29 | 49.0k | 2m 26s | | implement* | MiniMax-M2.7-highspeed | 1 | 384.5k | 5.8k | 645.0k | 70.6k | 52 | 51.9k | 2m 18s | | fix | claude-sonnet-4-6 | 1 | 150 | 5.5k | 680.1k | 50.5k | 45 | 37.6k | 8m 44s | | prepare_pr* | MiniMax-M2.7-highspeed | 1 | 101.7k | 5.2k | 329.9k | 35.1k | 25 | 22.7k | 1m 58s | | compose_pr* | MiniMax-M2.7-highspeed | 1 | 66.7k | 1.4k | 265.1k | 29.8k | 18 | 15.1k | 47s | | **Total** | | | 553.3k | 33.5k | 2.8M | 70.6k | | 223.1k | 19m 8s | \* *Step used a non-Anthropic provider; caching behavior may differ.* ## Token Efficiency | Step | LoC Changed | cache_read/LoC | cache_write/LoC | output/LoC | |------|-------------|----------------|-----------------|------------| | plan | 0 | — | — | — | | verify | 0 | — | — | — | | implement | 67 | 9626.8 | 774.1 | 86.1 | | fix | 2 | 340049.5 | 18780.5 | 2760.0 | | prepare_pr | 0 | — | — | — | | compose_pr | 0 | — | — | — | | **Total** | **69** | 41153.0 | 3233.7 | 485.9 | ## Model Usage Breakdown | Model | steps | uncached | output | cache_read | cache_write | time | |-------|-------|----------|--------|------------|-------------|------| | claude-sonnet-4-6 | 3 | 359 | 21.2k | 1.6M | 133.4k | 14m 5s | | MiniMax-M2.7-highspeed | 3 | 553.0k | 12.3k | 1.2M | 89.7k | 5m 3s | --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
Two independent micro-performance fixes: (A) use the C-extension CDumper for YAML writes in
dump_yaml_str()instead of the pure-Python dumper (~5× speedup), mirroring the existing CSafeLoader pattern for reads; and (B) hoist twore.compile()calls from inside@semantic_rulefunction bodies to module-level constants inrules_ci.py, since the patterns are static and those rules run on everyvalidate_recipe()call (131 rules total).Requirements
Labels:
recipe:implementationImplementation Plan
Plan file:
/home/talon/projects/autoskillit-runs/impl-20260507-150035-838422/.autoskillit/temp/make-plan/perf_add_cdumper_yaml_hoist_re_compile_plan_2026-05-07_150500.md🤖 Generated with Claude Code via AutoSkillit
Token Usage Summary
* Step used a non-Anthropic provider; caching behavior may differ.
Token Efficiency
Model Usage Breakdown