Refactor: Remove stale benchmark outputs

This commit is contained in:
github-actions[bot]
2026-02-06 21:01:23 +00:00
parent 3a53d655cd
commit 3385fbc925
99 changed files with 0 additions and 2663 deletions

View File

@@ -1,35 +0,0 @@
async function processCSV(csv, config) {
const { filterColumn, filterValue, groupBy, aggregateColumn, operation } = config;
const { default: Papa } = await import("https://cdn.jsdelivr.net/npm/papaparse@5.4.1/+esm");
const parsed = Papa.parse(csv.trim(), { header: true, skipEmptyLines: true });
const rows = parsed.data;
const filtered = rows.filter(r => r[filterColumn] == filterValue);
const groups = {};
for (const row of filtered) {
const key = row[groupBy];
if (!groups[key]) groups[key] = [];
groups[key].push(row);
}
return Object.entries(groups).map(([groupValue, groupRows]) => {
let result;
if (operation === "count") {
result = groupRows.length;
} else {
const vals = groupRows.map(r => {
const n = Number(r[aggregateColumn]);
return isNaN(n) ? 0 : n;
});
const sum = vals.reduce((a, b) => a + b, 0);
result = operation === "avg" ? sum / groupRows.length : sum;
}
return { [groupBy]: groupValue, result };
});
}
export default processCSV;
// Generation time: 4.670s
// Result: PASS

View File

@@ -1,36 +0,0 @@
async function processCSV(csv, config) {
const { filterColumn, filterValue, groupBy, aggregateColumn, operation } = config;
const { default: Papa } = await import("https://cdn.jsdelivr.net/npm/papaparse@5/+esm");
const parsed = Papa.parse(csv.trim(), { header: true, skipEmptyLines: true });
const rows = parsed.data;
const filtered = rows.filter(r => r[filterColumn] == filterValue);
const groups = new Map();
for (const row of filtered) {
const key = row[groupBy];
if (!groups.has(key)) groups.set(key, []);
groups.get(key).push(row);
}
const toNum = v => {
const n = Number(v);
return Number.isFinite(n) ? n : 0;
};
return [...groups.entries()].map(([groupValue, rows]) => {
let result;
if (operation === "count") {
result = rows.length;
} else {
const sum = rows.reduce((acc, r) => acc + toNum(r[aggregateColumn]), 0);
result = operation === "avg" ? sum / rows.length : sum;
}
return { [groupBy]: groupValue, result };
});
}
export default processCSV;
// Generation time: 6.543s
// Result: PASS

View File

@@ -1,34 +0,0 @@
export const processCSV = async (csv, { filterColumn, filterValue, groupBy, aggregateColumn, operation }) => {
const [{ parse }, { groupBy: group, sum: total }] = await Promise.all([
import('https://cdn.jsdelivr.net/npm/papaparse@5.4.1/+esm'),
import('https://cdn.jsdelivr.net/npm/lodash-es@4.17.21/+esm')
]);
const { data } = parse(csv, {
header: true,
skipEmptyLines: true
});
const filtered = data.filter(r => r[filterColumn] == filterValue);
const collections = group(filtered, groupBy);
return Object.entries(collections).map(([key, rows]) => {
const values = rows.map(r => +r[aggregateColumn] || 0);
const s = total(values);
const n = values.length;
const calculations = {
sum: s,
avg: s / n,
count: n
};
return {
[groupBy]: key,
result: calculations[operation]
};
});
};
export default processCSV;
// Generation time: 41.061s
// Result: FAIL

View File

@@ -1,33 +0,0 @@
export async function processCSV(csvData, config) {
const { Papa } = await import('https://cdn.skypack.dev/papaparse@5.3.2');
const { filterColumn, filterValue, groupBy, aggregateColumn, operation } = config;
const { data } = Papa.parse(csvData, { header: true, skipEmptyLines: true });
const groups = data.reduce((acc, row) => {
if (row[filterColumn] != filterValue) return acc;
const key = row[groupBy];
if (!acc[key]) acc[key] = [];
acc[key].push(row);
return acc;
}, {});
return Object.entries(groups).map(([key, rows]) => {
let result;
if (operation === 'count') {
result = rows.length;
} else {
const values = rows.map(r => parseFloat(r[aggregateColumn]) || 0);
if (operation === 'sum') {
result = values.reduce((a, b) => a + b, 0);
} else if (operation === 'avg') {
const sum = values.reduce((a, b) => a + b, 0);
result = sum / values.length;
}
}
return { [groupBy]: key, result };
});
}
export default processCSV;
// Generation time: 4.238s
// Result: FAIL

View File

