mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-03-17 11:21:00 +00:00
Docs: Update benchmark for z-ai/glm-5
This commit is contained in:
19
tests/6_csv_processor/outputs/z-ai_glm-5.js
Normal file
19
tests/6_csv_processor/outputs/z-ai_glm-5.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const processCSV = async (csv, { filterColumn: fc, filterValue: fv, groupBy: gb, aggregateColumn: ac, operation: op }) => {
|
||||
const Papa = (await import('https://cdn.jsdelivr.net/npm/papaparse@5.4.1/papaparse.min.js')).default;
|
||||
const groups = Papa.parse(csv, { header: true }).data
|
||||
.filter(r => r[fc] == fv)
|
||||
.reduce((acc, r) => {
|
||||
const key = r[gb];
|
||||
acc[key] = acc[key] || { s: 0, c: 0 };
|
||||
acc[key].s += Number(r[ac]) || 0;
|
||||
acc[key].c++;
|
||||
return acc;
|
||||
}, {});
|
||||
return Object.entries(groups).map(([key, { s, c }]) => ({
|
||||
[gb]: key,
|
||||
result: op === 'sum' ? s : op === 'avg' ? s / c : c
|
||||
}));
|
||||
};
|
||||
export default processCSV;
|
||||
// Generation time: 57.701s
|
||||
// Result: FAIL
|
||||
Reference in New Issue
Block a user