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

Furtherly optimize the namespace cache by mapping "virtual" namespaces to their real namespace #2611

Closed
ghost opened this issue Sep 25, 2020 · 0 comments

Comments

@ghost
Copy link

ghost commented Sep 25, 2020

As a somehow extraneous feature of #2599, I am moving the "virtual" namespace (i.e. real namespace + arbitrary number of "sub-namespaces", dot-separated) resolution out of NamespaceService#resolveWorkspaceIdForNamespace and centralizing it in the in-memory, request-scoped NamespaceRequestCache (which is used by the service and a few more).

This way, the resolution can be used in one point from nearly anywhere in the code base (which also allows removing the same identical logic from the UserNamespaceRoleService - since it uses the cache too).

To develop this further on and optimize on a few CPU cycles / stack entries, the idea would be to map the resolved real namespace by virtual namepace name in a new concurrent map in the cache.
That would require moving the recursive logic in another method that retains the "root" virtual namespace name and queries the map with it / puts it in once resolved.

This is a minor/trivial task but given the volume of resolution requests when dealing with a model in a sub-namespace, it is worth implementing soon.

@ghost ghost added the performance label Sep 25, 2020
@ghost ghost self-assigned this Sep 25, 2020
@ghost ghost closed this as completed Sep 30, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants