You should have more individual macroes I suppose depending on what it is you want to achieve? It makes sense to have a macro to render main navigation a macro for sub navigation, a macro for meta data, a macro for content etc.
However some content could also come from macroes inserted into a rich text editor field.
So in order to be able to better anwer your question could you ellaborate a bit more about details about the site you're building and your thoughts about it? Are you going to be using Razor or XSLT? etc. etc. etc.
Its razor, i was really wondering more about if compile speed would be affected if theres more on one page or whether it would be quicker to just have one big one.
For example if you have a home page which had multiple rotators on of which youd make in a razor macro by getting the nodes etc.
How much would it affect performance to either group all the sliders and page content in one macro in one masterpage, or to put multiple macros in one masterpage.
It would do the same job, and i know what i want to do isnt exactly performance heavy anyway, i just wondered.
Just the way this is set up is more webforms and im used to MVC so im used to a view rather than a masterpage and a seperate view, if that makes sense?
If you are concerned about performance I would cache the Razor Macros using the cache period in the macro settings.
I have found this significantly speeds up content rendering - especially when you are traversing nodes for things like sliders.
You can run into issues if you use the client dependency framework, as the umbraco cached macro's won't inject any javascript into the correct place. but then we split the macro so the client dependency scripts where not cached but the razor that produced the slider was.
Macro Peformance
Doing some work on an 4.11 site
Is it better, performance wise to have one big macro or lots of individual ones?
Hi Ric
You should have more individual macroes I suppose depending on what it is you want to achieve? It makes sense to have a macro to render main navigation a macro for sub navigation, a macro for meta data, a macro for content etc.
However some content could also come from macroes inserted into a rich text editor field.
So in order to be able to better anwer your question could you ellaborate a bit more about details about the site you're building and your thoughts about it? Are you going to be using Razor or XSLT? etc. etc. etc.
/Jan
Its razor, i was really wondering more about if compile speed would be affected if theres more on one page or whether it would be quicker to just have one big one.
For example if you have a home page which had multiple rotators on of which youd make in a razor macro by getting the nodes etc.
How much would it affect performance to either group all the sliders and page content in one macro in one masterpage, or to put multiple macros in one masterpage.
It would do the same job, and i know what i want to do isnt exactly performance heavy anyway, i just wondered.
Just the way this is set up is more webforms and im used to MVC so im used to a view rather than a masterpage and a seperate view, if that makes sense?
If you are concerned about performance I would cache the Razor Macros using the cache period in the macro settings.
I have found this significantly speeds up content rendering - especially when you are traversing nodes for things like sliders.
You can run into issues if you use the client dependency framework, as the umbraco cached macro's won't inject any javascript into the correct place. but then we split the macro so the client dependency scripts where not cached but the razor that produced the slider was.
Kevin
is working on a reply...