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

Optimisation for backend by caching requests for users. #3842

Merged
merged 10 commits into from
Jul 21, 2015

Conversation

bobdenotter
Copy link
Member

As pointed out by @rossriley: No need to fetch users every single time. This PR fetches them once, and returns from memory if possible. This yields a significant improvement in queries / time taken.

Before:

screenshot 2015-07-20 20 11 16

After:

screenshot 2015-07-20 20 25 29

@bobdenotter
Copy link
Member Author

Would you look at that!

screenshot 2015-07-20 22 10 57

@rossriley
Copy link
Contributor

Can we have 2.2 version too... this is awesome.

@bobdenotter
Copy link
Member Author

@rossriley Surely. I'll backport this to 2.2.x after it has landed.

@GwendolenLynch
Copy link
Contributor

Just a few issues I am looking at 😁

@GwendolenLynch
Copy link
Contributor

@bobdenotter acceptance tests were broken due to the permissions changes. I have modified the flow a bit and it passes locally… So back over to you for approval I guess.

Note: With your original changes, we already know if we have a \Bolt\Content object and isAllowedSingle() only cares about the owner ID at that point anyway, which we will have if either an object of array has been passed into isAllowed() in the first place… so we're not needed to re-request the object at that stage… Query count unchanged.

@bobdenotter
Copy link
Member Author

Hooray for teamwork! 🎉

@bobdenotter
Copy link
Member Author

Booom!

bobdenotter added a commit that referenced this pull request Jul 21, 2015
Optimisation for backend by caching requests for users.
@bobdenotter bobdenotter merged commit eabcd9e into master Jul 21, 2015
@GwendolenLynch GwendolenLynch deleted the feature/cache-users branch July 21, 2015 14:51
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