mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-03-17 03:11:01 +00:00
Refactor: Remove stale benchmark outputs
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
let turf$;
|
||||
|
||||
async function analyzeGPS(readings, boundary) {
|
||||
turf$ ||= import("https://esm.sh/@turf/turf@6.5.0");
|
||||
const { point, booleanPointInPolygon, lineString, length } = await turf$;
|
||||
|
||||
const coords = (readings || [])
|
||||
.filter(r => r && Array.isArray(r.loc) && r.loc.length === 2 && Number.isFinite(r.ts))
|
||||
.filter(r => booleanPointInPolygon(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 = length(lineString(coords), { units: "kilometers" });
|
||||
return +km.toFixed(2);
|
||||
}
|
||||
export default analyzeGPS;
|
||||
// Generation time: 7.395s
|
||||
// Result: PASS
|
||||
@@ -1,14 +0,0 @@
|
||||
async function analyzeGPS(readings, boundary) {
|
||||
const turf = await import('https://cdn.skypack.dev/@turf/turf');
|
||||
const inside = readings.filter(r =>
|
||||
turf.booleanPointInPolygon(turf.point(r.loc), boundary, { ignoreBoundary: true })
|
||||
);
|
||||
if (inside.length < 2) return 0;
|
||||
inside.sort((a, b) => a.ts - b.ts);
|
||||
const line = turf.lineString(inside.map(r => r.loc));
|
||||
const km = turf.length(line, { units: 'kilometers' });
|
||||
return Math.round(km * 100) / 100;
|
||||
}
|
||||
export default analyzeGPS;
|
||||
// Generation time: 1.710s
|
||||
// Result: PASS
|
||||
@@ -1,11 +0,0 @@
|
||||
const analyzeGPS = async (readings, boundary) => {
|
||||
const t = await import('https://esm.sh/@turf/turf');
|
||||
const pts = readings
|
||||
.filter(r => t.booleanPointInPolygon(t.point(r.loc), boundary))
|
||||
.sort((a, b) => a.ts - b.ts)
|
||||
.map(r => r.loc);
|
||||
return pts.length < 2 ? 0 : Math.round(t.length(t.lineString(pts)) * 100) / 100;
|
||||
};
|
||||
export default analyzeGPS;
|
||||
// Generation time: 93.284s
|
||||
// Result: PASS
|
||||
Reference in New Issue
Block a user