Docs: Update benchmark results

This commit is contained in:
github-actions[bot]
2025-11-18 17:37:06 +00:00
parent 39d057f079
commit afcfd09537
84 changed files with 1086 additions and 1088 deletions
@@ -0,0 +1,22 @@
const processCSV = async (csv, { filterColumn: fKey, filterValue: fVal, groupBy: gKey, aggregateColumn: aKey, operation: op }) => {
const { parse } = await import('https://cdn.jsdelivr.net/npm/papaparse@5.4.1/+esm')
const { data } = parse(csv, { header: true, skipEmptyLines: true })
const groups = data.reduce((acc, row) => {
if (row[fKey] == fVal) {
const key = row[gKey]
const val = +row[aKey] || 0
const rec = acc[key] || { sum: 0, count: 0 }
rec.sum += val
rec.count++
acc[key] = rec
}
return acc
}, {})
return Object.entries(groups).map(([key, { sum, count }]) => ({
[gKey]: key,
result: op === 'count' ? count : op === 'avg' ? sum / count : sum
}))
}
export default processCSV;