3 ms·
Or just use the operating system's `fork` system call? There's also nailgun for Java which sounds like it works a little differently: http://martiansoftware.co
by tlrobinson 9y ago
Or just use the operating system's `fork` system call?
There's also nailgun for Java which sounds like it works a little differently: http://martiansoftware.com/nailgun/ http://martiansoftware.com/nailgun/
- amelius 9y agoI guess a fork()'ed process triggers copy-on-write behavior in the kernel once the process starts running. So that's latency (the copying) you could still optimize away.
- greglindahl 9y agoYou might want to measure it before you optimize it! Oftentimes I find that forks where I don't write much are quite inexpensive, with little COW action.
- amelius 9y agoYou could be right. Also, could it be that Intel's cache hierarchy plays some really smart tricks behind the scenes, to make this fast?
- hawski 9y agoI may be wrong, but I would bet that copy-on-write of pages would be hardly visible for most workloads. Copying is quite fast when you do it in batches (4k per page).
- blattimwind 9y agoA common solution for web application servers ("preforking"). The idea of keeping persistent interpreters doesn't really work for Python because the interpreter is full of state in places you'd never expect -- it's hard to reset the interpreter to a sane state after it ran some unknown program.