JQuery Templates Performance Testing

    imageAs we all know, Microsoft picked up and released some of its stuff under a free MIT license. Among them were their new jQuery plugins. The plugins turned out to be so powerful that the "independent" community decided to include the so-long-requested template functionality in the main library ( here ). Nonsense! Furor! Or ... Or are there any other reasons? We will not find out, but rather look at the comparative tests of this library, and think about whether we really need it.

    It all started with the fact that I tried the template library in my new functionality. I was discouraged. The system was so slow that I climbed to see if a virus, or other demonic creature, had populated the process. Everything turned out to be clean, and then I decided to compare the performance of the library with other options.


    So we meet the contestants
    • Microsoft Template: Page
    • PureJSTemplate: leftovers at plugins.jquery.com
    • Crooked arms: Adding span one at a time: $ (" ") .text (..). AppendTo (..)
    • Straight arms: Adding a span string formed through gluing an array

    Test method
    1. Score a thousand spans in a div
    2. Compare time
    3. Draw conclusions
    4. ???
    5. Profit

    Analyzed Browsers
    • Internet Explorer 8
    • Mozilla 3.6.12
    • Chrome 8. How quickly time flies, I remember it in the first version, but IE already caught up with it, it will soon overtake the opera.
    • Opera 10.63



    • MS's new template engine is an average of 29 times slower if everything were handled.
    • In the case of the Opera, it is comparable, in performance, with crooked hands, for which, IMHO, it is necessary to drive yours ...
    • Existing PureJSTemplate in some tests turned out to be comparable with straightened arms. And in some cases it’s faster, which, in general, is strange.
    • PureJSTemplate in IE8 shows very strange results compared to other plugins.
    IMHO conclusions
    • The absolute winner in all tests recognized Chrome, who would doubt it.
    • IE8 is surprisingly comparable to Opera. Personally, I am in shock.
    • Understanding my paranoia, I think that Microsoft deliberately released a slowed-down product in order to intimidate the AJAX application market.
    • No need to tell me about the convenience and separation of design and code. Everything has a limit. It would be better to modify PureJSTemplate so that you do not need to create your own textbox for each template, and so that it is not necessary to indicate where to get the result.

    PS Check on your computer here . Well, or test on jsfiddle.net

    PSS Posted a test on jsperf.com

    Also popular now: