Fortis Object Mapper Performance
var items = Sitecore.Context.Database.GetItem(new ID("{1FBCAB2D-8444-43FB-916C-951AE3FA244E}")).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 displayNamesFortis = Fortis.Global.SpawnProvider.FromItems<IItemWrapper>(items).Select(item => item.DisplayName).ToList(); | |
sw.Stop(); | |
Response.Write("<h1>Fortis {0}ms</h1>".FormatWith(sw.ElapsedMilliseconds)); |
4716 Items | |
SCAPI 5-12ms | |
Fortis 16-32ms |
This comment has been minimized.
This comment has been minimized.
Nice spot Kam, I completely missed that! I have updated the Gist and results to reflect that! Thanks. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
The code on line 15 isn't reading the display name field, just wrapping the items it looks like?
That said, I'm sure Fortis is also quite fast :)