Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Improve efficiency of key calculation for cache lookups in the model registry #280
In scenarios where a massive amount (i.e., thousands) of different resources are adapted per request (thus no cache hits) and these models are very lightweight, calculation of the key to lookup cached resources tends to account for 30 - 40% the CPU usage of the .adaptTo call.
Here, the retrieval of the sling resource type and the node's primary and mixin type account for most of the CPU usage. This could be optimized by directly retrieving the respective values from the resource's value map instead of using the node API, as the latter will e.g. instantiate type representations, whereas strings do suffice for key calculation.