Memoize more things for linting performance

This commit is contained in:
Slava Kim
2015-06-26 17:46:17 -07:00
parent fa29c70d61
commit ea2503a3cd
2 changed files with 5 additions and 2 deletions

View File

@@ -236,6 +236,9 @@ var lintUnibuild = function (options) {
});
});
// bail out early if there is not much to run
if (! allLinters.length) { return; }
var watchSet = new watch.WatchSet;
var sourceItems = inputSourceArch.getSourcesFunc(sourceExtensions, watchSet);
var wrappedSourceItems = _.map(sourceItems, function (source) {

View File

@@ -1173,7 +1173,7 @@ _.extend(PackageSource.prototype, {
sourceArch.watchSet.merge(projectWatchSet);
// Determine source files
sourceArch.getSourcesFunc = function (extensions, watchSet) {
sourceArch.getSourcesFunc = _.once(function (extensions, watchSet) {
var sourceInclude = _.map(
extensions,
function (isTemplate, ext) {
@@ -1341,7 +1341,7 @@ _.extend(PackageSource.prototype, {
}
return sources;
};
});
});
if (! self._checkCrossUnibuildVersionConstraints()) {