Avoid repeated warm request dispatch work

This commit is contained in:
udo
2026-07-18 02:32:28 +00:00
parent 72fd0dd53a
commit 339031b6c3
4 changed files with 26 additions and 5 deletions
+5 -1
View File
@@ -68,6 +68,10 @@ static String wasm_backend_ensure_started(Request* context)
}
g_wasm_worker = new WasmWorker(wc);
// Server configuration is finalized before render workers start. Retain one
// native tree so per-request UCEB encoding can reference it without rebuilding
// dozens of identical nodes; the guest still decodes it into fresh state.
g_wasm_worker->server_config_context = cfg;
g_wasm_init_error = g_wasm_worker->init();
if(g_wasm_init_error == "")
g_wasm_init_error = wasm_worker_prepare(*g_wasm_worker);
@@ -156,7 +160,7 @@ String wasm_backend_serve(Request& request, const String& entry_unit, const Stri
ctx[key][entry.first] = entry.second;
};
if(request.server)
copy_map(request.server->config, "server_config");
ctx["server_config"].set_reference(&g_wasm_worker->server_config_context);
copy_map(request.params, "params");
copy_map(request.get, "get");
copy_map(request.post, "post");