Docs: Update Gemini benchmark results

This commit is contained in:
github-actions[bot]
2025-11-18 22:04:41 +00:00
parent 31a18dd4ee
commit 33b8150958
220 changed files with 3256 additions and 1491 deletions
@@ -1,20 +1,20 @@
const processCSV = async (csvStr, { filterColumn: fc, filterValue: fv, groupBy: gb, aggregateColumn: ac, operation: op }) => {
const { csvParse } = await import('https://esm.sh/d3-dsv@3');
const groups = csvParse(csvStr).reduce((acc, row) => {
if (row[fc] == fv) {
const key = row[gb], val = +row[ac] || 0;
const entry = acc.get(key) || { s: 0, c: 0 };
entry.s += val;
entry.c++;
acc.set(key, entry);
}
return acc;
}, new Map());
const processCSV = async (csv, { filterColumn, filterValue, groupBy, aggregateColumn, operation }) => {
const { parse } = await import('https://cdn.jsdelivr.net/npm/papaparse@5.4.1/+esm');
const groups = {};
return Array.from(groups, ([key, { s, c }]) => ({
[gb]: key,
result: op === 'count' ? c : op === 'sum' ? s : s / c
parse(csv, { header: true, skipEmptyLines: true }).data.forEach(row => {
if (row[filterColumn] == filterValue) {
const key = row[groupBy];
const val = +row[aggregateColumn] || 0;
const acc = groups[key] ??= { sum: 0, count: 0 };
acc.sum += val;
acc.count++;
}
});
return Object.entries(groups).map(([key, { sum, count }]) => ({
[groupBy]: key,
result: operation === 'count' ? count : operation === 'avg' ? sum / count : sum
}));
};
export default processCSV;