0.6.0
A CPython worker can run code set once at capture instead of compiling a source
on every request, and a worker restoring ahead rewrites only the memory the last
request wrote. Workers built on py_reactor.wasm need the new build.
- New
wasm_pythonoptionentry. Python source the capture runs once;
it handsworker.set_entrya callable, and a request with nosourcecalls
it with the context. Nothing is compiled or imported per request: the
guest's call went from 40 ms to 2 ms for the same request. A request with a
sourcestill runs it. Seedocs/python.md. - The CPython reactor defines its request runner once, in
init(), so
handle()no longer compiles it per request. - A restore can recycle the last instance's memory.
wasm:restore/3
takesrecycle => true: the destroyed instance of the same image in the same
process gives the next restore its memory, and only the 64 KiB chunks it
wrote are rewritten. A CPython restore goes from 12 ms to 3.9 ms, and a
restore_aheadworker, which recycles on its own, answers about 1.7x the
requests it did. A memory restored this way marks each chunk it writes,
about 4 ns a store in generated code; everything else pays a field test.
Generated code is ABI 5, so the compiled tier's disk cache is rebuilt once. - A restore no longer evaluates the element segments the image
overwrites. - The context reaches the CPython reactor through a
worker.context
import. The reactor importsworker.contextandworker.context_size,
so an adapter of your own overpy_reactor.wasmhas to bind both; images
of the previous build are not restored (versionpy-reactor-2).