Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@
"jest": true
},
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier"
],
"plugins": [
"import"
],
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"plugins": [
"import"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"rules": {
"linebreak-style": ["error", "unix"],
"no-empty": 1,
Expand Down Expand Up @@ -182,3 +181,4 @@
]
}
}

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ npm run prebuild
# build the dist and native objects
npm run build
# run the repl (this allows you to import from ./src)
npm run ts-node
npm run tsx
# run the tests
npm run test
# lint the source code
Expand Down
13 changes: 8 additions & 5 deletions benches/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#!/usr/bin/env ts-node

import type { Summary } from 'benny/lib/internal/common-types';
import type { Summary } from 'benny/lib/internal/common-types.js';
import fs from 'fs';
import path from 'path';
import url from 'node:url';
import si from 'systeminformation';
import { fsWalk, resultsPath, suitesPath } from './utils';
import { fsWalk, resultsPath, suitesPath } from './utils.js';

const dirname = url.fileURLToPath(new URL('.', import.meta.url));

async function main(): Promise<void> {
await fs.promises.mkdir(path.join(__dirname, 'results'), { recursive: true });
await fs.promises.mkdir(path.join(dirname, 'results'), { recursive: true });
// Running all suites
for await (const suitePath of fsWalk(suitesPath)) {
// Skip over non-ts and non-js files
Expand Down Expand Up @@ -44,12 +47,12 @@ async function main(): Promise<void> {
system: 'model, manufacturer',
});
await fs.promises.writeFile(
path.join(__dirname, 'results', 'system.json'),
path.join(dirname, 'results', 'system.json'),
JSON.stringify(systemData, null, 2),
);
}

if (require.main === module) {
if (process.argv[1] === url.fileURLToPath(import.meta.url)) {
void main();
}

Expand Down
14 changes: 7 additions & 7 deletions benches/results/buffers/buffer_allocation.chart.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</head>
<body>
<div class="container">
<canvas id="chart1697506316266" width="16" height="9"></canvas>
<canvas id="chart1742779743420" width="16" height="9"></canvas>
</div>
<script>
const format = (num) => {
Expand All @@ -51,18 +51,18 @@
chunked.map((chunk) => chunk.join('')).join(' ') + fractionStr
)
}
const ctx1697506316266 = document
.getElementById('chart1697506316266')
const ctx1742779743420 = document
.getElementById('chart1742779743420')
.getContext('2d')
const chart1697506316266 = new Chart(ctx1697506316266, {
const chart1742779743420 = new Chart(ctx1742779743420, {
type: 'bar',
data: {
labels: ["Buffer.alloc","Buffer.allocUnsafe","Buffer.allocUnsafeSlow","Buffer.from subarray","Buffer.copyBytesFrom","Uint8Array","Uint8Array slice"],
datasets: [
{
data: [1342250,7102874,1589200,3509682,936376,1310106,1435174],
backgroundColor: ["hsl(22.680000000000007, 85%, 55%)","hsl(120, 85%, 55%)","hsl(26.844000000000005, 85%, 55%)","hsl(59.292, 85%, 55%)","hsl(15.816000000000006, 85%, 55%)","hsl(22.127999999999997, 85%, 55%)","hsl(24.251999999999995, 85%, 55%)"],
borderColor: ["hsl(22.680000000000007, 85%, 55%)","hsl(120, 85%, 55%)","hsl(26.844000000000005, 85%, 55%)","hsl(59.292, 85%, 55%)","hsl(15.816000000000006, 85%, 55%)","hsl(22.127999999999997, 85%, 55%)","hsl(24.251999999999995, 85%, 55%)"],
data: [1370590,5346372,1350702,2741252,676306,1146307,1027805],
backgroundColor: ["hsl(30.768, 85%, 55%)","hsl(120, 85%, 55%)","hsl(30.312000000000005, 85%, 55%)","hsl(61.52400000000001, 85%, 55%)","hsl(15.180000000000007, 85%, 55%)","hsl(25.727999999999998, 85%, 55%)","hsl(23.063999999999997, 85%, 55%)"],
borderColor: ["hsl(30.768, 85%, 55%)","hsl(120, 85%, 55%)","hsl(30.312000000000005, 85%, 55%)","hsl(61.52400000000001, 85%, 55%)","hsl(15.180000000000007, 85%, 55%)","hsl(25.727999999999998, 85%, 55%)","hsl(23.063999999999997, 85%, 55%)"],
borderWidth: 2,
},
],
Expand Down
Loading