Docs: Update benchmark for openrouter/hunter-alpha

This commit is contained in:
github-actions[bot]
2026-03-11 21:27:35 +00:00
parent bfb7161cfd
commit bd43a83707
12 changed files with 409 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
const processCSV = async (csv, { filterColumn, filterValue, groupBy, aggregateColumn, operation }) => {
const [{ default: Papa }, { default: _ }] = await Promise.all([
import('https://cdn.jsdelivr.net/npm/papaparse@5.4.1/papaparse.min.js'),
import('https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js')
]);
const { data } = Papa.parse(csv.trim(), { header: true, dynamicTyping: true });
const filtered = data.filter(row => row[filterColumn] == filterValue);
const groups = _.groupBy(filtered, groupBy);
return Object.entries(groups).map(([key, rows]) => {
const values = rows.map(row => Number(row[aggregateColumn]) || 0);
const result = operation === 'sum' ? values.reduce((a, b) => a + b, 0)
: operation === 'avg' ? values.reduce((a, b) => a + b, 0) / values.length
: rows.length;
return { [groupBy]: key, result };
});
};
export default processCSV;
// Generation time: 20.976s
// Result: FAIL