INNER CODE UNIT · JavaScript
nameLength
m4heshd/better-sqlite3-multiple-ciphers · benchmark/index.js:64
const nameLength = [...drivers.keys()].reduce((m, d) => Math.max(m, d.length), 0);
for (const trial of trials) {
displayTrialName(trial);
for (const driver of drivers.keys()) {
const driverName = driver.padEnd(nameLength);
const ctx = createContext(trial, driver);
process.stdout.write(`${driver} (running...)\n`);
try {
const result = execFileSync('node', [...process.execArgv, './benchmark.js', ctx], { stdio: 'pipe', encoding: 'utf8' });
console.log(erase() + `${driverName} x ${result}`);
} catch (err) {
console.log(erase() + clc.red(`${driverName} ERROR (probably out of memory)`));
process.stderr.write(clc.xterm(247)(clc.strip(err.stderr)));
}
}
console.log('');
}