/** * This file contains performance tests which may take minutes to run. * To test performance, change "test.skip" to "test" below. Tests in * this file should always be committed as "test.skip". */ import { pointInPolygon, Point2D } from '../utilities'; test.skip('pointInPolygon x 10000', () => { const polygon = []; for (let i = 0; i < 100; ++i) polygon.push({ x: Math.random() * 20 - 10, y: Math.random() * 20 - 10 }); const classifier = pointInPolygon(polygon); const points: Point2D[] = []; for (let i = 0; i < 100000; ++i) points.push({ x: Math.random() * 20 - 10, y: Math.random() * 20 - 10 }); console.log(performance.now()); points.forEach(classifier); console.log(performance.now()); });