Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
CMCDragonkai committed May 17, 2023
1 parent 9ecb3d6 commit 6ddfddc
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 1 deletion.
36 changes: 35 additions & 1 deletion benches/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
#!/usr/bin/env ts-node

import fs from 'fs';
import path from 'path';
import si from 'systeminformation';

async function main(): Promise<void> {
// NOOP
await fs.promises.mkdir(path.join(__dirname, 'results'), { recursive: true });
const resultFilenames = await fs.promises.readdir(
path.join(__dirname, 'results'),
);
const metricsFile = await fs.promises.open(
path.join(__dirname, '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),
);
if (concatenating) {
await metricsFile.write('\n');
}
await metricsFile.write(metricsData);
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'),
JSON.stringify(systemData, null, 2),
);
}

void main();
Empty file added benches/results/metrics.txt
Empty file.
41 changes: 41 additions & 0 deletions benches/results/system.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"cpu": {
"manufacturer": "AMD",
"brand": "Ryzen 7 2700X Eight-Core Processor",
"vendor": "AMD",
"family": "23",
"model": "8",
"stepping": "2",
"revision": "",
"voltage": "",
"speed": 3.7,
"speedMin": 2.2,
"speedMax": 3.7,
"governor": "performance",
"cores": 16,
"physicalCores": 8,
"performanceCores": 8,
"efficiencyCores": 0,
"processors": 1,
"socket": "",
"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 constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb hw_pstate ssbd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 clzero irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca sev sev_es",
"virtualization": true,
"cache": {
"l1d": 262144,
"l1i": 524288,
"l2": 4194304,
"l3": 16777216
}
},
"osInfo": {
"platform": "linux",
"distro": "nixos",
"release": "22.11",
"kernel": "6.1.23",
"arch": "x64"
},
"system": {
"model": "System Product Name",
"manufacturer": "System manufacturer"
}
}

0 comments on commit 6ddfddc

Please sign in to comment.