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

[Core] Add ProjectID Singleton #9343

Merged
merged 1 commit into from
Sep 19, 2024
Merged

Conversation

driusan
Copy link
Collaborator

@driusan driusan commented Sep 19, 2024

This adds a ProjectID singleton and uses it throughout LORIS. The reasoning is similar to CenterID::singleton, the values are often repeated and need to be converted to a class for many function calls, in particular when doing permission checking in batch (ie when querying data in the dataquery module.) By using a singleton, the pressure on the garbage collector is lowered as it's not constantly creating/collecting the same values.

This adds a ProjectID singleton and uses it throughout LORIS.
The reasoning is similar to CenterID::singleton, the values are
often repeated and need to be converted to a class for many
function calls, in particular when doing permission checking
in batch (ie when querying data in the dataquery module.) By
using a singleton, the pressure on the garbage collector is
lowered as it's not constantly creating/collecting the same values.
Copy link
Contributor

@kongtiaowang kongtiaowang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@driusan driusan merged commit 4c178f9 into aces:main Sep 19, 2024
28 checks passed
ZhichGaming pushed a commit to ZhichGaming/Loris that referenced this pull request Nov 25, 2024
This adds a ProjectID singleton and uses it throughout LORIS. The
reasoning is similar to CenterID::singleton, the values are often
repeated and need to be converted to a class for many function calls, in
particular when doing permission checking in batch (ie when querying
data in the dataquery module.) By using a singleton, the pressure on the
garbage collector is lowered as it's not constantly creating/collecting
the same values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants