Cool VS JQuery Templating UI Template

I read this ScuttGu article

to use a custom control to create custom templates.

and this one too

Ecnosia

- the same for performance?

0


a source to share


2 answers


Both samples use JSON, which you get for free when you use .NET Web Services. Thus, the amount of data passing through the wire will be the same.

On the client side, not aware of the performance of the client library generated by the ScriptServiceAttribute , but the differences between how to do it yourself and use this library should probably be minor.

The Ecnosia example uses jTemplates. jTemplates can give you a nice performance boost when it comes to retrieving large lists and displaying them in repeating sections (like html tables).


devmania's answer:



Scott's version applies the server side template and then sends the html + client formatted data. The html can be a real overhead here (in case of a table, think about all the tr, td, style properties, spacing between tags ...).

jTemplates displays the client side. The data is sent in a more efficient and compact JSON format (data only, not html). The template that jTemplates needs to read is also much smaller as it only contains definitions for the first line.

Yes, it's much easier to display the server side. The server side can also be more flexible in rendering as you can access data sources that you don't have on the client side.

The client side can be more efficient in many cases. Also with some javascript you can make it flexible like server side rendering. But I believe that complex client side rendering will take longer.

+1


a source


OK Encosia example (Dave Ward) uses JTemplate JQuery to do its work. ScottGu uses more ASP.Net stack.

However, the ScottGu sample lacks some subtlety.

As far as performance goes ... I hate this question. There are too many variables. But...

The ScottGu example will move more bits along the wire. You are essentially sending all the html output to the browser via a web service call.



The Encosia example sends the most raw data form (JSON) to the browser and then turns it into html using JQuery / JTemplate / Javascript.

In theory, the Encosia example will perform better. Less data moving over the wire should be less load on the server. But it will be more browser work (at best, nominally here).

However, for small amounts of data, I doubt it will matter anyway.

+3


a source







All Articles