mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-03-17 03:11:01 +00:00
Docs: Update benchmark for openai/gpt-5.3-codex
This commit is contained in:
@@ -1,4 +1,28 @@
|
||||
const getTurf = (() => {
|
||||
let mod;
|
||||
return () => (mod ??= import("https://cdn.jsdelivr.net/npm/@turf/turf@7.2.0/+esm"));
|
||||
})();
|
||||
|
||||
async function analyzeGPS(readings, boundary) {
|
||||
if (!Array.isArray(readings) || !boundary) return 0;
|
||||
const turf = await getTurf();
|
||||
const coords = readings
|
||||
.filter(
|
||||
r =>
|
||||
r &&
|
||||
Number.isFinite(r.ts) &&
|
||||
Array.isArray(r.loc) &&
|
||||
r.loc.length === 2 &&
|
||||
r.loc.every(Number.isFinite) &&
|
||||
turf.booleanPointInPolygon(turf.point(r.loc), boundary, { ignoreBoundary: true })
|
||||
)
|
||||
.sort((a, b) => a.ts - b.ts)
|
||||
.map(r => r.loc);
|
||||
|
||||
if (coords.length < 2) return 0;
|
||||
const km = turf.length(turf.lineString(coords), { units: "kilometers" });
|
||||
return Math.round(km * 100) / 100;
|
||||
}
|
||||
export default analyzeGPS;
|
||||
// Generation time: 0.407s
|
||||
// Result: FAIL
|
||||
// Generation time: 10.244s
|
||||
// Result: PASS
|
||||
Reference in New Issue
Block a user