Krystal Theme 2.4 - Page loads slow

Krystal Theme 2.4 - Page loads slow

by Claire Browne -
Number of replies: 20

Hi 

I have made some customisations from the following forum https://moodle.org/mod/forum/discuss.php?d=225992 using the 2.4 Krystal theme and noticed that the page loading is horribly long (up to 5 minutes moving from one course to another).

BUT.. when I change my moodle theme to the default formal white page loads are back to normal load within 10 seconds.

I am using Moodle 2.4+ (Build: 20121230) Can anyone help? If you would like I can zip up my theme folder and send it over to someone to test.

Average of ratings: -
In reply to Claire Browne

Re: Krystal Theme 2.4 - Page loads slow

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Hi Claire - you already have my email I think so send it to me and I'll test it - but, as I understand it, you have already taken the awesomebar out, so there is nothing else in the theme as it was released that should be slowing anything down. And I have a recoloured krystle as my main theme in work and it is as fast as any of the other themes on my system smile

Richard

In reply to Richard Oelmann

Re: Krystal Theme 2.4 - Page loads slow

by Claire Browne -

Thanks Richard, is there any server information you would like to know?

Database Oracle 10

In reply to Claire Browne

Re: Krystal Theme 2.4 - Page loads slow

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Hi Claire - I don't have an oracle database to test against, but I've tested your version of krystle on my local host and its page load speeds are under 0.8s every time on mine.

I don't know if anyone else is able to help testing on an oracle database - but with the awesomebar removed, I don't think there are any other database calls in the theme anyway.

cvqokrystle

Richard

In reply to Richard Oelmann

Re: Krystal Theme 2.4 - Page loads slow

by Claire Browne -

Hi Richard,

Thanks for investigating this, we have decided to switch to another theme for when we upgrade to 2.5 because we are unsure why the page load is so slow.

 

Thanks again.

In reply to Claire Browne

Re: Krystal Theme 2.4 - Page loads slow

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Claire - one of the reasons may be that the instructions I gave you to remove the awesomebar in a previous thread prevent the bar from displaying. However, the renderer that creates the awesomebar may still be being called.

If you look in the layout files for the following lines and remove those as well, that may speed up the page times as it will no longer be calling the awesombar renderers (which are not needed as you are not displaying it)

krystle_initialise_awesomebar($PAGE);

and

$topsettings = $this->page->get_renderer('theme_krystle','topsettings');
$awesome_nav = $topsettings->navigation_tree($this->page->navigation);
$awesome_settings = $topsettings->settings_tree($this->page->settingsnav);

In reply to Richard Oelmann

Re: Krystal Theme 2.4 - Page loads slow

by Craig Mackey -

Richard,

we too are experiencing long page load times with the Krystle Theme. We often get the error shown below.

longrunningscript

The page looks like it has loaded then becomes unresposive. The general sequence seems to be: when a page, often with a number of blocks is loading, 2 or 3 (previously docked) blocks go straight into the dock, the body text is in the middle of the page, with a block width margin to the left of the page where the blocks wuld normally display, all of the remaining blocks display on the righthand side of the main content (even some of the ones that are supposed to be docked), then the page seems to stall and is totally unresponsive, then the error above often pops up. Sometimes it goes away quickly by itself, other times you need to click the "stop script" button on the popup. The popup disappears & the page finishes loading almost instantly at times, at which point the body section jumps over to the left, and the other blocks from the right hand side that should have been in the dock now jump into the dock and hide there. The page then functions normally. Once this behaviour starts it generally repeats on every page load. Page loads can be frustratingly slow - especially when the page looks like it has loaded. It can cause problems too if a user clicks on a link - nothing happens, the body section then jumps over to the left, and the click then hits on some other link that is now under the previous mouse position - I have accidently deleted things by accident a few times in this way.

This is quite a frustrating problem and is very dependent on the pc being used. The more powerful the pc, the smaller the effect. Many of our students are using netbooks so they are effected quite significantly. Accross the board at school we are also required to use Internet Explorer by department policy.

This behaviour is most problematic with the Krystle theme, and to a lesser extent Decaf. All of the other themes that I have tried don't seem to behave this way, especially the core themes which all run well - The Krystle theme is by far our preferred theme and we would like to get this issue sorted out if possible.

Our site is Moodle 2.3.8+ (Build: 20130712), Krystle Theme 2013041600 (we have only changed the colours a little and included a site logo via the URL in the theme settings - no code changes at all).

