我正在比较以下两个 TodoMVC 示例的渲染速度:
骨干网 - http://addyosmani.github.com/todomvc/architecture-examples/backbone/
-> (on 1st loading) 14 requests ❘ 62.19KB transferred ❘ 2.01s (onload: 2.10s, DOMContentLoaded: 2.10s) -> (on cache loading) 14 requests ❘ 0B transferred ❘ 176ms (onload: 177ms, DOMContentLoaded: 175ms)
骨干 + RequireJS - http://addyosmani.github.com/todomvc/dependency-examples/backbone_require/
-> (on 1st loading) 19 requests ❘ 73.95KB transferred ❘ 2.57s (onload: 2.57s, DOMContentLoaded: 1.14s) -> (on cache loading) 19 requests ❘ 0B transferred ❘ 224ms (onload: 244ms, DOMContentLoaded: 87ms)
我是否可以这样解释,即使用 RequireJS 会$(document).ready()
尽可能早地被触发,但是页面完成渲染所需的总时间实际上会变得更长?