#1 2014-02-18 05:35:17

SergeyMiracle
Member
Registered: 2014-02-15
Posts: 4

Make it a bit faster.

Great, and i realy mean it, great cms, but why it so so so slow ;(
With 20 articles page renders 1-2 seconds, epmty 0,1 second, and its based on Codeigniter... Hope next release will be faster, good luck.

Offline

#2 2014-02-18 07:46:28

damascus
Member
From: Brisbane, Australia
Registered: 2013-04-08
Posts: 270
Website

Re: Make it a bit faster.

There will always be a tradeoff between ease-of-use and speed, and i agree speed is important but the simple fact of all the content being handled can slow things down at times, especially when you have large numbers of articles and pages.

There are a few ways to help with this, but im no expert and most of them as they would likely involve heavily tinkering with the FTL_Parser (ionize tag reader)

I can say that what ive done on mine is create HTML Rendering code (which i refer to as htmlvc), which i went with after i found that the number of languages has almost no speed impact, but adding 300 articles and pages left me with too high a baseline, even with no content on the page.

I took a look at home the 'maintenance' page is created and retrieved /application/core/Router.php and then created a large amount of code for the interface and content checks - but which boils down to:

1. Hitting up a webpage with php Curl
2. Saving the response to $var
3. Optimizing the response in $var (optional, requires careful formatting, such as wrapping js comments in the view with php tags)
4. Saving $var as a html file (i create a folder under 'applications' and then mirror url path)

Then, when a user hits up that page, in Router.php I:
1. Have usual maintenance mode check, then an else{} where I...
2. check $this->uri->uri_string() against a bunch of conditions, which if it passes...
3. check if a matching html file, if found then...
4. Run through an 'echoBig' php fn using a buffer size limit, and...
5. Have it echo(..) the html file, before...
6. die()


If this sounds too advanced and troublesome for you, then it probably is, and the code is not easily extracted or in its present form able to be called a module (not without heavy tinkering), though most of it has been moved to helpers and a new library class and Router.php is the only core file heavily modified.

I cant use this for my contact page as i used ionize form tags there, and i dont use it for my news pages as they change too much (though i have a news ticker on front page i just update with ajax so i can keep it optimized)

There is alot more to my particular solution aswell, as im running multiple domains off 1 code base i replace internal links, update google analytics trackers and have optional debug and timestamp options so i can see at a glance (in 'view source') if its working fine.

I also have it setup to run easily from command line (and cron when i get the time) and a custom admin view and content date tracking where it tells me what is old, what exists, what doesnt, ect.


Im mostly saying this to help let you know its possible, but not neccessarily saying its for you.

This is just 1 way of speeding up certain pages, and by no means the most efficient of its kind NOR is it really anyway to speed up ionize or codeigniter, as you are left with 'static' content that requires updating.

Also note there is ofcourse the obvious 'web page optimizations' that any decent website speed test will alert you of, but in my case i did those and still had a high baseline.



If anyone has any other ideas for speeding up ionize itself, or in general, please say :-)

Last edited by damascus (2014-02-18 07:54:48)


Webmaster | OneCNC Australia

Offline

#3 2014-02-18 15:54:52

keiichi
Member
Registered: 2013-11-18
Posts: 31

Re: Make it a bit faster.

I don't know how to do speed test on websites, but I thought that being based con CI was really fast, but now SergeyMiracle says that with only 20 articles per page the render time was about 2 seconds...

The option for caching on the backend has no use for this problem? or there are other optimizations we can try?

Offline

#4 2014-02-20 09:50:28

Michel-Ange
Ionize Core Team
From: Paris, France
Registered: 2010-03-22
Posts: 927
Website

Re: Make it a bit faster.

@SergeyMiracle : 2 sec for 20 articles is not normal, it should be as fast as 1 article.

The problem perhaps comes from the views and how the ionize tags are used .

- Do you use a lot of <ion:partial /> ?
- Do you make multiple calls of <ion:articles /> or <ion:article /> instead of nesting them ?

For example :

<!-- Slower : -->

<ion:articles>
  <ion:article:title />
  <ion:article:content />