Our server is quite new (Dell R715 (16GB RAM), running Ubuntu 12.04 LTS server, apache2 webserver, php5 version 5.3.10.1.3.7,  postgresql 9.1.9 and APC php accelerator 3.1.7. The server is runnig behind the departments proxy server.

Any ideas?

Thankyou in advance for your assistance.

Regards,
Craig Mackey.

 

In reply to Craig Mackey

Re: Krystal Theme 2.4 - Page loads slow

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Does your Krystal theme use the Awesombar? I know that that can cause page loading issues.

In reply to Mary Evans

Re: Krystal Theme 2.4 - Page loads slow

by Craig Mackey -

yes it does use the awesomebar - one of the features we like about this theme. We use that in lieu of the settings block.

When i switch to Decaf, pages load much more normally, not as fast as core themes but quite usable. 

In reply to Craig Mackey

Re: Krystal Theme 2.4 - Page loads slow

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

In that case try comparing the php code for awesomebar in both themes. It may be that Krystal may be using code which is meant for 2.5, whereas decaf may be more 2.4 specific. I know there were lots of changes and so decafe has lots of different versions to cater for the ever changing world of Moodle.

In reply to Mary Evans

Re: Krystal Theme 2.4 - Page loads slow

by Craig Mackey -

Mary, I would like to disable the Awesome bar to see the effect. How do I go about doing that. I have root access to the server, so editing the files is no problem, though I'm not a php programmer so will need some specific instructions which files & code to modify. I will edit them on my test server before doing so in the production environment though.

 

I thought there may have been a setting to disable the awesome bar in the theme but I couldn't see one - not that I expected one there because the awesomebar is a major feature of the theme.

Thanks again.

In reply to Craig Mackey

Re: Krystal Theme 2.4 - Page loads slow

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

In the main layout files there is a section inside an if statement that has something like if ($this->page->pagelayout != 'maintenance') (from memory so may be a little different, but its something like that).

You need to comment out all the section inside that if statement as that is where the awesomebar is called from

Richard

PS Krystle is (over)due another update to pick up on Paul's latest work on Decaf and the awesomebar, but unfortunately due to commitments in work this is unlikely to happen before late August/Early September.

In reply to Richard Oelmann

Re: Krystal Theme 2.4 - Page loads slow

by Craig Mackey -

Richard,

I found the if statement that you referred to and tried various combinations of commenting out lines (see below) and this is the result that I had most success with. The awesomebar doesn't display on the frontpage, but still appears on the course pages and elsewhere in the site.

To clarify this snip is from fontpage.php in the krystle 2013041600 theme for Moodle 2.3.8

 

Attachment krystlefrontpage-php.PNG
In reply to Craig Mackey

Re: Krystal Theme 2.4 - Page loads slow

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Hi Craig,

That's the right section - I'm glad you were able to find it as I was away on holiday when I replied.

Krystle has both a frontpage.php and a general.php file so you would need to comment out the same section in the general.php file to prevent the awesombar showing on other pages.

Richard

In reply to Richard Oelmann

Re: Krystal Theme 2.4 - Page loads slow

by Craig Mackey -

Richard,

Many thanks - just commented out that code on our production server in both files and the performance boost was immediate & very significant.

Much appreciated.

Craig

In reply to Craig Mackey

Re: Krystal Theme 2.4 - Page loads slow

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Thanks for the feedback Craig.

I'll try to get on to  the update for krystle this weekend if I get chance and see if that makes the situation any better - between working on a theme that uses flexbox for responsiveness, requests for flexi_ii updates, upgrades and mergers in work and 'life' generally smile

In reply to Richard Oelmann

Re: Krystal Theme 2.4 - Page loads slow

by Craig Mackey -

Also could you please have a look at how some of the windows don't popup when previewing/grading quiz questions.

Normally a question preview, manual grading etc. uses a popup window, then hit the close preview when finished and the popup is closed. At the moment there are quite a few situations where the preview or marking box opens in the same window, then finishing the grading/preview closes that window so the Moodle session's window is closed instead of the preview popup.

Thanks again.

In reply to Craig Mackey

Re: Krystal Theme 2.4 - Page loads slow

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Craig - I'll take a look, but I'm not aware of anything in the theme that would stop popups from operating, it might take a bit of work to track that one down if it is in the theme.

In reply to Richard Oelmann

Re: Krystal Theme 2.4 - Page loads slow

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Updated version of krystle - with latest work on awesomebar from Paul - is now on github

https://github.com/roelmann/krystle

Not yet pushed to the database as I'm still testing

Richard

In reply to Richard Oelmann

Re: Krystal Theme 2.4 - Page loads slow

by Craig Mackey -

Great job Richard, the upgraded Krystle theme works very well on Moodle 2.4 so far. I tried it on my 2.3 test server, got a php coding error (didn't write it down sorry) - but upgraded to Moodle 2.4 then had no problems. We were going to upgrade the site anyway so it was not an issue for me when it was OK in 2.4.

Performance of the new theme seems to be quite good, pages load quite well.

In addition the quiz preview popup issue that I mentioned previously seems to be fixed. Previews now have their little popup window so closing them doesn't close the window of the current Moodle session.

Thanks again.
Craig.  smile