Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve efficiency of key calculation for cache lookups in the model registry #280

Closed
olaf-otto opened this Issue Dec 10, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@olaf-otto
Copy link
Member

olaf-otto commented Dec 10, 2018

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.

profiling

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.

@olaf-otto olaf-otto added this to the 5.0.2 milestone Dec 10, 2018

@olaf-otto olaf-otto self-assigned this Dec 10, 2018

olaf-otto added a commit that referenced this issue Dec 10, 2018

#280 Improve efficiency of key calculation for cache lookups in the m…
…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

olaf-otto added a commit that referenced this issue Dec 10, 2018

Merge pull request #282 from unic/neba-280
#280 Improve efficiency of key calculation for cache lookups
@olaf-otto

This comment has been minimized.

Copy link
Member Author

olaf-otto commented Dec 10, 2018

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.