{"id":35026381,"url":"https://github.com/reflex-dev/fast-walk","last_synced_at":"2026-04-18T07:04:00.639Z","repository":{"id":322732658,"uuid":"1090683457","full_name":"reflex-dev/fast-walk","owner":"reflex-dev","description":"fast ast walk","archived":false,"fork":false,"pushed_at":"2025-11-09T19:30:15.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-21T00:43:29.321Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reflex-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-06T02:03:09.000Z","updated_at":"2025-11-09T19:30:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/reflex-dev/fast-walk","commit_stats":null,"previous_names":["reflex-dev/fast-walk"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/reflex-dev/fast-walk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reflex-dev%2Ffast-walk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reflex-dev%2Ffast-walk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reflex-dev%2Ffast-walk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reflex-dev%2Ffast-walk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reflex-dev","download_url":"https://codeload.github.com/reflex-dev/fast-walk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reflex-dev%2Ffast-walk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31959886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-27T06:26:33.401Z","updated_at":"2026-04-18T07:04:00.633Z","avatar_url":"https://github.com/reflex-dev.png","language":"Rust","readme":"# fast-walk\n\nA fast reimplementation of Python's `ast.walk`, written in Rust.\n\n## Installation\n\n```bash\npip install fast-walk\n```\n\n## Usage\n\nTwo public entry points, depending on whether you care about traversal order:\n\n```python\nimport ast\nfrom fast_walk import walk_dfs, walk_unordered\n\ntree = ast.parse(\"def f(x): return x + 1\")\n\n# Strict depth-first pre-order.\nfor node in walk_dfs(tree):\n    ...\n\n# Implementation-defined order; same node set, faster.\n# ast.walk itself makes no ordering guarantee, so this is a drop-in for most code.\nfor node in walk_unordered(tree):\n    ...\n```\n\n### Which one to use\n\n- **`walk_unordered`** — default choice. Same set of nodes as `ast.walk`\n  but with better cache behavior (batched dict-metadata prefetching).\n  Roughly 25% faster than `walk_dfs` on real Python source.\n- **`walk_dfs`** — pick this only if your code actually depends on\n  depth-first pre-order visitation. `ast.walk` does not document an order,\n  so most callers can safely use `walk_unordered`.\n\n## Performance\n\nBenchmark on CPython 3.13, walking the AST of `difflib.py` (~2000 lines,\n~4300 unique AST nodes), best-of-N run pinned to a single CPU with the\n`performance` governor:\n\n| implementation             | min time | relative |\n| -------------------------- | -------- | -------- |\n| `ast.walk` (stdlib)        | ~2.3 ms  | 1×       |\n| pure-Python equivalent     | ~1.0 ms  | ~2×      |\n| `fast_walk.walk_dfs`       | ~18 µs   | ~130×    |\n| `fast_walk.walk_unordered` | ~13 µs   | ~180×    |\n\nBoth `fast_walk` entry points are semantically equivalent to\n`list(ast.walk(node))` — they return the same set of AST nodes. They\ndiffer only in visit order.\n\n## Development\n\n### Prerequisites\n\n- Rust (latest stable)\n- Python 3.13+\n- [maturin](https://github.com/PyO3/maturin)\n\n### Building from source\n\n```bash\npip install maturin\n\n# Iterative builds (debug profile):\nmaturin develop\n\n# Optimized builds for benchmarking:\nmaturin develop --release\n```\n\n### Running the tests and benchmarks\n\n```bash\n# Correctness + refcount leak tests:\npytest tests/test_refcount.py\n\n# Benchmarks (codspeed, walltime mode):\npytest tests/benchmarks.py --codspeed\n```\n\n## License\n\nMIT\n\n## Links\n\n- [Repository](https://github.com/reflex-dev/fast-walk)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freflex-dev%2Ffast-walk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freflex-dev%2Ffast-walk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freflex-dev%2Ffast-walk/lists"}