python-grimp
grimp
BlogDocsChangelog

Cache: Write data map file from rust

#259Merged
Comparing
Peter554:cache-write-data-map-file
(
6e854ec
) with
main
(
558fc35
)
CodSpeed Performance Gauge
-13%
Regressions
1
Untouched
25
Skipped
23

Benchmarks

Skipped (23)

Failed

test_get_import_details
tests/benchmarking/test_benchmarking.py
Regression
CodSpeed Performance Gauge
-13%
153.6 µs177.1 µs

Passed

test_chain_found
tests/benchmarking/test_benchmarking.py::TestFindShortestChain
CodSpeed Performance Gauge
+2%
16.8 µs16.6 µs
test_nominate_cycle_breakers_django
tests/benchmarking/test_benchmarking.py
CodSpeed Performance Gauge
+1%
7.7 ms7.7 ms
test_no_chains
tests/benchmarking/test_benchmarking.py::TestFindShortestChains
CodSpeed Performance Gauge
0%
682.6 µs680.1 µs
test_no_chain
tests/benchmarking/test_benchmarking.py::TestFindShortestChain
CodSpeed Performance Gauge
0%
680.8 µs678.9 µs
test_deep_layers_large_graph_kept
tests/benchmarking/test_benchmarking.py::TestFindIllegalDependenciesForLayers
CodSpeed Performance Gauge
0%
1.6 ms1.6 ms
test_nominate_cycle_breakers_large_graph_root
tests/benchmarking/test_benchmarking.py
CodSpeed Performance Gauge
0%
413 ms413.1 ms
test_copy_graph
tests/benchmarking/test_benchmarking.py
CodSpeed Performance Gauge
0%
79.9 ms80 ms
test_top_level_large_graph_kept
tests/benchmarking/test_benchmarking.py::TestFindIllegalDependenciesForLayers
CodSpeed Performance Gauge
0%
17.7 ms17.8 ms
test_top_level_large_graph_violated
tests/benchmarking/test_benchmarking.py::TestFindIllegalDependenciesForLayers
CodSpeed Performance Gauge
0%
171.6 ms172.3 ms
test_nominate_cycle_breakers_large_graph_subpackage
tests/benchmarking/test_benchmarking.py
CodSpeed Performance Gauge
0%
181.9 ms182.8 ms
test_deep_layers_large_graph_violated
tests/benchmarking/test_benchmarking.py::TestFindIllegalDependenciesForLayers
CodSpeed Performance Gauge
-1%
1.6 ms1.6 ms
test_chains_found
tests/benchmarking/test_benchmarking.py::TestFindShortestChains
CodSpeed Performance Gauge
-1%
86.5 µs87.3 µs
test_build_django_uncached
tests/benchmarking/test_benchmarking.py
CodSpeed Performance Gauge
-1%
154.3 ms155.8 ms
test_find_downstream_modules
tests/benchmarking/test_benchmarking.py
CodSpeed Performance Gauge
-2%
78.4 µs80 µs
test_chains_found_sparse_imports
tests/benchmarking/test_benchmarking.py::TestFindShortestChains
CodSpeed Performance Gauge
-3%
217.7 µs224 µs
test_find_matching_modules
tests/benchmarking/test_benchmarking.py
CodSpeed Performance Gauge
-3%
6.1 ms6.3 ms
test_find_matching_direct_imports
tests/benchmarking/test_benchmarking.py
CodSpeed Performance Gauge
-3%
27.4 ms28.3 ms
test_find_descendants
tests/benchmarking/test_benchmarking.py
CodSpeed Performance Gauge
-3%
38 ms39.3 ms
test_modules_property_many_accesses
tests/benchmarking/test_benchmarking.py
CodSpeed Performance Gauge
-4%
29.8 ms30.9 ms
test_modules_property_first_access
tests/benchmarking/test_benchmarking.py
CodSpeed Performance Gauge
-4%
29.4 ms30.6 ms
test_build_django_from_cache_a_few_misses[350]
tests/benchmarking/test_benchmarking.py
CodSpeed Performance Gauge
-5%
267.8 ms281.3 ms
test_build_django_from_cache_no_misses
tests/benchmarking/test_benchmarking.py
CodSpeed Performance Gauge
-5%
135.6 ms142.6 ms
test_find_upstream_modules
tests/benchmarking/test_benchmarking.py
CodSpeed Performance Gauge
-5%
2.5 ms2.7 ms
test_build_django_from_cache_a_few_misses[2]
tests/benchmarking/test_benchmarking.py
CodSpeed Performance Gauge
-6%
140.2 ms148.3 ms
test_build_django_from_cache_a_few_misses[15]
tests/benchmarking/test_benchmarking.py
CodSpeed Performance Gauge
-6%
145.2 ms154 ms

Commits

Click on a commit to change the comparison range
Base
main
558fc35
-14.08%
Remove eprint! statements Pretty sure these were just added for debugging.
23f35b1
2 months ago
by Peter554
-0.34%
Simplify write method by chaining operations Combine File::create() and write_all() into a single chained expression without intermediate variables, and use map_err for error conversion. This results in more concise and idiomatic Rust code. Addresses PR comment: https://github.com/python-grimp/grimp/pull/259#discussion_r2486635845 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
a25e6df
2 months ago
by Peter554
+2.27%
Implement FromPyObject for ImportsByModule Replace the imports_by_module_to_rust helper function with a more idiomatic Rust approach by implementing FromPyObject trait for an ImportsByModule newtype wrapper. This allows using .extract() directly, making the code more ergonomic and following Rust best practices similar to DirectImport. The new ImportsByModule wrapper encapsulates HashMap<Module, HashSet<DirectImport>> and provides automatic conversion from Python dict objects. Addresses PR comment: https://github.com/python-grimp/grimp/pull/259#discussion_r2486413276 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
c8e353a
2 months ago
by Peter554
-1.08%
Make internal types and functions private Make implementation details private to reduce the public API surface: In filesystem.rs: - RealBasicFileSystem and FakeBasicFileSystem structs - Their inner fields - parse_indented_file_system_string function In import_scanning.rs: - py_found_packages_to_rust function - get_modules_from_found_packages function - scan_for_imports_no_py function - to_py_direct_imports function Only the Python-facing wrapper structs (PyRealBasicFileSystem, PyFakeBasicFileSystem) and the exported Python functions remain public. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
6e854ec
2 months ago
by Peter554
© 2026 CodSpeed Technology
Home Terms Privacy Docs