Closed MichaReiser closed 1 year ago
This removes the need for copying statements and other nodes during parsing.
This gives me a 4% performance improvement in ruff's parser benchmark (parses a couple of files and traverses the AST)
group main stmt ----- ---- ---- parser/large/dataset.py 1.04 2.6±0.01ms 15.4 MB/sec 1.00 2.5±0.02ms 16.0 MB/sec parser/numpy/ctypeslib.py 1.04 499.8±3.36µs 33.3 MB/sec 1.00 478.8±4.59µs 34.8 MB/sec parser/numpy/globals.py 1.04 51.2±0.76µs 57.6 MB/sec 1.00 49.2±0.45µs 60.0 MB/sec parser/pydantic/types.py 1.04 1100.1±11.99µs 23.2 MB/sec 1.00 1061.7±9.17µs 24.0 MB/sec
This removes the need for copying statements and other nodes during parsing.
Performance
This gives me a 4% performance improvement in ruff's parser benchmark (parses a couple of files and traverses the AST)