Re:Improving Interoperability Between Rust and C++
by dralley on Monday February 05, 2024 @08:22PM
(#39269594)
Why not compile those (python scientific) libraries from source? Why would PyO3 be acceptable while e.g. numpy is not?
Re:Improving Interoperability Between Rust and C++
by MSFT_Edging on Tuesday February 06, 2024 @08:30AM
(#39273975)
needing to compile them on the airgapped machine introduces more dependencies. Things also get weird when your airgapped machine is a slight version off from your dev machine. There's a lot of ways around it but we've found for the size of this tool, it was preferable to just write our own handful of math functions over building out a deployment method for extra dependencies.
We had re-implemented a few mathematical and curve finding functions and even with the newest python they were uncomfortably slow.
PyO3 made it so easy to implement a runtime switchable rust library exposed to python, it was almost unnerving. By writing those handful of functions in rust we got something like a 30x speedup.
Note this was a small project with limited funding for r&d so the level of effort for performance speedup was really nice.