? Success

User tests: Successful: Unsuccessful:

avatar gjedeer
gjedeer
26 Oct 2015

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:

  • JMenu loads data rows, params is a JSON string
  • JRegistry loadString() converts this string to an object
  • JRegistry bindData() converts that object to an array
  • JRegistry bindData() creates a new object, iterates over the array and copies keys as object properties
  • The newly created object is returned

I propose that for simple cases like loading a menu item, the flow looks like this:

  • JMenu loads data rows, params is a JSON string
  • JRegistry loadString() converts this string to an object
  • The object is returned

After my changes, said site takes 0.21s to execute JApplicationCms->getMenu().

avatar gjedeer gjedeer - open - 26 Oct 2015
avatar gjedeer gjedeer - change - 26 Oct 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 26 Oct 2015
Labels Added: ?
avatar mbabker
mbabker - comment - 26 Oct 2015

This needs to be sent as a pull request to the Framework's Registry package repo at https://github.com/joomla-framework/registry

avatar gjedeer
gjedeer - comment - 26 Oct 2015
avatar gjedeer gjedeer - change - 26 Oct 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-10-26 17:56:55
Closed_By gjedeer
avatar gjedeer gjedeer - close - 26 Oct 2015

Add a Comment

Login with GitHub to post a comment