Skip to content

Ast to ruff#216

Merged
seddonym merged 8 commits intomasterfrom
ast-to-ruff
May 5, 2025
Merged

Ast to ruff#216
seddonym merged 8 commits intomasterfrom
ast-to-ruff

Conversation

@seddonym
Copy link
Collaborator

@seddonym seddonym commented May 5, 2025

Replaces the use of Python's built in ast module with Ruff's parser. Credit to @Peter554!

The main reason for doing this is to pave the way to move more of the graph building into Rust - but it is also faster right now, especially with multiprocessing turned off. I'm not sure why Codspeed is showing degraded performance.

Based on #214 (which had some conflicts that I needed to resolve).

Comparison

On my local machine, on a large repository, here's a comparison of how long it takes to build the graph.

Existing (AST)

  • No multiprocessing: 45s
  • Multiprocessing: 13s

This branch (Ruff)

  • No multiprocessing: 15s
  • Multiprocessing: 8s

@codspeed-hq
Copy link

codspeed-hq bot commented May 5, 2025

CodSpeed Instrumentation Performance Report

Merging #216 will degrade performances by 14.84%

Comparing ast-to-ruff (dc502f3) with master (810bb16)

Summary

⚡ 2 improvements
❌ 3 regressions
✅ 17 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
test_deep_layers_large_graph_kept 16.3 ms 19.1 ms -14.84%
test_no_chain 1.1 ms 1.2 ms -11.11%
test_no_chains 1.1 ms 1.2 ms -11.08%
test_build_django_from_cache_a_few_misses[15] 381.5 ms 162.2 ms ×2.4
test_build_django_from_cache_a_few_misses[2] 167.8 ms 138.4 ms +21.2%

@seddonym seddonym marked this pull request as ready for review May 5, 2025 11:28
@seddonym seddonym merged commit 8f50d9c into master May 5, 2025
34 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants