Skip to content

Commit

Permalink
尝试 watch 性能优化
Browse files Browse the repository at this point in the history
2betop committed Mar 28, 2016
1 parent 1d2c5cb commit 9f95048
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/compile.js
Original file line number Diff line number Diff line change
@@ -865,6 +865,7 @@ function postStandard(file) {
var locked = lockedCheck(file, info.file);
if (!locked) {
lock(file, info.file);
info.file.addLink(file.subpath);
exports(info.file);
unlock(info.file);
addDeps(file, info.file);
@@ -917,6 +918,7 @@ function postStandard(file) {
var locked = lockedCheck(file, info.file);
if (!locked) {
lock(file, info.file);
info.file.addLink(file.subpath);
exports(info.file);
unlock(info.file);
addDeps(file, info.file);
@@ -933,6 +935,7 @@ function postStandard(file) {
case 'dep':
if (file.cache) {
info = fis.project.lookup(value, file);
info.file.addLink(file.subpath);
addDeps(file, info.file);
} else {
fis.log.warning('unable to add deps to file [' + path + ']');
@@ -952,6 +955,7 @@ function postStandard(file) {
var locked = lockedCheck(file, info.file);
if (!locked) {
lock(file, info.file);
f.addLink(file.subpath);
f.isInline = true;
exports(f);
unlock(f);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fis3",
"version": "3.3.21",
"version": "3.3.22",
"description": "fis 3.0",
"main": "index.js",
"bin": {

4 comments on commit 9f95048

@winnieBear
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这次提交导致file.links内容错误,譬如index.html里面link一个css文件index.css,而打包插件得到的 ret对象中,index.css文件的links里面有index.html,这个是错误的,导致某些插件会报错。

@2betop
Copy link
Contributor Author

@2betop 2betop commented on 9f95048 Apr 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是导致了一些 embed 用法的错误,但是你说的打包插件是指哪个?这个修改让 watch 时间节省了一半,所以还是挺有收获的,至于问题我们想办法修复吧。

@nimoc
Copy link

@nimoc nimoc commented on 9f95048 Apr 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@2betop

Mac v10.10
node v4.2.4

Mac 升级新版 fis3 后编译时间快了一倍,但是 Window7 电脑没有啥变化。这次性能优化是只针对 mac 的?

@2betop
Copy link
Contributor Author

@2betop 2betop commented on 9f95048 Apr 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

watch 后的编译时间

Please sign in to comment.