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

Adding a local thread registry to store local caches. #10250

Merged
merged 1 commit into from
Apr 17, 2013

Conversation

wangjohn
Copy link
Contributor

I've added a registry to store local caches. This should decrease the number of thread locals a lot because currently, every time you create a new local cache, you create a new thread local.

I'm using the PerThreadRegistry module to create a single registry object.

@@ -151,16 +168,16 @@ def thread_local_key
end

def local_cache
Thread.current[thread_local_key]
Copy link
Member

Choose a reason for hiding this comment

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

Can we rename this thread_local_key to local_cache_key?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just renamed it, thanks!

rafaelfranca added a commit that referenced this pull request Apr 17, 2013
Adding a local thread registry to store local caches.
@rafaelfranca rafaelfranca merged commit 87fddba into rails:master Apr 17, 2013
@wangjohn wangjohn deleted the local_cache_registry branch April 17, 2013 18:28
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.

None yet

3 participants