Comments

edited

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.

…odel registry
Extracted efficient retrieval of resource type information to NodeUtil
Updated to the current mockito version and updated imports and unused stubbing with regard to the update.
Fixed minor typos and unused throw declarations where applicable