Forums | Mahara Community

Developers /
Latency smarty header_logo_small

03 May 2019, 3:25 AM

public function header_logo_small() {
          if (!empty($this->headerlogosmall)) {
                    returnget_config('wwwroot') .'thumb.php?type=logobyid&id='.$this->headerlogosmall;
          else {
                    $table = newXMLDBTable('institution');
                    $field = newXMLDBField('logoxs');
                    if (field_exists($table, $field) && $sitelogosmallid = get_field('institution', 'logoxs', 'name', 'mahara')) {
                              returnget_config('wwwroot') .'thumb.php?type=logobyid&id='.$sitelogosmallid;
In this function compare to header_logo, why using ddl.php and newXMLDBTable / Field. It's not ncessary and that's create many latency when i test with a profiler.
Thank You
Robert Lyon's profile picture
Posts: 488

03 May 2019, 12:24 PM

Hi Aurelien,

The reason we have the field_exists() call for when one is upgrading from an older version that field wont exist yet and so breaks site / not allow them to upgrade.

Having said that we should use a more direct test to see if table column exists rather than creating the table / field xml objects and testing via adodb.

As we only use support mysql / postgres we could have a simplified function to do this and hopefully reduce the overhead

I've begun a bug report and created a patch to deal with this.

From my initial tests there does seem to be an improvement in doing the check directly via a database call in both  postgres and mysql



04 May 2019, 12:29 AM

Thank you for your reply,

Good news, i continue my work to try to improve performance.


Kristina Hoeppner's profile picture
Posts: 3768

04 May 2019, 9:42 AM

Hi Aurelien,

It would be wonderful if you tested the change that Robert made at over the course of the development work and checked from your end if you see improvements.

You can use your Launchpad ID to log into the review system and add yourself as reviewer to be notified when changes are made.

Thank you


09 May 2019, 12:22 AM

Hi Kristina,

Here the result for 125 users concurrent in 30 minutes (using Jmeter), see the graphs

Before your modification :


After your modification :


There is a major improvement in response time. We should continue our work to identify where the code consume more ressources and returns a long reponse time.



Kristina Hoeppner's profile picture
Posts: 3768

12 May 2019, 11:29 AM

Thank you for the testing and sharing the results, Aurelien.



6 results