
Boost Performance in Umbraco V8 with Efficient Data Querying
Dive into the high-performance querying of data in Umbraco V8 by Paul Seal and Tim Payne. Learn about the history, performance changes from V7 to V8, caching mechanisms, and key conclusions to optimize your Umbraco website. Explore the evolution of content internals, various APIs in V7, performance benchmarks, and significant improvements in V8. Understand the impact of changes in V8, including the introduction of NuCache for storing content. Discover valuable insights to enhance your Umbraco platform's performance and efficiency.
Uploaded on | 1 Views
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
High performance querying of data in Umbraco V8 BY PAUL SEAL AND TIM PAYNE
Paul Seal - from Moriyama @CodeSharePaul Tim Payne @attack_monkey
What are we talking about? A bit of history Performance in V7 Changes in V8 Performance in V8 Caching! Conclusions
Content internals fairly consistent from V4 - 7 Content was cached in the umbraco.config XML file Various APIs sat on top (more added for V6/7) Early days were XSLT and Node based Razor and dynamics added in V6 Strongly typed models added later Examine/Lucene support too
By the end of V7 we have MANY APIs Document API Node API Dynamic Content (also query by XSLT) Typed Content (also query by XSLT) Content Service Examine TypedSearch Umbraco.library (mostly XSLT)
Built a V7 website, 5000 articles, selected everything!
Conclusions for V7 Friends don t let friends use the content service on the front end XPath/XSLT methods are all VERY fast for simple cases LINQ fine if used wisely Examine the best method for any meaningful searching/sorting
Content is now stored in a binary cache called NuCache (lives in /App_Data/TEMP/NuCache) Content API surface GREATLY reduced Content Service Typed Content (can still use XPath) Examine (new version, woohoo)
Interesting notes XPath only made to work for MNTP Every time NuCache is queried, it caches that query in memory There is a NuCache explorer tool which lets you view the NuCache files as JSON There is a V8 package called Our.Umbraco.NuCacheExplorer which lets you view the NuCache files from the backoffice.
Built a V8 website Installed Clean Starter Kit Created 5000 articles Got average times from running each Query Method 1000 times
What we noticed in V8 All of the V8 API methods of searching are way faster than in V7. If you are getting all/latest then it s faster to use the LINQ methods. Examine will perform better on more complicated searches. XPath is surprisingly fast.
Caching Code @using Umbraco.Core.Cache Pass in AppCaches to your constructor, give access to both the Runtime cache and the Request cache Use GetCacheItem extension and pass in function used to hydrate: caches.RuntimeCache.GetCacheItem( latestNews , () => MyService.GetLatestArticles()); To clear the cache item (say on publish): caches.RuntimeCache.ClearByKey( latestNews ); Other methods of clearing are available!
Conclusions LINQ MUCH faster in V8 Examine is still good for searching. More content = be more careful with LINQ XPath sort of works but is not meant to be used in V8 anymore Caching is good but mainly worth it if you are converting the data to models etc.
Links GitHub Repo - https://bit.ly/2TasNoi Tim s V7 Skrift Article - https://bit.ly/3coAy1p NuCache Explorer Tool - https://bit.ly/32Gj9wR Our.Umbraco.NuCacheExplorer - https://bit.ly/2vtNDGh