/rust_python

rust_python

Primary LanguageRust

About

Just experimenting with calling python from Rust to see if it would be viable to use as an embedded scripting language from Rust. I might not be doing this optimally, but it turns out that iterating 3300 times and appending to a list (not doing anything else) takes around 2.3 ms on my machine from python.

Given that we are doing nothing else, this is horrible performance. Doing the same from rust takes around 7.9 µs.

[ PY ] Updating the game!
[ RS ] calling game_update took: 3.56µs
[ PY ] This line was printed from game_render in python!
[ RS ] calling game_render took: 2.181488ms
[ RS ] handling renderer commands took: 30ns
[ RS ] Doing the same as game_render does but in rust took: 7.761µs