News for hackers. Stuff that matters.
Re:Granian – a Rust HTTP server for Python applications by nine_k on Monday January 16, 2023 @08:26PM (#34408029)
PHP was built around this idea for decades %)

Theoretically one could produce ready-to-run, guaranteed clean Python request handlers very quickly. Run all the startup and imports stuff in a Python process, then freeze it. Fork a copy of it on a new request (with COW it's definitely fast), and terminate it normally after that. This would require some care, e.g. to not open sockets before the fork, so that handlers won't share it.

I bet it has been tried, but I'm too lazy to actually search for that.

Re:Granian – a Rust HTTP server for Python applications by laurencerowe on Monday January 16, 2023 @09:19PM (#34408398)
Forking can be quite slow (milliseconds), though there are techniques to speed it up: https://www.cs.purdue.edu/homes/pfonseca/papers/eurosys21-od...

I believe wasmtime can be faster as it doesn’t need to create as many new OS resources and just resets some memory maps.

Only really meaningful for simple request handlers taking a few milliseconds.

Re:Granian – a Rust HTTP server for Python applications by grubby on Tuesday January 17, 2023 @12:57AM (#34409568)
boiler up