mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Profile a few more things
This commit is contained in:
@@ -59,7 +59,9 @@ BCp.processFilesForTarget = function (inputFiles) {
|
||||
babelOptions.sourceMapTarget = babelOptions.filename + ".map";
|
||||
|
||||
try {
|
||||
var result = Babel.compile(source, babelOptions);
|
||||
var result = profile('Babel.compile', function () {
|
||||
return Babel.compile(source, babelOptions);
|
||||
});
|
||||
} catch (e) {
|
||||
if (e.loc) {
|
||||
inputFile.error({
|
||||
@@ -86,3 +88,11 @@ BCp.processFilesForTarget = function (inputFiles) {
|
||||
BCp.setDiskCacheDirectory = function (cacheDir) {
|
||||
Babel.setCacheDir(cacheDir);
|
||||
};
|
||||
|
||||
function profile(name, func) {
|
||||
if (typeof Profile !== 'undefined') {
|
||||
return Profile.time(name, func);
|
||||
} else {
|
||||
return func();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -823,6 +823,8 @@ files.renameDirAlmostAtomically = function (fromDir, toDir) {
|
||||
files.rm_recursive(garbageDir);
|
||||
}
|
||||
};
|
||||
files.renameDirAlmostAtomically = Profile("files.renameDirAlmostAtomically",
|
||||
files.renameDirAlmostAtomically);
|
||||
|
||||
files.writeFileAtomically = function (filename, contents) {
|
||||
var tmpFile = files.pathJoin(
|
||||
@@ -831,6 +833,8 @@ files.writeFileAtomically = function (filename, contents) {
|
||||
files.writeFile(tmpFile, contents);
|
||||
files.rename(tmpFile, filename);
|
||||
};
|
||||
files.writeFileAtomically = Profile("files.writeFileAtomically",
|
||||
files.writeFileAtomically);
|
||||
|
||||
// Like fs.symlinkSync, but creates a temporay link and renames it over the
|
||||
// file; this means it works even if the file already exists.
|
||||
|
||||
@@ -323,7 +323,7 @@ var lintUnibuild = function ({isopack, isopackCache, sourceArch}) {
|
||||
// options.isopack.
|
||||
//
|
||||
// Returns a list of source files that were used in the compilation.
|
||||
var compileUnibuild = function (options) {
|
||||
var compileUnibuild = Profile("compileUnibuild", function (options) {
|
||||
buildmessage.assertInCapture();
|
||||
|
||||
const isopk = options.isopack;
|
||||
@@ -609,7 +609,7 @@ api.addAssets('${relPath}', 'client').`);
|
||||
return {
|
||||
pluginProviderPackageNames: pluginProviderPackageNames
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
function runLinters({inputSourceArch, isopackCache, sources,
|
||||
sourceProcessorSet, watchSet}) {
|
||||
|
||||
Reference in New Issue
Block a user