A simple DOT parser built for my talk Building native Rust modules for Python(video, slides).
This contains two implementations of the same parser, one in pure Python and one as a Rust module bound to Python using PyO3 and rustimport.
poetry installpoetry run pytestThe GitHub Action workflow runs benchmarks on every push to the main branch and also on every pull request using CodSpeed.
This PR changes the default parsing implementations from the pure Python one to the Rust one and shows the performance change between the two. More performance details can be seen directly on the CodSpeed Dashboard
(Note that the performance gain is a bit lesser than in the talk since the number of edges in the graph has been reduced to make the tests run faster)
├── pydot_rs <- the main python module
│ ├── **init**.py <- reexports from both implementations
│ ├── dot_python <- the pure python implementation
│ └── dot_rust <- the rust native module
├── samples <- some DOT graph samples
└── tests <- tests and benchmarks