gabriel / muse public
perf BREAKING dev
AI Agent gabriel · 158 days ago · Apr 19, 2026 · Diff

perf: CallGraphCache — 2700x speedup on warm build_forward_graph (6295ms → 2ms)

sha256:75e62a8cb106279baea02aed0e39b106a85d0c012dc964861ecb4b3869f6bbca sha
+86 ~1 symbols
sha256:764fb670b7cdbb4e55dc7ab262d0464ea12a2d3200b143e1c065a681cc65b2b2 snapshot
+86
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 87 symbols
~ muse/core/callgraph_cache.py .py 19 symbols added
+ CallGraphCache class class CallGraphCache L90–227
+ __init__ method method __init__ L107–114
+ empty method method empty L166–168
+ get method method get L174–176
+ load method method load L121–163
+ prune method method prune L183–193
+ put method method put L178–181
+ save method method save L204–227
+ size method method size L196–198
+ _CACHE_FILENAME variable variable _CACHE_FILENAME L84–84
+ _CACHE_VERSION variable variable _CACHE_VERSION L83–83
+ _Subgraph variable variable _Subgraph L87–87
+ annotations import import annotations L72–72
+ logging import import logging L74–74
+ msgpack import import msgpack L77–77
+ pathlib import import pathlib L75–75
+ read_msgpack_file import import read_msgpack_file L79–79
+ load_callgraph_cache function function load_callgraph_cache L230–239
+ logger variable variable logger L81–81
~ tests/test_callgraph_cache.py .py 66 symbols added
+ TestBuildForwardGraphWithCache class class TestBuildForwardGraphWithCache L416–589
+ _repo method method _repo L419–421
+ test_build_does_not_call_cache_save method method test_build_does_not_call_cache_save L544–558
+ test_cache_miss_calls_read_object method method test_cache_miss_calls_read_object L452–470
+ test_cache_populated_after_build method method test_cache_populated_after_build L472–486
+ test_cache_subgraph_has_correct_callees method method test_cache_subgraph_has_correct_callees L488–506
+ test_cold_cache_none_correct_graph method method test_cold_cache_none_correct_graph L423–432
+ test_explicit_cache_hit_skips_read_object method method test_explicit_cache_hit_skips_read_object L434–450
+ test_non_python_files_not_cached method method test_non_python_files_not_cached L528–542
+ test_second_call_skips_ast_parse method method test_second_call_skips_ast_parse L574–589
+ test_syntax_error_file_not_cached method method test_syntax_error_file_not_cached L560–572
+ test_warm_graph_equals_cold_graph method method test_warm_graph_equals_cold_graph L508–526
+ TestCallGraphCacheGracefulLoad class class TestCallGraphCacheGracefulLoad L312–380
+ test_absent_file_returns_empty method method test_absent_file_returns_empty L315–318
+ test_corrupt_file_returns_empty method method test_corrupt_file_returns_empty L320–324
+ test_entry_subgraph_not_dict_skipped method method test_entry_subgraph_not_dict_skipped L370–380
+ test_entry_with_non_str_callee_skipped method method test_entry_with_non_str_callee_skipped L358–368
+ test_invalid_entry_skipped_valid_survive method method test_invalid_entry_skipped_valid_survive L340–356
+ test_non_dict_entries_returns_empty method method test_non_dict_entries_returns_empty L333–338
+ test_wrong_version_returns_empty method method test_wrong_version_returns_empty L326–331
+ TestCallGraphCacheMemory class class TestCallGraphCacheMemory L105–207
+ test_different_ids_independent method method test_different_ids_independent L130–138
+ test_empty_get_miss method method test_empty_get_miss L108–111
+ test_empty_save_is_noop method method test_empty_save_is_noop L186–191
+ test_empty_subgraph_is_valid method method test_empty_subgraph_is_valid L193–198
+ test_frozensets_preserved_in_subgraph method method test_frozensets_preserved_in_subgraph L200–207
+ test_prune_marks_dirty_when_stale method method test_prune_marks_dirty_when_stale L170–176
+ test_prune_no_stale_not_dirty method method test_prune_no_stale_not_dirty L178–184
+ test_prune_removes_stale_entries method method test_prune_removes_stale_entries L161–168
+ test_put_marks_dirty method method test_put_marks_dirty L123–128
+ test_put_same_id_overwrites method method test_put_same_id_overwrites L140–148
+ test_put_then_get_hit method method test_put_then_get_hit L113–121
+ test_size_grows_with_put method method test_size_grows_with_put L154–159
+ test_size_starts_zero method method test_size_starts_zero L150–152
+ TestCallGraphCachePerformance class class TestCallGraphCachePerformance L597–668
+ _build_repo method method _build_repo L600–614
+ test_graph_correctness_not_degraded_by_cache method method test_graph_correctness_not_degraded_by_cache L650–668
+ test_warm_cache_at_least_5x_faster method method test_warm_cache_at_least_5x_faster L616–633
+ test_warm_cache_under_100ms_for_30_files method method test_warm_cache_under_100ms_for_30_files L635–648
+ TestCallGraphCachePersistence class class TestCallGraphCachePersistence L215–304
+ test_atomic_write_no_tmp_leftover method method test_atomic_write_no_tmp_leftover L298–304
+ test_multiple_entries_survive_round_trip method method test_multiple_entries_survive_round_trip L281–296
+ test_round_trip_preserves_frozenset_type method method test_round_trip_preserves_frozenset_type L244–253
+ test_save_clears_dirty_flag method method test_save_clears_dirty_flag L262–268
+ test_save_creates_file method method test_save_creates_file L218–224
+ test_save_no_dirty_skips_write method method test_save_no_dirty_skips_write L255–260
+ test_save_then_load_round_trip method method test_save_then_load_round_trip L226–242
+ test_second_save_is_noop method method test_second_save_is_noop L270–279
+ TestLoadCallGraphCache class class TestLoadCallGraphCache L388–408
+ test_no_muse_dir_returns_empty method method test_no_muse_dir_returns_empty L391–393
+ test_with_empty_muse_dir_returns_empty method method test_with_empty_muse_dir_returns_empty L405–408
+ test_with_muse_dir_loads_existing method method test_with_muse_dir_loads_existing L395–403
+ _Subgraph variable variable _Subgraph L55–55
+ _make_manifest function function _make_manifest L83–90
+ _muse_dir function function _muse_dir L63–66
+ _subgraph function function _subgraph L93–97
+ _write_py function function _write_py L69–80
+ Manifest import import Manifest L52–52
+ annotations import import annotations L41–41
+ hashlib import import hashlib L43–43
+ msgpack import import msgpack L48–48
+ patch import import patch L46–46
+ pathlib import import pathlib L44–44
+ pytest import import pytest L49–49
+ time import import time L45–45
+ write_object import import write_object L51–51
~ muse/plugins/code/_callgraph.py .py 1 symbol added, 1 symbol modified
+ CallGraphCache import import CallGraphCache L40–40
← Older Oldest on dev
All commits
Newer → Latest on dev

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:75e62a8cb106279baea02aed0e39b106a85d0c012dc964861ecb4b3869f6bbca --body "your comment"