Repository navigation
perf(exports): retain chart benchmark evidence #1189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
seonghobae
wants to merge
32
commits into
perf/optimize-chart-dict-5599475227084278792
Choose a base branch
from
bolt-optimize-chart-exports-5552507219540780934
base: perf/optimize-chart-dict-5599475227084278792
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 20 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
4870d19
⚡ Bolt: [performance improvement] O(1) deduplication in chart exports
seonghobae 46102d9
Trigger CI retry
seonghobae a8d330c
Trigger CI retry
seonghobae 94cc577
repair(ci): adopt canonical formatter owner by ancestry
seonghobae db491a9
test(exports): require semantic deduplication identifiers
seonghobae b838991
refactor(exports): name ordered deduplication state
seonghobae 75f9916
⚡ Bolt: [performance improvement] O(1) deduplication in chart exports
seonghobae f01b86d
⚡ Bolt: [performance improvement] O(1) deduplication in chart exports
seonghobae e7eca20
test(exports): require complete semantic export contracts
seonghobae 3f81a30
fix(exports): preserve semantic chart contracts
seonghobae 3b9da96
fix(ci): restore canonical supply-chain policy fixture
seonghobae e087e64
Acknowledge test and ci fixes
seonghobae 763a70d
test(chart): reproduce benchmark contract drift
seonghobae 79da102
fix(chart): align benchmark with documented method
seonghobae 1898fc4
Trigger CI retry
seonghobae edbd5d3
Trigger CI retry
seonghobae 884c69a
Trigger CI retry
seonghobae 8c6bcf7
Trigger CI retry
seonghobae 7557259
Trigger CI retry
seonghobae 6484e22
Trigger CI retry
seonghobae 49d6f13
Trigger CI retry
seonghobae fd4efdc
Trigger CI retry
seonghobae a121d56
Trigger CI retry
seonghobae 54ed68c
Trigger CI retry
seonghobae e0dd3d2
Acknowledge measurement constraints
seonghobae 7cfc8d3
Trigger CI retry
seonghobae 8575afd
refactor(exports): stack benchmark evidence on canonical chart owner
seonghobae 2aedc4f
refactor(exports): restack benchmark evidence on repaired chart owner
seonghobae 965f2a0
refactor(exports): inherit canonical formatter stack
seonghobae 528d22b
Trigger CI retry
seonghobae 8da3118
repair(exports): restore benchmark-only evidence lane
seonghobae 0edffa2
refactor(exports): inherit repaired canonical chart owner
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| """Performance benchmarking script for rehearsal chart text and cue exports.""" | ||
|
|
||
| import statistics | ||
| import time | ||
| import tracemalloc | ||
|
|
||
| from bandscope_analysis.exports.chart import build_chart_text, build_cue_sheet_rows | ||
|
|
||
|
|
||
| def make_large_song_fixture(num_sections_count=96, roles_per_section_count=24): | ||
| """Realistic large-song export fixture for benchmarking.""" | ||
| song_sections = [] | ||
| for section_index in range(num_sections_count): | ||
| section_roles = [] | ||
| part_graph_nodes = [] | ||
| for role_index in range(roles_per_section_count): | ||
| role_identifier = f"role_{role_index % 5}" | ||
| section_roles.append( | ||
| { | ||
| "id": role_identifier, | ||
| "name": f"Role Name {role_identifier}", | ||
| "cue": {"value": f"Cue {role_index % 4}"}, | ||
| "rehearsalPriority": f"Priority {role_index % 2}", | ||
| } | ||
| ) | ||
| part_graph_nodes.append({"role_id": role_identifier, "is_active": True}) | ||
|
|
||
| song_sections.append( | ||
| { | ||
| "label": f"Section {section_index}", | ||
| "timeRange": {"start": section_index * 10, "end": section_index * 10 + 5}, | ||
| "roles": section_roles, | ||
| "partGraph": part_graph_nodes, | ||
| "confidence": {"level": "high"}, | ||
| } | ||
| ) | ||
|
|
||
| return { | ||
| "title": "Benchmark Large Song", | ||
| "bpm": 120, | ||
| "key": "C major", | ||
| "feel": "Straight", | ||
| "sections": song_sections, | ||
| "exportSummary": {"headline": "Benchmark"}, | ||
| } | ||
|
|
||
|
|
||
| def chart_export_benchmark(): | ||
| """Execute the large-song performance benchmark and report timing overhead.""" | ||
| benchmark_song = make_large_song_fixture() | ||
|
|
||
| # Warmup | ||
| for _warmup_iteration in range(100): | ||
| build_chart_text(benchmark_song) | ||
| build_cue_sheet_rows(benchmark_song) | ||
|
|
||
| print("Running Benchmark...") | ||
| tracemalloc.start() | ||
|
|
||
| benchmark_iteration_count = 1000 | ||
| export_timings = [] | ||
| total_duration_seconds = 0.0 | ||
| for _benchmark_iteration in range(benchmark_iteration_count): | ||
| benchmark_started_at = time.perf_counter() | ||
| build_chart_text(benchmark_song) | ||
| build_cue_sheet_rows(benchmark_song) | ||
| export_timings.append(time.perf_counter() - benchmark_started_at) | ||
| total_duration_seconds += export_timings[-1] | ||
|
|
||
| _current_allocation_bytes, peak_allocation_bytes = tracemalloc.get_traced_memory() | ||
| tracemalloc.stop() | ||
|
|
||
| print(f"Total time for {benchmark_iteration_count} iterations: {total_duration_seconds:.4f}s") | ||
| print(f"Median time per iteration: {statistics.median(export_timings) * 1000:.2f}ms") | ||
| print(f"P95 time per iteration: {statistics.quantiles(export_timings, n=100)[94] * 1000:.2f}ms") | ||
| print(f"Peak memory overhead: {peak_allocation_bytes / 1024 / 1024:.2f} MB") | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| chart_export_benchmark() | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.