Concerned about server-side processing

When I run a backtrace (debug_print_backtrace() ) it appears that Kirby returns all content from the entire site just for one page. Would this cause an issue with page speed?

1 Like

As far as I know, Kirby only processes the tree of all pages you access upwards, not downwards if no page is accessed there.
So if you are on the blog/my-blog-post page, all its siblings (other blog posts), the blog overview page, all of its siblings (root level pages) and the site will be loaded. So if you also have a page called projects, it will be loaded because it is a child of the site, but the children of projects will be loaded on demand only as they are unrelated to the blog post.
I might be wrong here however.

Regarding performance: Well, Kirby is fast, so if you don’t have any performance issues, it’s fine, isn’t it? :wink:
If you have performance issues, feel free to tell us about them and we will try to help you.

Here is a clean install of Kirby with a backtrace:
http://www.ibmring92.com/kirby/

It looks like the arrays contain the data from the entire site.

I have invited Bastian to this topic, maybe he knows more about this. :slight_smile:

1 Like

I think, the content files of all visible webpages of the website have to be read to build the main menu, in detail to know their title fields.

right, that makes sense. I didn’t think of that.

Yes. The behavior I have explained above applies for all pages that are accessed on a page view.
If I remember correctly and that hasn’t changed that is. :wink:

I did some testing… about 20 milliseconds or less to process on the server. I can live with that!
http://www.ibmring92.com/kirby/#seconds

1 Like

It looks all fine as far as I can tell. The info from @lukasbestle and @anon77445132 is correct. In case of the starterkit homepage, Kirby fetches the site.txt, the text files of all main menu items and the three projects as well as the home.txt itself.

Kirby might run into speed issues when it needs to process and parse a lot of content folders and text files in order to build a page. But that doesn’t start to become an issue unless you go through a couple hundred pages or even more depending on the disk speed. In general the filesystem is super fast and my experience with even very large sites, is that you hardly need the cache. Take a look at getkirby.com and the repository behind it: https://github.com/getkirby/getkirby.com We run the site without caching and we have tons of subpages — especially for the docs — and it’s still very snappy. This is by far not the biggest site made with Kirby and not the biggest project, I run with it. You also have to think about the costs of scanning text files compared to a database. In many cases it’s also becoming an issue when you have to do a lot of separate database queries in order to render a page, especially on cheap hosting with crappy database servers. But if you are really concerned about performance, I’d suggest you make a real life test with a lot of dummy content, which is closer to what you want to build.

I hope this helps as an answer.

2 Likes

WOW. What more can I can say… the Kirby support team strikes again! Thank you very much for the detailed response, I really appreciate the time and effort you are putting into this product.

3 Likes