🦀 Calling Rust from Python 🐍 with PyO3 (Twitch live stream)

Subscribers:
950
Published on ● Video Link: https://www.youtube.com/watch?v=0FTEIBAzRyY



Rust
Game:
Rust (2013)
Duration: 1:11:12
157 views
6


In this live stream, we played a bit with Rust and Python and managed to integrate the two.

We worked on an Advent do Code problem (year 2022 day 19 - https://adventofcode.com/2022/day/19) which was a quite resource intensive one.

Our first python solution was taking 90 seconds to run.

We rewrote the solution in Rust and exposed it to Python as a library using PyO3 (https://pyo3.rs/).

This made our solution much faster already.

Then we also parallelised our solution for another significant performance improvement

Repository: https://github.com/lmammino/pyo3-experiment

PS: Apologies for the low resolution of the shared coding window. It turns out that doing high-quality coding streams is hard and we still have to learn a few things 😅

Chapters:

00:00:00 Intro
00:02:01 Advent of Code 2022/19 exercise assignment
00:05:26 Review of our current Python solution (slow!)
00:13:50 Looking at the PyO3 README and installing it
00:22:01 Rewriting our Advent of Code solution in Rust using PyO3
00:56:29 Calling our solution from Python
00:58:32 Making our Python solution Multithread
01:05:00 Figuring out how to return complex Python types from Rust
01:10:15 Wrapping up

To see the next episodes live check out our Twitch channel: https://twitch.tv/loige

#rust #python #ffi




Other Videos By Luciano Mammino (loige)


2023-08-14Fixing Fullstackbulletin.com part 8 - Twitch Live Stream
2023-07-31Fixing Fullstackbulletin.com part 7 - Twitch Live Stream
2023-07-31Fixing Fullstackbulletin.com part 6 - Twitch Live Stream
2023-07-17Fixing Fullstackbulletin.com part 5 - Twitch Live Stream
2023-07-03Fixing Fullstackbulletin.com part 4 - Twitch Live Stream
2023-06-26Fixing Fullstackbulletin.com part 3 - Twitch Live Stream
2023-06-19Fixing Fullstackbulletin.com part 2 - Twitch Live Stream
2023-06-12Fixing Fullstackbulletin.com part 1 - Twitch Live Stream
2023-05-08Creating Node.js libraries with Rust using Neon (Twitch live stream)
2023-04-18Using Zig from Python 😱 (Twitch Live Stream)
2023-04-03🦀 Calling Rust from Python 🐍 with PyO3 (Twitch live stream)
2023-03-22🦀 Exploring Rust crates zip & image (Twitch live stream)
2023-02-27🦀 Learning Rust web servers with Axum & SQLx (Twitch live stream)
2023-02-21Rust crates: async_stream (Twitch live stream 2023-02-20)
2023-02-13Rust crates: custom serde deserializers (Twitch live stream 2023-02-13)
2023-02-09Rust crates: dotenv, reqwest, url, serde, serde-json (Twitch live stream 2023-02-08)
2023-01-23🦀 Learning Rust web servers with Axum (Twitch live stream)
2023-01-09🦀 Learning nom, a Rust parser combinator library (Twitch stream)
2022-11-30Building a Tic Tac Toe game in Solid.js (Twitch Live Stream 2022-11-30)
2022-11-28🦀 Building a 2D starship game in Rust with Bevy - PART 5 (asteroids)
2022-11-21🦀 Building a 2D starship game in Rust with Bevy - PART 4 (collisions)



Tags:
rust
python
PyO3
Advent of Code
performance optimization
library integration
parallelism
Twitch stream
FFI
programming
GitHub repository
coding
programming languages
systems programming
software development
Rust programming language
Python programming language
Python libraries
Rust libraries
performance benchmarking
resource optimization
computational efficiency
software architecture
code optimization
multi-threading
concurrency
live coding
open source



Other Statistics

Rust Statistics For Luciano Mammino (loige)

There are 1,740 views in 26 videos for Rust. There's over 1 day worth of watchable video for Rust published on his channel, or 20.00% of the total watchable video on Luciano Mammino (loige)'s YouTube channel.