</ion:articles>

<!-- Faster -->

<ion:articles>
  <ion:article>
    <ion:title />
    <ion:content />
  </ion:article>
</ion:articles>

Inspiration & Innovation : Websites by Partikule, Agence Web Paris

Offline

#5 2014-03-20 05:54:42

damascus
Member
From: Brisbane, Australia
Registered: 2013-04-08
Posts: 270
Website

Re: Make it a bit faster.

All i can say regarding <ion:partial> (feel free to expand or correct me) is that it loads a new instance of the ftl_parser, parses that file, then prints the output

Passing variables and the like wont happen easily, and there is a noticable performance drop when used liberally.

Personally, i still make use of ion:partial for header and footer (though could phase it out of footer, and use ajax or even simple javascript to grab and create the footer menu, as only a tweaked shallower version of the main navigation)

I did use it very often, but as development was wrapping up i removed most and replaced it with comparable code, generally the same code in optimized and clean iterators, with php comments so i could easily find them later if needed.

No idea about the caching system in this case - i have noted first page in a session is slower, and that all pages and articles are loading when first opened, then used later by calling something like

self::registry(..)

I have wondered if providing bounds for all loaded assets (ie, dont bother with pages that i know will never be used for internal links) may actually provide a small boost to performance - as the base-line loading time (without any actual generated content) is highly dependent on the number of articles and pages, of which i have a growing number


Webmaster | OneCNC Australia

Offline

#6 2015-02-11 02:09:00

damascus
Member
From: Brisbane, Australia
Registered: 2013-04-08
Posts: 270
Website

Re: Make it a bit faster.

Backlink to related topic: Ionize CMS rendering time


Webmaster | OneCNC Australia

Offline

#7 2015-08-23 14:21:43

adaliszk
Ionize Friend
From: Germany
Registered: 2010-09-20
Posts: 397
Website

Re: Make it a bit faster.

Hello here again!

Im working on a faster version of Ionize (not officialy accepted yet). Follow the updates on github: https://github.com/adamos42/ionize

If anyone wants to join, just fork it, we can be ready faster. If you're not too experienced, it okay I have lot of simple tasks what I want to do when the main code id done and can be done before it (phpDoc, TestTemplates, etc.)

Why making from skrach?
Because the current code is way more complicated than should be. Simplier solutions can achieve the same goal faster, the current code not realy using codeigniter, most of the code is standalone (which is good, but then why use framework?). The FTL is good library, it should be use as a compiler to compile the ionize tags into native php (and save), not live compile. And also because the current code can't be migrated into CI3.0 without serious rewrite.

It's worth it?
With HipHop I was able to make 15-20k request per second, without HipHop I have ~5k request per second with cache and without cache 1.5k request per second with live mode. It's not the ionize tags yet, but the tags will be compiled as in other Template Engines, so it should not slow down too much.

Join the topic: http://ionizecms.com/forum/viewtopic.php?pid=8687

Last edited by adaliszk (2015-08-23 14:23:29)


Webdeveloper, Programmer, Application developer, Ionize friend
@adaliszk

Offline

#8 2015-09-01 08:38:28

damascus
Member
From: Brisbane, Australia
Registered: 2013-04-08
Posts: 270
Website

Re: Make it a bit faster.

UPDATED LINK (thanks @otemu for spotting that so quick)

backlink to partial performance (contains mega-post of other performance-related links too)

Last edited by damascus (2015-09-02 02:48:29)


Webmaster | OneCNC Australia

Offline

#9 2015-09-01 13:51:06

otemu
Member
Registered: 2014-03-07
Posts: 183

Re: Make it a bit faster.

Link fails damascus

Offline

What's Ionize ?

Ionize is an Open Source Content Management System created by webdesigners for webdesigners.

Created and maintained by Partikule and Toopixel, Ionize wants to be the easiest and most powerful CMS.

Can I help ?

Because talent is nothing without involvement, we are looking for motivated coders and webdesigners to join the project team.

Resources

Website : ionizecms.com
Documentation : doc.ionizecms.com

Development : Ionize on GitHub
Translations : Ionize Translations