Merge branch 'pr/5747' into devel

This makes the Meteor command line tool no longer load parts of the
package catalog from SQLite on app reloads, unless the actual app
dependencies have changed.
This commit is contained in:
Avital Oliver
2015-12-16 21:18:31 -08:00
2 changed files with 19 additions and 6 deletions

View File

@@ -148,7 +148,19 @@ CS.Input.prototype.isEqual = function (otherInput) {
// This equality test is also overly sensitive to order,
// missing opportunities to declare two inputs equal when only
// the order has changed.
return _.isEqual(a.toJSONable(), b.toJSONable());
// Omit `catalogCache` -- it's not actually part of the serialized
// input object (it's only in `toJSONable()` for tests).
//
// Moreover, catalogCache is populated as-needed so their values for
// `a` and `b` will very likely be different even if they represent
// the same input. So by omitting `catalogCache` we no longer need
// to reload the entire relevant part of the catalog from SQLite on
// every rebuild!
return _.isEqual(
_.omit(a.toJSONable(), "catalogCache"),
_.omit(b.toJSONable(), "catalogCache")
);
};
CS.Input.prototype.toJSONable = function () {

View File

@@ -56,11 +56,6 @@ CS.PackagesResolver.prototype.resolve = function (dependencies, constraints,
'upgradeIndirectDepPatchVersions'));
});
Profile.time(
"Input#loadFromCatalog (sqlite)",
function () {
input.loadFromCatalog(self.catalogLoader);
});
var resultCache = self._options.resultCache;
if (resultCache && resultCache.lastInput &&
@@ -68,6 +63,12 @@ CS.PackagesResolver.prototype.resolve = function (dependencies, constraints,
return resultCache.lastOutput;
}
Profile.time(
"Input#loadFromCatalog (sqlite)",
function () {
input.loadFromCatalog(self.catalogLoader);
});
if (options.previousSolution && options.missingPreviousVersionIsError) {
Profile.time("check for previous versions in catalog", function () {
_.each(options.previousSolution, function (version, pkg) {