-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Speed up loading menu params #36
Conversation
At a glance something doesn't seem right with this pull request (aside from the CI failures). Part of what the |
In case of loading JSON from string, bindData() is called with recursive=TRUE, allowNull=TRUE so it's effectively copying the input object. The only validation I see in bindData() is checking for empty values, which is disabled in that code path (allowNull=TRUE) and ensuring that nested objects are of type stdClass, which is always true when loading from string. |
The site works normally. I'm not sure I understand the question. The shortcut I'm proposing is not executed when Registry is working on an already existing object - only when an empty object has been created in constructor. |
I'd need to get a data set together and test it to verify everything's fine. I'm not opposed to this PR if it improves performance as you say it does for larger registries, I just want to make sure the data structure doesn't get corrupted along the way. |
Sorry it took so long to get back to this but after doing some tests all seems well. So made a couple tweaks to the empty data property and it's good to go. |
Thanks! When do you think this will land in Joomla, in some 3.5 minor release or in the next major one? |
Probably in 3.6 since they aren't planning anymore 3.5 releases. |
So this breaks the majority of the frontend of the CMS it would appear joomla/joomla-cms#11334 |
Interesting, the patch is running on one installation since the time i opened this PR, no issues at all. On July 28, 2016 9:34:52 PM CEST, George Wilson notifications@github.com wrote:
Sent from my Android device with K-9 Mail. Please excuse my brevity. |
Don't stress - turns out the issue wasn't due to this PR after all :) Should have posted a follow up here. Mea culpa! |
whew good to hear! |
I'm working on improving performance of a Joomla site. I noticed that the longest part of generating a page is JApplicationCms->getMenu(). The query returns 380 menu items, each of them with a larger than usually params column (some extension). JApplicationCms took 1.78s to execute, out of which 1.37s has been spent in 489 calls of Registry::bindData.
Essentially, for menu items, the flow is as following:
I propose that for simple cases like loading a menu item, the flow looks like this:
After my changes, said site takes 0.21s to execute JApplicationCms->getMenu().