INNER CODE UNIT · JavaScript
createContext
m4heshd/better-sqlite3-multiple-ciphers · benchmark/index.js:40
const createContext = (trial, driver) => {
const tableInfo = Object.assign({}, tables.get(trial.table), { data: undefined });
return JSON.stringify(Object.assign({}, trial, tableInfo, { driver, tables: [...tables.keys()] }));
};
const erase = () => {
return clc.move(0, -1) + clc.erase.line;
};
// Determine which trials should be executed.
process.chdir(__dirname);
const trials = getTrials(process.argv.slice(2)).sort(sortTrials);
if (!trials.length) {
console.log(clc.yellow('No matching benchmarks found!'));
process.exit();
}
// Create the temporary database needed to run the benchmark trials.