Who is faster than mvc2 Templated Helpers or mvccontrib Input Builders

does anyone know which ones are faster?

+2


a source to share


2 answers


The built-in input collector resources are passed through the WebFormView engine. When your app is set to debug = false in your webconfig, the view engine caches the view, so it is only loaded from the assembly once. The real reason the input creators will be a little slower is because they use the master page to reduce the HTML they support. For example, editor templates provide input. The Align Input Builder will create a shortcut, input and html 'chrome' around the two so that you can specify it once and apply to each form using the Input Builder. The input constructors really enforce a convention for how your form markup is created, and it does it in a way that gives you control, but also keeps your html snippets "DRY"(don't repeat yourself).



Like everything, there are trade-offs. For input developers, you produce some runtime performance for developer productivity. At the end of the day, if you need to have a super efficient form on a public website, your best bet would be a static html file server that gets submitted to the MVC action.

+2


a source


Your answer depends on where you are loading your view pages from.

Templated Helpers have a slight advantage because, without redefining the view, they manipulate strings behind the scenes to produce html output.



Input constructors load views through embedded resources or through the traditional filesystem, which will always be slightly slower than hard-coded string manipulation.

The code for both is similar, and basically does the same amount of reflection and metadata processing. Without any complications of loading files or resources, they both run in <1ms. With a custom template source via inline resources or file system calls, your performance loss will be the same for both.

+2


a source







All Articles