te')); return $arr; } /* 遍历用户所有主题 * @param $uid 用户ID * @param int $page 页数 * @param int $pagesize 每页记录条数 * @param bool $desc 排序方式 TRUE降序 FALSE升序 * @param string $key 返回的数组用那一列的值作为 key * @param array $col 查询哪些列 */ function thread_tid_find_by_uid($uid, $page = 1, $pagesize = 1000, $desc = TRUE, $key = 'tid', $col = array()) { if (empty($uid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('uid' => $uid), array('tid' => $orderby), $page, $pagesize, $key, $col); return $arr; } // 遍历栏目下tid 支持数组 $fid = array(1,2,3) function thread_tid_find_by_fid($fid, $page = 1, $pagesize = 1000, $desc = TRUE) { if (empty($fid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('fid' => $fid), array('tid' => $orderby), $page, $pagesize, 'tid', array('tid', 'verify_date')); return $arr; } function thread_tid_delete($tid) { if (empty($tid)) return FALSE; $r = thread_tid__delete(array('tid' => $tid)); return $r; } function thread_tid_count() { $n = thread_tid__count(); return $n; } // 统计用户主题数 大数量下严谨使用非主键统计 function thread_uid_count($uid) { $n = thread_tid__count(array('uid' => $uid)); return $n; } // 统计栏目主题数 大数量下严谨使用非主键统计 function thread_fid_count($fid) { $n = thread_tid__count(array('fid' => $fid)); return $n; } ?>javascript - Why is Jquery slower in IE? - Stack Overflow
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Why is Jquery slower in IE? - Stack Overflow

programmeradmin4浏览0评论

I have a plex ASP.NET page that makes heavy usage of jquery for DOM manipulation (no AJAX). The page is faster in Mozilla based browsers (Firefox) pared to IE 7 or 8.

Are there some functions that are optimized for FF?

I have a plex ASP.NET page that makes heavy usage of jquery for DOM manipulation (no AJAX). The page is faster in Mozilla based browsers (Firefox) pared to IE 7 or 8.

Are there some functions that are optimized for FF?

Share Improve this question edited Aug 5, 2009 at 14:59 James McMahon 49.6k69 gold badges211 silver badges288 bronze badges asked Aug 5, 2009 at 14:36 NickNick 7,52521 gold badges79 silver badges129 bronze badges 1
  • You stated in your question that it IS slower, so I've edited the title to better reflect the crux of your question. – James McMahon Commented Aug 5, 2009 at 15:13
Add a ment  | 

4 Answers 4

Reset to default 8

The power is in the javascript processing engine. Unlike serverside processing (PHP, ASP), javascript is client side, meaning that your visitor's browser all have to do the work of rendering the page. Competitors try to get people to switch to their browser by boasting faster processing of things like javascript.

This leads to all the browsers having their own processing engines. Which leads to some browsers being slower. IE:

Internet Explorer doesn't use the Mozilla Engine, so it is considerably slower than Firefox. Internet Explorer is known as one of the slower engines out of all the major browsers.

Firefox is slower than Chrome, which boats one of the highest Javascript Engines (A Modified Version of Webkit).

Safari I believe is currently the fastest rendering engine out there.

You can see more stats on this article from PCWorld, and here

Well, the JavaScript engine itself is faster in Firefox, so that would naturally extend to jQuery being faster.

Web Browser               Average Runtime     Relative
-----------               ---------------     --------
Safari 4.0.2 (530.19.1)        169          1x (fastest)
Chrome 2.0.172.33              349          2.1x slower
Firefox 3.5                    377          2.2x slower
Opera 9.64 (10487)             442          2.6x slower
IE 8.0                         771          4.6x slower

Source: http://celtickane./labs/web-browser-javascript-benchmark/

Some benchmarks on JavaScript by browser: http://celtickane./labs/web-browser-javascript-benchmark/

It's not that things are optimized for FireFox, it's that the JavaScript interpreter in FireFox is heavily optimized as are the engines in Safari and Chrome. Microsoft has neglected browser development for sometime since it won the browser wars and only recently have they started addressing performance issues in IE8 because of their loss of market share.

Here's how things looked for jQuery on various browsers in Sept. 2008. In the first graph, that tall blue bar, the one that's taller than all the others bined, is IE7. That about sums up javascript performance in IE.

发布评论

评论列表(0)

  1. 暂无评论