Skip to content

Commit 5208c28

Browse files
committed
Added Cython - closes #9
1 parent 9ca39d4 commit 5208c28

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

README.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,13 +531,29 @@ test_itertools 49,080.8640 (168.03) 51,016.5230 (160.55) 49
531531
----------------------------------------------------------------------------------------------------
532532
```
533533
534+
And there is also a **Cython** implementation by [MIke Fletcher](https://github.com/mcfletch) in the branch `cython` https://github.com/rochacbruno/rust-python-example/tree/cython
535+
536+
with the results:
537+
538+
539+
```bash
540+
----------------------------------------------------------------------------------------------------
541+
Name (time in us) Min Max Mean
542+
----------------------------------------------------------------------------------------------------
543+
test_rust_bytes_once 336.7590 (1.0) 806.2610 (1.0) 346.5317 (1.0)
544+
test_cython 756.1610 (2.25) 2,343.3680 (2.91) 785.6455 (2.27)
545+
test_c_swig_bytes_once 802.4250 (2.38) 1,632.4290 (2.02) 840.8603 (2.43)
546+
----------------------------------------------------------------------------------------------------
547+
```
548+
549+
534550
# Conclusion
535551
536-
Back to the purpose of this post "How to Speed Up your Python with Rust" we started with:
552+
Back to the purpose of this post **How to Speed Up your Python with Rust** we started with:
537553
538-
- **Pure Python** function taking **102 ms**.
539-
- Improved with **Numpy** (which is implemented in C) to take **3 ms**.
540-
- Ended with **Rust** taking **1 ms** (just like numba version).
554+
- **Pure Python** function taking **102 **.
555+
- Improved with **Numpy** (which is implemented in C) to take **3**.
556+
- Ended with **Rust** taking **1** (just like numba version).
541557
542558
In this example **Rust** performed **100x** faster than our **Pure Python**.
543559

0 commit comments

Comments
 (0)