Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-12657

Improve some Moodle / ADOdb code to get one say... 25% speed increase



    • Database:
    • Affected Branches:


      It seems that ADOdb has some places where code / speed it far from optimal. Basically it's about things like:

      • lowercasing field names for each record in a recordset.
      • fetching field names for each record in a recordset .

      (when they doesn't change along the life of the recordset)

      So Martín Langhoff and team at Catalyst have been doing some great work about measuring and improve current behaviour. Summarizing them, improvements are as follow (copied from email), in approximated numbers:

      • With patches to dmllib/php and setup.php only, we see Oracle twice as fast (takes 50% of the time), and Pg taking only 75% of the time (25% faster?).
      • With patches to adodb, the gains increase a further 10% on Oracle and 20% on Pg.

      In the solution, there are two types of patches (I add the links to the original ones below):

      Moodle patches (causing one 25%-75% improvement by reducing / avoiding tons of strtolower() costly operations), and some new cool debugging information:

      ADOdb patches (causing one 10%-20% improvement by reducing a bunch of repetitive tasks without too much sense inside a recordset) and other minor improvements:

      There are some more patches, but I think these are the core for this bug.

      After some emails, I thing we have ended with one plan that could be this:

      1) Pack M1 and M2 into one new preconfigure_dbconnection()
      2) Apply M3 to code (performance information)
      3) Send ADOdb improvements (A1-A5) to John Lim to get another 10%-20% for Moodle 2.0.

      Any insight about this? I've been playing here with a preconfigure_dbconnection() and I think it shouldn't be really dangerous at all, although we can test in under all DB and all install / upgrade / normal usage situations.

      Jus wanting to share this because differences with only Moodle changes are so interesting that perhaps targeting this to 19_STABLE isn't a wrong idea. That's my opinion.

      Any comment / idea... will be really welcome. And, of course, GREAT job, Catalyst!





            • Assignee:
              stronk7 Eloy Lafuente (stronk7)
              stronk7 Eloy Lafuente (stronk7)
              Component watchers:
              Jake Dallimore, Jun Pataleta, Jake Dallimore, Jun Pataleta, Matteo Scaramuccia, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze, Matteo Scaramuccia, Jake Dallimore, Jun Pataleta
            • Votes:
              0 Vote for this issue
              3 Start watching this issue


              • Created: