Performance hit from Entry Url Format with multiple {% if %} clauses? With help from this answer, I've got an Entry Url Format that can include top, 2nd, or 3rd-level categories.  It works for any of these situations:

top-level-category/entry.slug
top-level-category/second-level-category/entry.slug
top-level-category/second-level-category/third-level-category/entry.slug

{% if object.mainCategory.last().level == 3 %}{mainCategory.last().parent.parent.slug}/{% endif %}{% if object.mainCategory.last().level &gt; 1 %}{mainCategory.last().parent.slug}/{% endif %}{mainCategory.last().slug}/{postDate.year}/{slug}


It's ugly, but it works. But I'm wondering if it is slowing things down a bit.  Does anyone have any knowledge in this area?
As far as Craft is concerned whatever is in the Entry URL Format field is just another Twig snippet of code.  It gets rendered down super fast just like any other Twig code.  A few if conditionals aren't going to have any measurable impact on that process.