Just a quick post to show something interesting I discovered with Umbraco 4.7.1.
These 3 if statements do the same thing. However the first 2 turn out to be 2-3 times more expensive in terms of execution time.
if (Model.title == null)
if (Model.title is umbraco.MacroEngines.DynamicNull)
var current = new DynamicNode(Model.Id);
if (current.GetProperty("title") != null)
What's more, is that if you call AnscestorOrSelf() on Model vs current (my instantiated DynamicNode) there is a doubling of those results.
It seems that there is some extra overhead going on with Model.