fex-team / jello

Front End Integrated Solution for J2EE Velocity.
206 stars 49 forks source link

Jello在linux上打包特别慢,求加快 #34

Open sxpujs opened 9 years ago

sxpujs commented 9 years ago

执行jello打包竟然需要432秒,即6分钟左右,求大神帮忙优化。

打包脚本如下:build-online-complete.sh

#!/bin/sh
cd fe
jello release -r common -copmd output
jello release -r home -copmd output

#maven打包
#...

执行结果如下:

woody@ubuntu:~/workspace/ups-plat$ sh build-online-complete.sh 
[INFO] ------------------------------------------------------------------------
[INFO] FIS build
[INFO] ------------------------------------------------------------------------

 δ 0ms

 Ω .............................. 15556ms

 δ 12ms

 Ω     ...................................................................................................................................................................     432393ms
build package ...

Jello版本

woody@ubuntu:~/workspace/ups-plat$ jello -v

  v1.0.2
oxUnd commented 9 years ago

开压缩了,是否项目中有已经压缩过的?

在 2015年5月30日,下午1:18,sxpujs notifications@github.com 写道:

执行jello打包竟然需要432秒,即6分钟左右,求大神帮忙优化。

打包脚本如下:build-online-complete.sh

!/bin/sh

cd fe jello release -r common -copmd output jello release -r home -copmd output

maven打包

...

执行结果如下:

woody@ubuntu:~/workspace/ups-plat$ sh build-online-complete.sh [INFO] ------------------------------------------------------------------------ [INFO] FIS build [INFO] ------------------------------------------------------------------------

δ 0ms

Ω .............................. 15556ms

δ 12ms

Ω ................................................................................................................................................................... 432393ms build package ... Jello版本

woody@ubuntu:~/workspace/ups-plat$ jello -v

v1.0.2 — Reply to this email directly or view it on GitHub.

sxpujs commented 9 years ago

应该是没有的,不知道为啥会这么慢,如果能有更详细的日志就好了

oxUnd commented 9 years ago

可能你没注意,日志当然是有的;

jello release -opmd output --verbose
sxpujs commented 9 years ago

谢谢,生成的日志文件有几千行,实在不太容易看懂,唉,只能忍了。

oxUnd commented 9 years ago

写到文件里面看啊

sxpujs commented 9 years ago

已经输出到文件了,但是有几千行,太大了,也不容易看懂。

2betop commented 9 years ago

提供个下载地址吧,让我分析分析

sxpujs commented 9 years ago

我分享在百度云盘了,地址如下,非常感谢! http://pan.baidu.com/s/1pJJZmqv

oxUnd commented 9 years ago
 [DEBUG] 02:00:33.0717 compile [/home/woody/workspace/ups-plat/fe/home/widget/china-map/echarts-plain-map.js] start

 [DEBUG] 02:00:33.0718 revert cache

 [DEBUG] 02:00:33.0718 cache is expired

 [DEBUG] 02:00:33.0725 pipe [preprocessor.components] start

 [DEBUG] 02:00:33.0725 pipe [preprocessor.components] end

 [DEBUG] 02:00:33.0725 standard start

 [DEBUG] 02:00:33.0727 standard end

 [DEBUG] 02:00:33.0727 pipe [postprocessor.jswrapper] start

 [DEBUG] 02:00:33.0727 pipe [postprocessor.jswrapper] end

 [DEBUG] 02:00:33.0727 pipe [postprocessor.require-async] start

 [DEBUG] 02:00:33.0730 pipe [postprocessor.require-async] end

 [DEBUG] 02:00:33.0730 pipe [optimizer.uglify-js] start

 [DEBUG] 02:03:35.0588 pipe [optimizer.uglify-js] end

 [DEBUG] 02:03:35.0604 compile [/home/woody/workspace/ups-plat/fe/home/widget/china-map/echarts-plain-map.js] end
 [DEBUG] 02:00:33.0730 pipe [optimizer.uglify-js] start

 [DEBUG] 02:03:35.0588 pipe [optimizer.uglify-js] end

这个文件居然压缩了 3 分钟多,那么问题来了,你这个文件是否是已经被压缩过的? 哦,细看了下是 echart 的 map 数据 这个文件可以不做压缩把,可以单独配置让其关闭压缩,或者你再看看;

2betop commented 9 years ago

通过 roadmap.path 配置 文件 widget/china-map/echarts-plain-map.js 设置 useOptimizer: false 属性,可以节省 3 分钟。

sxpujs commented 9 years ago

仔细看了下echarts-plain-map.js这个文件,有725KB,已经压缩过了,此时再压缩,很有可能会非常慢,这个应该如何优化呢,排除这个文件吗?还是按照2betop的说法来做?

sxpujs commented 9 years ago

fe/home/fis-conf.js中是这样写的:

var workPath = '/home/work/tools/tomcat/webapps/';
var cl = '/home/work/user1/tomcat/webapps/';
var workPath8088 = '/home/work/user2/tomcat/webapps/';

fis.config.set('roadmap.path', [{
    reg: /^\/page\/(.*\.(js|less|css|jpg|jpeg|png|gif))$/i,
    isMod: true,
    release: '${statics}/${namespace}/page/$1',
    url: '${webname}/${namespace}/page/$1',
},
{
    reg: /^\/widget\/(.*\.(js|less|css|jpg|jpeg|png|gif))$/i,
    isMod: true,
    release: '${statics}/${namespace}/widget/$1',
    url: '${webname}/${namespace}/widget/$1'
},

{
    reg: /^\/(static)\/(.*)/i,
    release: '${statics}/${namespace}/$2',
    url: '${webname}/${namespace}/$2'
},
{
    reg: /^\/pkg\/(.*\.(less|css|js|jpg|png|jpeg|gif))$/i,
    isMod: true,
    release: '${statics}/${namespace}/pkg/$1',
    url: '${webname}/${namespace}/pkg/$1'
}].concat(fis.config.get('roadmap.path')));

fis.config.merge({
...

请问有没有办法exclude上面的echarts-plain-map.js,还是得使用非常笨的办法,把各个js文件都加上。