Skip to content

Instantly share code, notes, and snippets.



Last active Aug 29, 2015
What would you like to do?
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();
var displayNamesScapi = items.Select(item => item[FieldIDs.DisplayName]).ToList();
Response.Write("<h1>SCAPI {0}ms</h1>".FormatWith(sw.ElapsedMilliseconds));
var displayNamesFortis = Fortis.Global.SpawnProvider.FromItems<IItemWrapper>(items).Select(item => item.DisplayName).ToList();
Response.Write("<h1>Fortis {0}ms</h1>".FormatWith(sw.ElapsedMilliseconds));
4716 Items
SCAPI 5-12ms
Fortis 16-32ms

This comment has been minimized.

Copy link

@kamsar kamsar commented Jun 11, 2015

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 :)


This comment has been minimized.

Copy link
Owner Author

@GuitarRich GuitarRich commented Jun 15, 2015

Nice spot Kam, I completely missed that! I have updated the Gist and results to reflect that!


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment