Sitecore 8.2 Update 1, hosted in Azure web apps. Noticed that, every first request is very slow to load. After 2nd request, the site loads pretty quick.
We use Glass Mapper map Sitecore templates on to strongly type in our solution.
Some examples on, how we retrieve item and items includes:
To get single item:
var myModel = _contentService.GetEntity<myModel>(renderingContextItem.ToString());
To get sub items:
_contentService.GetEntity<IMenuItem>(navigationRootItemId)
[SitecoreChildren(IsLazy = true)]
public virtual IEnumerable<IMenuItem> SubItems { get; set; }
Ants profiler shows that Glass Mapper GetModel
as HOT path below:
Would be get your thoughts on above implementation and why ANTS profiling is complaining about Glass Mapper.
Update:
Here's the code snippet :
public partial class MenuItemEntity
{
/// <summary>
/// Gets or sets the sub items for a menu item.
/// </summary>
[SitecoreChildren(IsLazy = true)]
public virtual IEnumerable<IMenuItem> SubItems { get; set; }
}
public TModel GetEntity<TModel>(string identity) where TModel : class
{
return _context.GetItem<TModel>(identity);
}
GetEntity<T>
method? The reason could be also the item reads - sitecore.stackexchange.com/questions/4924/…