Making ast.walk 220x Faster

palashawas 104 points 17 comments June 16, 2026
reflex.dev · View on Hacker News

Discussion Highlights (7 comments)

westurner

Could this ast.sprint ast.walk optimization make libCST or bandit faster? https://news.ycombinator.com/item?id=39111747 libCST: https://github.com/Instagram/LibCST bandit: https://github.com/PyCQA/bandit Links to codemod tools; "Baby Steps into Genetic Programming" https://news.ycombinator.com/item?id=43617655

eska

I appreciate that you first tried to optimize the original Python code. Idiomatic Python is unfortunately disappointingly slow and not so interesting to compare to.

fwip

I wonder if these lints could have been expressed as semgrep rules?

bionhoward

It’s amazing how much Python punishes you for modularizing your code

ozgrakkurt

"AI reflex-app builder" slop alert

anitil

I really enjoy making Python faster. I feel like the sweet spot for me is proving a concept with the dumbest possible implementation to show that something would work, and then using that as a comparison implementation to prove that later improvements match the results of the dumb, obviously correct implementation.

teo_zero

The second part, where it says that Rust is faster than Python, is so obvious than doesn't deserve any further comments. What I found interesting, is that idiomatic Python, with generators and all, can be so much worse than "C-style" Python, if you will pardon that term. It's a pity many kids are taught Python before C...

Semantic search powered by Rivestack pgvector
10,715 stories · 100,765 chunks indexed