Reuse loaded component units per request
This commit is contained in:
+2
-2
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user