Recently I read this set of posts:
A post from Konstantin Cherkasov claiming Glass to be 2000 times slower than the Sitecore API
A post from Kam showing Synthesis to be 3x slower than the Sitecore API
and finally a post from Richard Seal showing Fortis performance:
In this post I look more into what makes this a fairly useless test in the real world and debunk the idea that Glass Mapper is actually 2000x slower than the Sitecore API.
Mike Edwards (at SUGCON 2015) did an awesome presentation on data modelling (I would highly recommend you check it out if he re-runs it) on the pros and cons of how to model data. Glass Mapper (unlike wrapping frameworks – Synthesis / Fortis) is uses the Data Mapper pattern to represent data. He also wrote a great post here – http://www.glass.lu/Blog/TemplateVsRendering
This gives distinct advantages in the functionality it can provide in terms of its exposure of native .net types, its ability to be able to read / write between databases, control of serialization, non-reliance on code generation, mocking, testing, caching etc.
It does also have the downside of being heavier on instantiation in comparison to simply wrapping the item and performing casts on demand. It is also further away from the originating record. This also means that unlike wrapping frameworks, the number of mapped properties will actually also impact the overall performance.
In a recent project I was working on, I found myself needing a way to be able to get at the rendering parameters and / or datasource of the rendering when using controller renderings. Below is a quick snippet to show one approach of how you can approach this problem. Continue reading
- ‘/App_Config/Include/.Sitecore.Speak.Important.Config’ – make sure this doesn’t have the hidden attribute set. If you need to, remove the ‘.’ prefix to force a refresh
- Double check that all the client assets also don’t have the hidden attribute set.
To test that everything is ok, visit the following URL: <Your_Host>/-/speak/v1/assets/main-1.2.js
You should see the require.js calls setup and loading the libraries necessary for the Sitecore desktop. In another post I’ll cover how you can turn on minification and etags!
Hope this saves you some time!