Add Prettier and ESLint tooling (Refs #77)
This commit is contained in:
@@ -8,7 +8,9 @@ try {
|
||||
handle.pragma('cache_size = -16384');
|
||||
handle.exec('CREATE TABLE records(id INTEGER PRIMARY KEY, content BLOB)');
|
||||
const insert = handle.prepare('INSERT INTO records(content) VALUES(zeroblob(1048576))');
|
||||
handle.transaction(() => { for (let i = 0; i < 256; i++) insert.run(); })();
|
||||
handle.transaction(() => {
|
||||
for (let i = 0; i < 256; i++) insert.run();
|
||||
})();
|
||||
handle.pragma('wal_checkpoint(TRUNCATE)');
|
||||
handle.pragma('shrink_memory');
|
||||
// Reproduce the dangerous caller settings. The rebuild must override these.
|
||||
@@ -16,8 +18,15 @@ try {
|
||||
handle.pragma('cache_size = -131072');
|
||||
const beforeKiB = process.resourceUsage().maxRSS;
|
||||
enableIncrementalVacuum(handle);
|
||||
console.log(JSON.stringify({ beforeKiB, peakKiB: process.resourceUsage().maxRSS,
|
||||
vacuum: handle.pragma('auto_vacuum', { simple: true }),
|
||||
integrity: handle.pragma('quick_check', { simple: true }),
|
||||
rows: handle.prepare('SELECT COUNT(*) n FROM records').get() }));
|
||||
} finally { handle.close(); }
|
||||
console.log(
|
||||
JSON.stringify({
|
||||
beforeKiB,
|
||||
peakKiB: process.resourceUsage().maxRSS,
|
||||
vacuum: handle.pragma('auto_vacuum', { simple: true }),
|
||||
integrity: handle.pragma('quick_check', { simple: true }),
|
||||
rows: handle.prepare('SELECT COUNT(*) n FROM records').get()
|
||||
})
|
||||
);
|
||||
} finally {
|
||||
handle.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user