Skip to content

Commit

Permalink
chore: ensure benchmark failure
Browse files Browse the repository at this point in the history
  • Loading branch information
wellwelwel committed Aug 27, 2024
1 parent 61efb73 commit 026438b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions benchmark/index.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const process = require('node:process');
const { fork } = require('node:child_process');

const benchmarks = ['lru-cache', 'lru.min'];
Expand Down Expand Up @@ -39,4 +40,7 @@ const runBenchmark = (benchmarkName) => {
for (const [name, result] of sortedByCpu)
console.log(` ${name}: ${result.cpu.toFixed(2)}µs`);
console.log(' quick-lru: not compatible');

if (sortedByTime[0][0] !== 'lru.min' || sortedByCpu[0][0] !== 'lru.min')
process.exit(1);
})();
4 changes: 4 additions & 0 deletions benchmark/index.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import process from 'node:process';
import { fork } from 'node:child_process';

const benchmarks = ['lru-cache', 'quick-lru', 'lru.min'];
Expand Down Expand Up @@ -37,4 +38,7 @@ const runBenchmark = (benchmarkName) => {
console.log('\nCPU:');
for (const [name, result] of sortedByCpu)
console.log(` ${name}: ${result.cpu.toFixed(2)}µs`);

if (sortedByTime[0][0] !== 'lru.min' || sortedByCpu[0][0] !== 'lru.min')
process.exit(1);
})();
1 change: 1 addition & 0 deletions benchmark/worker.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const process = require('node:process');
const { cpuUsage } = require('node:process');
const { performance } = require('node:perf_hooks');
const { LRUCache } = require('lru-cache');
Expand Down

0 comments on commit 026438b

Please sign in to comment.