feat: add per-stage compression stats table formatter#20
Open
hugoni-va wants to merge 1 commit intoopen-compress:mainfrom
Open
feat: add per-stage compression stats table formatter#20hugoni-va wants to merge 1 commit intoopen-compress:mainfrom
hugoni-va wants to merge 1 commit intoopen-compress:mainfrom
Conversation
Adds a format_stats_table() utility that renders the per_stage stats dict as a clean CLI table showing token counts, reduction percentage, and timing for each pipeline stage. Useful for debugging which stages are contributing the most compression and identifying bottlenecks. Example output: Stage Before After Saved % ms ────────────────────────────────────────────────────────── RLE 4,200 3,800 400 10.0% 2.1 SemanticDedup 3,800 3,200 600 15.8% 4.3 Ionizer 3,200 1,100 2,100 65.6% 8.7 Total 4,200 1,050 3,150 75.0% 18.4
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
The engine already collects per-stage stats (
original_tokens,compressed_tokens,timing_ms) but there is no built-in way to display them in a human-readable format. This is useful when tuning compression for a specific content type.Changes
claw_compactor.fusion.stats_formatterwithformat_stats_table(stats)functionengine.compress()and returns a formatted table stringshow_skipped=Trueto include stages that did not fireUsage