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>

    测试文件及结果明细表

  • 相关阅读:
    jsp页面a标签URL转码问题
    函数的真面目实例
    野指针和内存操作实例
    redhat安装VMware tools的方法
    线索化二叉树实例
    遍历二叉树实例
    创建二叉树实例
    树的存储结构实例
    树的定义实例
    HBase基础和伪分布式安装配置
  • 原文地址:https://www.cnblogs.com/cola/p/1443704.html
Copyright © 2011-2022 走看看