Skip to content

art049/pydot-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pydot-rs

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.

Running the project

Pre-requisites:

  • Poetry
  • A rust toolchain: It's recommended to use rustup to install it

Dependencies

poetry install

Running the tests

poetry run pytest

Performance change

The 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

CodSpeed Report (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)

Repository structure


├── 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

About

A simple DOT parser Rust native module for Python

Resources

Stars

Watchers

Forks

Used by

Contributors

Languages