zoukankan      html  css  js  c++  java
  • jquery,mootools,ext3,prototype对class选择符速度比较

    共1296个元素,结果为:

      ie8 ff 平均值 排名
    extcore3 20.4 6.31 13.355 1
    jquery 25.05 3.79 14.42 2
    prototype 81.09 6.93 44.01 3
    mootools 77.6 19.1 48.33 4

    <script src="firebug/firebug.js" type="text/javascript"></script>

    <script src="jquery-1.3.2.js" type="text/javascript"></script> 
    <!-- <script src="mootools-1[1].2.1-core-nc.js" type="text/javascript"></script>-->
    <!-- <script src="ext-core-debug.js" type="text/javascript"></script>-->
    <!-- <script src="prototype.js" type="text/javascript"></script>-->
    <script type="text/javascript">
        var icount = 0;
        window.onload = function() {
            var begin = new Date();
            var i = $('.aaa').length;                          //jquery
            //var i = Ext.query('.aaa').length;            //ext
            //var i = $$('.aaa').length;                      //mootools,prototype
            console.log("共" + i + "个,用时共:" + (new Date() - begin));
            if (++icount < 100)
                arguments.callee();
           
        }
    </script>

    测试文件及结果明细表

  • 相关阅读:
    126
    125
    124
    123
    122
    121
    120
    119
    洛谷 P5407 【[THUPC2019]历史行程】
    济南清北学堂七日游
  • 原文地址:https://www.cnblogs.com/cola/p/1443704.html
Copyright © 2011-2022 走看看