Skip to content

Commit 3157537

Browse files
committed
bench: fixed benchmark
1 parent 06bb0d9 commit 3157537

File tree

3 files changed

+32
-56
lines changed

3 files changed

+32
-56
lines changed

benches/results/metrics.txt

+3-21
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,8 @@
1-
# TYPE dummy_ops gauge
2-
dummy_ops{name="add 1 + 1"} 11776647
3-
dummy_ops{name="subtract 1 - 1"} 11685857
4-
dummy_ops{name="multiply 1 * 1"} 12000931
5-
dummy_ops{name="divide 1 / 1"} 11857267
6-
7-
# TYPE dummy_margin gauge
8-
dummy_margin{name="add 1 + 1"} 0.55
9-
dummy_margin{name="subtract 1 - 1"} 0.95
10-
dummy_margin{name="multiply 1 * 1"} 0.48
11-
dummy_margin{name="divide 1 / 1"} 0.58
12-
13-
# TYPE dummy_samples counter
14-
dummy_samples{name="add 1 + 1"} 84
15-
dummy_samples{name="subtract 1 - 1"} 84
16-
dummy_samples{name="multiply 1 * 1"} 85
17-
dummy_samples{name="divide 1 / 1"} 83
18-
191
# TYPE stream_1KB_ops gauge
20-
stream_1KB_ops{name="send 1Kib of data"} 176
2+
stream_1KB_ops{name="send 1Kib of data"} 214
213

224
# TYPE stream_1KB_margin gauge
23-
stream_1KB_margin{name="send 1Kib of data"} 2.68
5+
stream_1KB_margin{name="send 1Kib of data"} 0.95
246

257
# TYPE stream_1KB_samples counter
26-
stream_1KB_samples{name="send 1Kib of data"} 76
8+
stream_1KB_samples{name="send 1Kib of data"} 84

benches/results/system.json

+24-24
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
{
22
"cpu": {
3-
"manufacturer": "Intel",
4-
"brand": "Xeon® E3-1241 v3",
5-
"vendor": "Intel",
6-
"family": "6",
7-
"model": "60",
8-
"stepping": "3",
3+
"manufacturer": "AMD",
4+
"brand": "Ryzen 7 5800X 8-Core Processor",
5+
"vendor": "AMD",
6+
"family": "25",
7+
"model": "33",
8+
"stepping": "0",
99
"revision": "",
1010
"voltage": "",
11-
"speed": 3.5,
12-
"speedMin": 0.8,
13-
"speedMax": 3.9,
14-
"governor": "performance",
15-
"cores": 8,
16-
"physicalCores": 4,
17-
"performanceCores": 4,
11+
"speed": 3.8,
12+
"speedMin": null,
13+
"speedMax": null,
14+
"governor": "",
15+
"cores": 16,
16+
"physicalCores": 8,
17+
"performanceCores": 8,
1818
"efficiencyCores": 0,
1919
"processors": 1,
2020
"socket": "",
21-
"flags": "fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear flush_l1d",
22-
"virtualization": true,
21+
"flags": "fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl cpuid extd_apicid pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves xsaveerptr arat vaes vpclmulqdq rdpid",
22+
"virtualization": false,
2323
"cache": {
24-
"l1d": 131072,
25-
"l1i": 131072,
26-
"l2": 1048576,
27-
"l3": 8388608
24+
"l1d": 262144,
25+
"l1i": 262144,
26+
"l2": 4194304,
27+
"l3": 33554432
2828
}
2929
},
3030
"osInfo": {
3131
"platform": "linux",
32-
"distro": "nixos",
33-
"release": "22.11",
34-
"kernel": "5.10.177",
32+
"distro": "Faulkes-Work",
33+
"release": "unknown",
34+
"kernel": "4.19.190",
3535
"arch": "x64"
3636
},
3737
"system": {
38-
"model": "P7 Pro SE",
39-
"manufacturer": "EUROCOM"
38+
"model": "Virtual Machine",
39+
"manufacturer": "Microsoft Corporation"
4040
}
4141
}

benches/stream_1KB.ts

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type * as events from '../src/events';
22
import type { Host } from '../src/types';
33
import path from 'path';
4-
import fs from 'fs';
54
import b from 'benny';
65
import Logger, { formatting, LogLevel, StreamHandler } from '@matrixai/logger';
76
import { suiteCommon } from './utils';
@@ -18,17 +17,12 @@ async function main() {
1817
// Setting up initial state
1918
const data1KiB = Buffer.alloc(1024, 0xf0);
2019
const host = '127.0.0.1' as Host;
21-
const certChainPem = await fs.promises.readFile(
22-
path.resolve(path.join(__dirname), '../tests/fixtures/certs/rsa1.crt'),
23-
);
24-
const privKeyPem = await fs.promises.readFile(
25-
path.resolve(path.join(__dirname), '../tests/fixtures/certs/rsa1.key'),
26-
);
20+
const tlsConfig = await testsUtils.generateConfig('RSA');
2721

2822
const quicServer = new QUICServer({
2923
config: {
30-
key: privKeyPem.toString(),
31-
cert: certChainPem.toString(),
24+
key: tlsConfig.key,
25+
cert: tlsConfig.cert,
3226
verifyPeer: false,
3327
keepAliveIntervalTime: 1000,
3428
},
@@ -42,11 +36,11 @@ async function main() {
4236
logger,
4337
});
4438
quicServer.addEventListener(
45-
'connection',
39+
'serverConnection',
4640
async (e: events.QUICServerConnectionEvent) => {
4741
const conn = e.detail;
4842
conn.addEventListener(
49-
'stream',
43+
'connectionStream',
5044
(streamEvent: events.QUICConnectionStreamEvent) => {
5145
const stream = streamEvent.detail;
5246
void Promise.allSettled([

0 commit comments

Comments
 (0)