Docs: Update benchmark results

This commit is contained in:
github-actions[bot]
2025-11-27 19:36:55 +00:00
parent e8b9dd6d0e
commit ba567f4017
109 changed files with 1138 additions and 1679 deletions

View File

@@ -1,18 +1,23 @@
async function findConvexHull(pts) {
if (!Array.isArray(pts)) return [];
const { default: _ } = await import('https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js');
const points = _.sortBy(_.uniqWith(pts, (a, b) => a.x === b.x && a.y === b.y), ['x', 'y']);
if (points.length < 3) return points;
const cross = (o, a, b) => (a.x - o.x) * (b.y - o.y) - (a.y - o.y) * (b.x - o.x);
const build = (h, p) => {
while (h.length >= 2 && cross(h[h.length - 2], h[h.length - 1], p) <= 0) h.pop();
h.push(p);
};
const lower = [], upper = [];
for (const p of points) build(lower, p);
for (let i = points.length; i--; ) build(upper, points[i]);
lower.pop();
upper.pop();
return lower.concat(upper);
async function findConvexHull(p) {
const { default: _ } = await import('https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js'),
u = _.uniqWith(_.sortBy(p, 'x', 'y'), (a, b) => a.x === b.x && a.y === b.y);
if (u.length < 3) return u;
const cross = (o, a, b) => (a.x - o.x) * (b.y - o.y) - (a.y - o.y) * (b.x - o.x),
build = (pts) => {
const h = [];
for (const q of pts) {
while (h.length > 1 && cross(h[h.length - 2], h[h.length - 1], q) <= 0) h.pop();
h.push(q);
}
return h;
};
const l = build(u),
r = build([...u].reverse());
return [...l.slice(0, -1), ...r.slice(0, -1)];
}
export default findConvexHull;
export default findConvexHull;
// Generation time: 147.393s
// Result: FAIL