Docs: Update benchmark for z-ai/glm-4.7

This commit is contained in:
github-actions[bot]
2025-12-23 02:30:02 +00:00
parent 4d6e0294fc
commit 401af17eb6
11 changed files with 217 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
async function findShortestPath(graph, start, end) {
const { default: PriorityQueue } = await import('https://esm.sh/js-priority-queue@1.0.0');
const pq = new PriorityQueue({ comparator: (a, b) => a[1] - b[1] });
const costs = { [start]: 0 };
pq.queue([start, 0]);
while (pq.length) {
const [node, currentCost] = pq.dequeue();
if (node === end) return currentCost;
if (currentCost > costs[node]) continue;
const neighbors = graph[node] || {};
for (const [neighbor, weight] of Object.entries(neighbors)) {
const newCost = currentCost + weight;
if (newCost < (costs[neighbor] ?? Infinity)) {
costs[neighbor] = newCost;
pq.queue([neighbor, newCost]);
}
}
}
return Infinity;
}
export default findShortestPath;
// Generation time: 42.134s
// Result: FAIL