@@ -1,27 +0,0 @@
async function processCSV(csvString, config) {
const [{ default: Papa }, { groupBy, sumBy, meanBy }] = await Promise.all([
import('https://cdn.jsdelivr.net/npm/papaparse@5.4.1/+esm'),
import('https://cdn.jsdelivr.net/npm/lodash-es@4.17.21/+esm')
]);
const data = Papa.parse(csvString, { header: true }).data.filter(row =>
row[config.filterColumn] == config.filterValue
);
const grouped = groupBy(data, config.groupBy);
return Object.entries(grouped).map(([key, rows]) => {
let result;
const numRows = rows.map(r => parseFloat(r[config.aggregateColumn]) || 0);
switch(config.operation) {
case 'sum': result = numRows.reduce((a, b) => a + b, 0); break;
case 'avg': result = numRows.reduce((a, b) => a + b, 0) / numRows.length; break;
case 'count': result = numRows.length; break;
}
return { [config.groupBy]: key, result };
});
}
export default processCSV;
// Generation time: 5.258s
// Result: PASS

View File

@@ -1,17 +0,0 @@
async function processCSV(csv, { filterColumn: fc, filterValue: fv, groupBy: gb, aggregateColumn: ac, operation: op }) {
const { default: Papa } = await import('https://cdn.jsdelivr.net/npm/papaparse@5.4.1/+esm');
const groups = {};
Papa.parse(csv, { header: true }).data
.filter(r => r[fc] == fv)
.forEach(r => {
const key = r[gb], g = groups[key] || (groups[key] = { c: 0, s: 0 });
g.c++;
g.s += +r[ac] || 0;
});
return Object.entries(groups).map(([k, { c, s }]) => ({ [gb]: k, result: op === 'count' ? c : op === 'avg' ? s / c : s }));
}
export default processCSV;
// Generation time: 66.769s
// Result: PASS

View File

@@ -1,26 +0,0 @@
async function processCSV(csv, o) {
const { csvParse } = await import('https://cdn.skypack.dev/d3-dsv');
const { filterColumn, filterValue, groupBy, aggregateColumn, operation } = o;
const rows = csvParse(csv);
const m = new Map();
for (const r of rows) {
if (r[filterColumn] == filterValue) {
const g = r[groupBy];
let a = +r[aggregateColumn];
if (isNaN(a)) a = 0;
const v = m.get(g) || { c: 0, s: 0 };
v.c++;
v.s += a;
m.set(g, v);
}
}
const out = [];
for (const [k, v] of m) {
const result = operation === 'sum' ? v.s : operation === 'count' ? v.c : v.s / v.c;
out.push({ [groupBy]: k, result });
}
return out;
}
export default processCSV;
// Generation time: 11.354s
// Result: PASS

View File

@@ -1,16 +0,0 @@
const store={},load=u=>store[u]??=import(u),csvLib='https://cdn.jsdelivr.net/npm/papaparse@5.4.1/+esm',dataLib='https://cdn.jsdelivr.net/npm/lodash-es@4.17.21/+esm',toNum=v=>{const n=Number(v);return Number.isFinite(n)?n:0};
async function processCSV(csv,opt){
const [{Papa},{groupBy:gb}] = await Promise.all([load(csvLib),load(dataLib)]);
const {filterColumn:f,filterValue:v,groupBy:g,aggregateColumn:a,operation:o}=opt;
const rows=Papa.parse(csv,{header:true,skipEmptyLines:true}).data.filter(r=>r&&r[f]==v);
const grouped=gb(rows,r=>r[g]);
return Object.entries(grouped).map(([k,items])=>{
const total=items.reduce((s,r)=>s+toNum(r[a]),0);
const result=o==='count'?items.length:o==='sum'?total:items.length?total/items.length:0;
return {[g]:k,result};
});
}
export default processCSV;
// Generation time: 29.916s
// Result: FAIL

View File

@@ -1,37 +0,0 @@
const _csvLibs = (() => {
let p
return () =>
p ??= Promise.all([
import("https://cdn.jsdelivr.net/npm/d3-dsv@3/+esm"),
import("https://cdn.jsdelivr.net/npm/d3-array@3/+esm")
]).then(([dsv, arr]) => ({ csvParse: dsv.csvParse, group: arr.group }))
})()
async function processCSV(csv, cfg = {}) {
if (typeof csv != "string") throw new TypeError("csv must be a string")
const { filterColumn, filterValue, groupBy, aggregateColumn, operation } = cfg
if (typeof filterColumn != "string" || !filterColumn) throw new TypeError("filterColumn required")
if (typeof groupBy != "string" || !groupBy) throw new TypeError("groupBy required")
if (!["sum", "avg", "count"].includes(operation)) throw new TypeError("operation must be sum|avg|count")
if (operation != "count" && (typeof aggregateColumn != "string" || !aggregateColumn))
throw new TypeError("aggregateColumn required for sum/avg")
const { csvParse, group } = await _csvLibs()
const rows = csvParse(csv)
const filtered = rows.filter(r => r[filterColumn] == filterValue)
const groups = group(filtered, r => r[groupBy])
const num = v => +v || 0
const calc = rs => {
const c = rs.length
if (operation == "count") return c
const s = rs.reduce((a, r) => a + num(r[aggregateColumn]), 0)
return operation == "avg" ? s / c : s
}
return Array.from(groups, ([k, rs]) => ({ [groupBy]: k, result: calc(rs) }))
}
export default processCSV;
// Generation time: 136.946s
// Result: PASS