Shortcode Performance Impact

Hey Guys,

Can someone explain to me how the regeneration mechanism works when using shortcodes. I basically plan on creating quite a few shortcodes for every different content type (image, calendar, form, etc.). Considering there will probably be well over 20 different shortcodes, I’m wondering what kind of performance impact there will be when a build happens if any of the top level content changes (ex: menu, header partial, etc.). Will hugo run through a regeneration of all the shortcodes for every page or will the previously generated shortcodes on every page simply be extracted and reused in the newly generated page in order to save on processing time? All this considering the shortcode itself has not changed.

Let me know if my question is unclear.

Thanks in advance.

Everything, including the shortcodes, is regenerated every time.

It’s fast.

Some kind of caching on different levels will probably eventually happen, but it gets complicated pretty fast.

Added note:

The shortcode handling was rewritten in Hugo 0.13 - speed was one motivation.

I did some benchmarks with lots of big pages with many shortcodes, and I believe it will handle your use case very snappy.

Thanks a lot buddy. Hugo is awesome so far. Really appreciate the work you guys put into it.