Johan Björnfot
Jan 4, 2011
  6103
(3 votes)

Performance improvements in CMS6R2

Magnus Stråle has already discussed one of the performance changes made in CMS 6 R2 to Dynamic Properties in this post.

Another performance improvement in CMS6R2 is the way we “batch load” pages. To clarify what this means I will give you a short description of how the algorithm for GetChildren works.

  1. Call GetChildrenReferences to get the references (the list is either delivered from cache or from database in one database call)
  2. Get available pages from cache.
  3. Get pages not found in cache from database.
  4. Use the passed in language selector to ensure children are returned in correct language (according to language fallback rules etc.)

What has changed in R2 is the load of pages from the database (step 3). Previously we loaded all available languages for each page and then we used the language selector to filter out the language to return. Now we only load the page for the master language (this has to be loaded since the language neutral properties are stored on that page) and for the requested language (in case it is different from master language version). The effect of the change is that GetChildren will return faster when all pages are not in cache and the performance gain is greater the more languages that exist for a site (for a site with a single language it will have no effect).

Another effect of this change is that the used memory (in this case pages in cache) will be less for the application due to that unused language versions of pages are not loaded. There are some rare situations where the new implementation might perform slower than the old implementation. One such case would be when requesting children for a language that has few pages and where there is a fallback defined to another language that is not the master language.

Below are some comparison figures between CMS6 and CMS6R2 that compare the time to expand nodes in the edit tree. In my test I used a structure with ~1000 pages on two languages. I ran the test by first resaving web.config (to empty the cache) and then expand nodes in the tree and measuring the time for the ajax request to get the child nodes. The test shows that the new implementation returns around 20% faster.

expandnode

There is also a new method added to DataFactory called GetPages that makes it possible to get a set of pages in a batch. The method works in the same way as GetChildren meaning it first checks the cache for pages and then loads missing pages in one batch. The implementation of FindPagesWithCriteria has been changed so it uses this method (previously it called GetPage for each page in the result set from the query). This means FindPagesWithCriteria will also perform better in the cases where not all pages are in the cache (thanks to Lee Crowe for the suggestion for this). When I tested with a criterioin that got around 300 hits (with the cache empty) the FindPagesWithCriteria  call was ~40% faster in CMS6R2 than in CMS6.

Jan 04, 2011

Comments

Jan 4, 2011 01:53 PM

Hi Johan

This is excellent and thanks for following up my suggestion for performance enhancements for FindPagesWithCriteria.

Lee

Joel Abrahamsson
Joel Abrahamsson Jan 5, 2011 12:32 AM

Thumbs up for GetPages! And for the other improvements as well of course, but GetPages might prove really useful!

Jan 5, 2011 12:48 AM

Nice! Sounds like some good updates to improve performance and a well written blog to explain it.

Please login to comment.
Latest blogs
Opti ID overview

Opti ID allows you to log in once and switch between Optimizely products using Okta, Entra ID, or a local account. You can also manage all your use...

K Khan | Jul 26, 2024

Getting Started with Optimizely SaaS using Next.js Starter App - Extend a component - Part 3

This is the final part of our Optimizely SaaS CMS proof-of-concept (POC) blog series. In this post, we'll dive into extending a component within th...

Raghavendra Murthy | Jul 23, 2024 | Syndicated blog

Optimizely Graph – Faceting with Geta Categories

Overview As Optimizely Graph (and Content Cloud SaaS) makes its global debut, it is known that there are going to be some bugs and quirks. One of t...

Eric Markson | Jul 22, 2024 | Syndicated blog

Integration Bynder (DAM) with Optimizely

Bynder is a comprehensive digital asset management (DAM) platform that enables businesses to efficiently manage, store, organize, and share their...

Sanjay Kumar | Jul 22, 2024