Reuse loaded component units per request

This commit is contained in:
udo
2026-07-18 05:01:27 +00:00
parent 5e140d6a5a
commit a5ad5042b7
8 changed files with 133 additions and 62 deletions
+2 -2
View File
@@ -543,7 +543,8 @@ struct RequestPropsScope
// probe that loads nothing). No per-mode kinds.
static s32 wasm_resolve_target(String unit_target, String handler, String* resolved_out = 0)
{
String cache_key = handler + "\t" + unit_target;
String current = context ? context->resources.current_unit_file : "";
String cache_key = current + "\t" + handler + "\t" + unit_target;
bool is_exists = (handler == "exists");
auto cached = wasm_component_slots.find(cache_key);
if(cached != wasm_component_slots.end() && !is_exists)
@@ -553,7 +554,6 @@ static s32 wasm_resolve_target(String unit_target, String handler, String* resol
return(cached->second);
}
char resolved[512];
String current = context ? context->resources.current_unit_file : "";
s32 slot = uce_host_component_resolve(
unit_target.data(), unit_target.size(), handler.data(), handler.size(),
current.data(), current.size(),