SpiderMonkey shares some data, such as the self-hosting compartment and read-only atoms, between runtimes - but only if a parent runtime is passed when calling JS_NewRuntime. This is important for both memory usage and performance: compiling the self-hosted JS takes more than 30ms on a desktop machine, so doing that every time, say, a worker is created is quite wasteful.
SpiderMonkey shares some data, such as the self-hosting compartment and read-only atoms, between runtimes - but only if a parent runtime is passed when calling
JS_NewRuntime
. This is important for both memory usage and performance: compiling the self-hosted JS takes more than 30ms on a desktop machine, so doing that every time, say, a worker is created is quite wasteful.r? @nox
This change is