Skip to content

ci: merge staging to master #143

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 24 commits into from
Mar 27, 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
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 @@
]
}
}

4 changes: 4 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- 'v*.*.*'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
use-native-library-js-tag:
permissions:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "quic"
version = "1.3.13"
version = "2.0.8"
authors = ["Roger Qiu <[email protected]>"]
license-file = "LICENSE"
edition = "2021"
Expand Down
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
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import path from 'node:path';
import url from 'node:url';
import b from 'benny';
import { summaryName, suiteCommon } from '../../utils';
import { suiteCommon } from './utils/index.js';

const filePath = url.fileURLToPath(import.meta.url);

async function main() {
const summary = await b.suite(
summaryName(__filename),
path.basename(filePath, path.extname(filePath)),
b.add('Buffer.alloc', () => {
Buffer.alloc(1350);
}),
Expand Down Expand Up @@ -39,8 +43,11 @@ async function main() {
return summary;
}

if (require.main === module) {
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;
74 changes: 38 additions & 36 deletions benches/index.ts
Original file line number Diff line number Diff line change
@@ -1,56 +1,58 @@
#!/usr/bin/env ts-node
#!/usr/bin/env tsx

import type { Summary } from 'benny/lib/internal/common-types';
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 { fsWalk, resultsPath, suitesPath } from './utils';
import { benchesPath } from './utils/utils.js';
import buffer_allocation from './buffer_allocation.js';
import stream_1KiB from './stream_1KiB.js';
import stream_1KiB_FFI from './stream_1KiB_FFI.js';

async function main(): Promise<void> {
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
const ext = path.extname(suitePath);
if (ext !== '.ts' && ext !== '.js') {
continue;
}
const suite: () => Promise<Summary> = (await import(suitePath)).default;
// Skip default exports that are not functions and are not called "main"
// They might be utility files
if (typeof suite === 'function' && suite.name === 'main') {
await suite();
}
}
// Concatenating metrics
const metricsPath = path.join(resultsPath, 'metrics.txt');
await fs.promises.rm(metricsPath, { force: true });
await fs.promises.mkdir(path.join(benchesPath, 'results'), {
recursive: true,
});
await buffer_allocation();
await stream_1KiB();
await stream_1KiB_FFI();
const resultFilenames = await fs.promises.readdir(
path.join(benchesPath, 'results'),
);
const metricsFile = await fs.promises.open(
path.join(benchesPath, 'results', 'metrics.txt'),
'w',
);
let concatenating = false;
for await (const metricPath of fsWalk(resultsPath)) {
// Skip over non-metrics files
if (!metricPath.endsWith('_metrics.txt')) {
continue;
for (const resultFilename of resultFilenames) {
if (/.+_metrics\.txt$/.test(resultFilename)) {
const metricsData = await fs.promises.readFile(
path.join(benchesPath, 'results', resultFilename),
);
if (concatenating) {
await metricsFile.write('\n');
}
await metricsFile.write(metricsData);
concatenating = true;
}
const metricData = await fs.promises.readFile(metricPath);
if (concatenating) {
await fs.promises.appendFile(metricsPath, '\n');
}
await fs.promises.appendFile(metricsPath, metricData);
concatenating = true;
}
await metricsFile.close();
const systemData = await si.get({
cpu: '*',
osInfo: 'platform, distro, release, kernel, arch',
system: 'model, manufacturer',
});
await fs.promises.writeFile(
path.join(__dirname, 'results', 'system.json'),
path.join(benchesPath, 'results', 'system.json'),
JSON.stringify(systemData, null, 2),
);
}

if (require.main === module) {
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;
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.min.js"></script>
<title>buffers.buffer_allocation</title>
<title>buffer_allocation</title>
<style>
body {
margin: 0;
Expand All @@ -28,7 +28,7 @@
</head>
<body>
<div class="container">
<canvas id="chart1697506316266" width="16" height="9"></canvas>
<canvas id="chart1743111766484" 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 ctx1743111766484 = document
.getElementById('chart1743111766484')
.getContext('2d')
const chart1697506316266 = new Chart(ctx1697506316266, {
const chart1743111766484 = new Chart(ctx1743111766484, {
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: [938109,4536822,1033223,2772304,664578,942396,967255],
backgroundColor: ["hsl(24.81600000000001, 85%, 55%)","hsl(120, 85%, 55%)","hsl(27.323999999999995, 85%, 55%)","hsl(73.332, 85%, 55%)","hsl(17.580000000000005, 85%, 55%)","hsl(24.923999999999996, 85%, 55%)","hsl(25.583999999999993, 85%, 55%)"],
borderColor: ["hsl(24.81600000000001, 85%, 55%)","hsl(120, 85%, 55%)","hsl(27.323999999999995, 85%, 55%)","hsl(73.332, 85%, 55%)","hsl(17.580000000000005, 85%, 55%)","hsl(24.923999999999996, 85%, 55%)","hsl(25.583999999999993, 85%, 55%)"],
borderWidth: 2,
},
],
Expand All @@ -72,7 +72,7 @@
plugins: {
title: {
display: true,
text: 'buffers.buffer_allocation',
text: 'buffer_allocation',
font: { size: 20 },
padding: 20,
},
Expand Down
Loading
Loading