kaola-fed / regular-analysis-basis

0 stars 0 forks source link

regular文件大小 #2

Open fengzilong opened 8 years ago

fengzilong commented 8 years ago
src/config.js                0.08KB
src/const.js                 0.39KB
src/env.js                   0.42KB
src/helper/parse.js          0.50KB
src/group.js                 0.50KB
src/index.js                 0.74KB
src/module/timeout.js        1.04KB
src/parser/node.js           1.14KB
src/helper/filter.js         1.48KB
src/directive/event.js       2.06KB
src/helper/shim.js           2.17KB
src/helper/event.js          2.24KB
src/helper/extend.js         2.29KB
src/helper/combine.js        2.89KB
src/directive/base.js        3.23KB
src/helper/diff.js           3.62KB
src/helper/entities.js       4.35KB
src/directive/form.js        4.76KB
src/directive/animation.js   5.59KB
src/helper/animate.js        5.90KB
src/helper/watcher.js        8.22KB
src/parser/Lexer.js          8.51KB
src/dom.js                   10.67KB
src/util.js                  13.07KB
src/walkers.js               17.28KB
src/parser/Parser.js         17.50KB
src/Regular.js               17.94KB

按文件大小升序排,优先分析一些小模块

fengzilong commented 8 years ago
src/config.js                 0.08KB + 0.00KB(依赖) = 0.08KB
src/const.js                  0.39KB + 0.00KB(依赖) = 0.39KB
src/parser/node.js            1.14KB + 0.00KB(依赖) = 1.14KB
src/helper/filter.js          1.48KB + 0.00KB(依赖) = 1.48KB
src/helper/shim.js            2.17KB + 0.00KB(依赖) = 2.17KB
src/helper/entities.js        4.35KB + 0.00KB(依赖) = 4.35KB
src/env.js                    0.42KB + 6.52KB(依赖) = 6.94KB
src/helper/event.js           2.24KB + 6.52KB(依赖) = 8.77KB
src/helper/extend.js          2.29KB + 6.52KB(依赖) = 8.81KB
src/helper/diff.js            3.62KB + 6.52KB(依赖) = 10.14KB
src/util.js                   13.07KB + 0.00KB(依赖) = 13.07KB
src/parser/Lexer.js           8.51KB + 6.52KB(依赖) = 15.04KB
src/helper/combine.js         2.89KB + 19.59KB(依赖) = 22.48KB
src/group.js                  0.50KB + 23.08KB(依赖) = 23.59KB
src/parser/Parser.js          17.50KB + 6.52KB(依赖) = 24.02KB
src/helper/animate.js         5.90KB + 19.59KB(依赖) = 25.49KB
src/helper/parse.js           0.50KB + 29.32KB(依赖) = 29.82KB
src/dom.js                    10.67KB + 19.59KB(依赖) = 30.25KB
src/helper/watcher.js         8.22KB + 29.32KB(依赖) = 37.54KB
src/walkers.js                17.28KB + 36.15KB(依赖) = 53.43KB
src/Regular.js                17.94KB + 53.28KB(依赖) = 71.22KB
src/module/timeout.js         1.04KB + 85.65KB(依赖) = 86.70KB
src/directive/event.js        2.06KB + 92.56KB(依赖) = 94.63KB
src/directive/form.js         4.76KB + 92.56KB(依赖) = 97.32KB
src/directive/animation.js    5.59KB + 92.56KB(依赖) = 98.16KB
src/index.js                  0.74KB + 110.50KB(依赖) = 111.24KB
src/directive/base.js         3.23KB + 110.50KB(依赖) = 113.74KB

考虑依赖后的文件大小排序(一定程度上反映了某个模块的复杂程度),如果一个模块功能很简单,但很大,就要考虑拆分是否合理了,可能它本身就设计得不是很合理,或者它依赖的某个大文件需要继续拆分,比如上面的src/directive/base.js,引入了src/Regular.js,可能也许大概是不太合理的(其实我想说的是肯定,希望不会被打> <)