Created
June 11, 2015 13:30
-
-
Save kamsar/f2aa92ef3f63f3c7b931 to your computer and use it in GitHub Desktop.
Synthesis mapping performance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var items = Sitecore.Context.Database.GetRootItem().Axes.GetDescendants(); | |
Response.Write("<h1>{0} Items</h1>".FormatWith(items.Length)); | |
var sw = new Stopwatch(); | |
sw.Start(); | |
var displayNamesScapi = items.Select(item => item[FieldIDs.DisplayName]).ToList(); | |
sw.Stop(); | |
Response.Write("<h1>SCAPI {0}ms</h1>".FormatWith(sw.ElapsedMilliseconds)); | |
sw.Restart(); | |
var displayNamesSynthesis = items.AsStronglyTypedCollection().Select(x => x.DisplayName).ToList(); | |
sw.Stop(); | |
Response.Write("<h1>Synthesis {0}ms</h1>".FormatWith(sw.ElapsedMilliseconds)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5148 Items | |
SCAPI 20ms | |
Synthesis 57ms |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment