Skip to content

ci: merge staging to master #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 1, 2025
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
8 changes: 6 additions & 2 deletions benches/db_1KiB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ async function main() {
});
return summary;
}
if (process.argv[1] === url.fileURLToPath(import.meta.url)) {
void main();

if (import.meta.url.startsWith('file:')) {
const modulePath = url.fileURLToPath(import.meta.url);
if (process.argv[1] === modulePath) {
void main();
}
}

export default main;
7 changes: 5 additions & 2 deletions benches/db_1MiB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ async function main() {
return summary;
}

if (process.argv[1] === url.fileURLToPath(import.meta.url)) {
void main();
if (import.meta.url.startsWith('file:')) {
const modulePath = url.fileURLToPath(import.meta.url);
if (process.argv[1] === modulePath) {
void main();
}
}

export default main;
28 changes: 18 additions & 10 deletions benches/index.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
#!/usr/bin/env ts-node

import fs from 'fs';
import path from 'path';
import fs from 'node:fs';
import path from 'node:path';
import url from 'node:url';
import si from 'systeminformation';
import { benchesPath } from './utils/utils.js';
import DB1KiB from './db_1KiB.js';
import DB1MiB from './db_1MiB.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(benchesPath, 'results'), {
recursive: true,
});
await DB1KiB();
await DB1MiB();
const resultFilenames = await fs.promises.readdir(
path.join(dirname, 'results'),
path.join(benchesPath, 'results'),
);
const metricsFile = await fs.promises.open(
path.join(dirname, 'results', 'metrics.txt'),
path.join(benchesPath, 'results', 'metrics.txt'),
'w',
);
let concatenating = false;
for (const resultFilename of resultFilenames) {
if (/.+_metrics\.txt$/.test(resultFilename)) {
const metricsData = await fs.promises.readFile(
path.join(dirname, 'results', resultFilename),
path.join(benchesPath, 'results', resultFilename),
);
if (concatenating) {
await metricsFile.write('\n');
Expand All @@ -40,9 +41,16 @@ async function main(): Promise<void> {
system: 'model, manufacturer',
});
await fs.promises.writeFile(
path.join(dirname, 'results', 'system.json'),
path.join(benchesPath, 'results', 'system.json'),
JSON.stringify(systemData, null, 2),
);
}

void main();
if (import.meta.url.startsWith('file:')) {
const modulePath = url.fileURLToPath(import.meta.url);
if (process.argv[1] === modulePath) {
void main();
}
}

export default main;
14 changes: 7 additions & 7 deletions benches/results/db_1KiB.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="chart1742452282334" width="16" height="9"></canvas>
<canvas id="chart1743116144494" width="16" height="9"></canvas>
</div>
<script>
const format = (num) => {
Expand All @@ -51,18 +51,18 @@
chunked.map((chunk) => chunk.join('')).join(' ') + fractionStr
)
}
const ctx1742452282334 = document
.getElementById('chart1742452282334')
const ctx1743116144494 = document
.getElementById('chart1743116144494')
.getContext('2d')
const chart1742452282334 = new Chart(ctx1742452282334, {
const chart1743116144494 = new Chart(ctx1743116144494, {
type: 'bar',
data: {
labels: ["get 1 KiB of data","put 1 KiB of data","put zero data","put zero data then del"],
datasets: [
{
data: [71704,40939,49028,19057],
backgroundColor: ["hsl(120, 85%, 55%)","hsl(68.50800000000001, 85%, 55%)","hsl(82.056, 85%, 55%)","hsl(31.895999999999997, 85%, 55%)"],
borderColor: ["hsl(120, 85%, 55%)","hsl(68.50800000000001, 85%, 55%)","hsl(82.056, 85%, 55%)","hsl(31.895999999999997, 85%, 55%)"],
data: [44354,23160,29018,15488],
backgroundColor: ["hsl(120, 85%, 55%)","hsl(62.664, 85%, 55%)","hsl(78.504, 85%, 55%)","hsl(41.904, 85%, 55%)"],
borderColor: ["hsl(120, 85%, 55%)","hsl(62.664, 85%, 55%)","hsl(78.504, 85%, 55%)","hsl(41.904, 85%, 55%)"],
borderWidth: 2,
},
],
Expand Down
Loading
Loading