News for hackers. Stuff that matters.
Re:Writing Python inside Rust by kccqzy on Saturday April 18, 2020 @03:25AM (#22905969)
Just fork and exec. Or if you fancy, posix_spawn a separate process. Then communicate over pipes, or if you have a lot of outputs from these tools, collect results from the file system.

Really, where does this fear of spawning things come from?

Re:Writing Python inside Rust by jononor on Saturday April 18, 2020 @03:45AM (#22906033)
Python module loading tends to be quite slow. Loading Tensorflow on our Heroku production environment takes 10 seconds (5 on my laptop). A client of mine running Rust and Python on Embedded Linux device found that loading numpy/pandas modules took over 5 seconds (laptop was under 1), and their computation took just x00 milliseconds. 10x overhead...

So the spawning of a short-lived subprocess approach has massive overhead, only suitable for multi-second workloads.