Does Rust work quicker than Python on native Python data structures?

Does Rust work quicker than Python on native Python data structures?

EKB PhD

54 года назад

320 Просмотров

I use the PyO3 Rust crate to have Rust loop over a native-Python PyList data structure and insert into a native-Python PyDict. Is it faster than Python? That's the question I answer in this video.

Here's the PyO3 docs on native-Python data types in Rust:
https://pyo3.rs/v0.22.2/conversions/tables

Here's my Rust code (thanks to my son Seth for help with it):
https://github.com/ekbrown/scripting_for_linguists/blob/main/lib_rs_py_native.rs

Here's my Python script:
https://github.com/ekbrown/scripting_for_linguists/blob/main/Script_rs_works_on_native_py_data.py

#rustlang #pythonprogramming #corpuslinguistics
Ссылки и html тэги не поддерживаются


Комментарии: