Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(function run(files) {
var f = files.shift();
if (f) {
console.log("RUNNING %s", f);
require(f).then(comb.partial(run, files), function(err){
console.log(err);
run(files);
});
} else {
ret.callback();
}
})(files);
return ret;
var printDurations = function (header, module, limit, durations) {
console.log(header);
var msg = "%-15s (%02s runs): Average duration % 8dms for %d items";
for (var testName in durations) {
if (testName !== "total") {
console.log(format(msg, testName, durations.total, durations[testName] / durations.total), limit);
}
}
module.disconnect();
};
console.log("Starting Benchmark...");
bench(noTransactions, "NO TRANSACTIONS MODEL", TIMES, LIMIT)
.chain(comb.partial(printDurations, "NO TRANSACTIONS MODEL", noTransactions, LIMIT))
.chain(comb.partial(bench, defaults, "DEFAULT MODEL", TIMES, LIMIT))
.chain(comb.partial(printDurations, "DEFAULT MODEL", defaults, LIMIT))
.chain(function () {
console.log("DONE");
}, defaults.disconnectErr);
var printDurations = function (header, module, limit, durations) {
console.log(header);
var msg = "%-15s (%02s runs): Average duration % 8dms for %d items";
for (var testName in durations) {
if (testName !== "total") {
console.log(format(msg, testName, durations.total, durations[testName] / durations.total), limit);
}
}
module.disconnect();
};
console.log("Starting Benchmark...");
bench(noTransactions, "NO TRANSACTIONS MODEL", TIMES, LIMIT)
.chain(comb.partial(printDurations, "NO TRANSACTIONS MODEL", noTransactions, LIMIT))
.chain(comb.partial(bench, defaults, "DEFAULT MODEL", TIMES, LIMIT))
.chain(comb.partial(printDurations, "DEFAULT MODEL", defaults, LIMIT))
.chain(function () {
console.log("DONE");
}, defaults.disconnectErr);
name: "Compiler Construction 2",
subject: "Computer Science",
description: "More Assemblers, interpreters and compilers. Compilation of simple expressions and statements. "
+ "Analysis of regular expressions. Organization of a compiler, including compile-time and run-time "
+ "symbol tables, lexical scan, syntax scan, object code generation and error diagnostics."
},
{
semester: "FALL",
name: "Operating Systems",
subject: "Computer Science"
}
]
});
})
.chain(comb.partial(printResults, studentDs, classDs));
});
}, disconnectError);
var loop = function (async, cb, limit) {
var saves = [];
limit = limit || LIMIT;
for (var i = 0; i < limit; i++) {
saves.push(async ? cb(i) : comb.partial(cb, i));
}
if (async) {
saves = new comb.PromiseList(saves, true);
}
return async ? saves : comb.serial(saves);
};
name: "Compiler Construction 2",
subject: "Computer Science",
description: "More Assemblers, interpreters and compilers. Compilation of simple expressions and statements. "
+ "Analysis of regular expressions. Organization of a compiler, including compile-time and run-time "
+ "symbol tables, lexical scan, syntax scan, object code generation and error diagnostics."
},
{
semester: "FALL",
name: "Operating Systems",
subject: "Computer Science"
}
]
});
})
.chain(comb.partial(printResults, studentDs, classDs));
});
}, disconnectError);
});
};
var connectAndExecute = function (cb) {
return connectAndCreateSchema()
.chain(function (db) {
return cb(db);
})
.chain(disconnect, disconnectError);
};
connectAndExecute(multipleTransactions)
.chain(comb.partial(connectAndExecute, multipleTransactionsError), disconnectError)
.chain(comb.partial(connectAndExecute, simpleTransaction), disconnectError)
.chain(comb.partial(connectAndExecute, nestedTransaction), disconnectError)
.chain(comb.partial(connectAndExecute, inOrderTransaction), disconnectError)
.chain(comb.partial(connectAndExecute, errorTransaciton), disconnectError)
.chain(comb.partial(connectAndExecute, errorCallbackTransaciton), disconnectError);
patio.logInfo(format("COUNT = " + count));
});
});
};
var connectAndExecute = function (cb) {
return connectAndCreateSchema()
.chain(function (db) {
return cb(db);
})
.chain(disconnect, disconnectError);
};
connectAndExecute(multipleTransactions)
.chain(comb.partial(connectAndExecute, multipleTransactionsError), disconnectError)
.chain(comb.partial(connectAndExecute, simpleTransaction), disconnectError)
.chain(comb.partial(connectAndExecute, nestedTransaction), disconnectError)
.chain(comb.partial(connectAndExecute, inOrderTransaction), disconnectError)
.chain(comb.partial(connectAndExecute, errorTransaciton), disconnectError)
.chain(comb.partial(connectAndExecute, errorCallbackTransaciton), disconnectError);
};
var connectAndExecute = function (cb) {
return connectAndCreateSchema()
.chain(function (db) {
return cb(db);
})
.chain(disconnect, disconnectError);
};
connectAndExecute(multipleTransactions)
.chain(comb.partial(connectAndExecute, multipleTransactionsError), disconnectError)
.chain(comb.partial(connectAndExecute, simpleTransaction), disconnectError)
.chain(comb.partial(connectAndExecute, nestedTransaction), disconnectError)
.chain(comb.partial(connectAndExecute, inOrderTransaction), disconnectError)
.chain(comb.partial(connectAndExecute, errorTransaciton), disconnectError)
.chain(comb.partial(connectAndExecute, errorCallbackTransaciton), disconnectError);
var connectAndExecute = function (cb) {
return connectAndCreateSchema()
.chain(function (db) {
return cb(db);
})
.chain(disconnect, disconnectError);
};
connectAndExecute(multipleTransactions)
.chain(comb.partial(connectAndExecute, multipleTransactionsError), disconnectError)
.chain(comb.partial(connectAndExecute, simpleTransaction), disconnectError)
.chain(comb.partial(connectAndExecute, nestedTransaction), disconnectError)
.chain(comb.partial(connectAndExecute, inOrderTransaction), disconnectError)
.chain(comb.partial(connectAndExecute, errorTransaciton), disconnectError)
.chain(comb.partial(connectAndExecute, errorCallbackTransaciton), disconnectError);