Mapping software developer Globus has published earstrip, a polygon-triangulation library designed to prepare map geometry for graphics processors with less overhead than its previous approach and the widely used earcut implementation. The project is available as a single C++ header and as a WebAssembly package on npm under the permissive ISC license.

Polygon triangulation is a largely invisible but essential stage in digital map rendering. Buildings, parks and other filled shapes usually arrive as polygon outlines, while graphics processors render triangles. Before a map can be drawn, the renderer must split each outline—including shapes with holes—into a set of triangles that covers the same area.

Globus tested the new implementation on 3,740,425 polygons from an offline map of Poland’s Masovian Voivodeship. The company says earstrip completed that workload in 489 milliseconds on one core of an Apple M4 Pro. In its published comparison, the C++ implementation was 14% faster than earcut.hpp, while the browser version ran between 1.4 and 2.1 times as fast as earcut.js. These figures are the developer’s benchmark on its selected dataset and hardware, not an independent cross-platform evaluation.

The work began with a change in algorithmic priorities. Globus had used constrained Delaunay triangulation, which favors well-shaped triangles and took 2.93 seconds on the same dataset. That property can matter in simulations or when values are interpolated across geometry, but it offers little benefit for a flat map fill. Nearly half of the test polygons had four vertices or fewer, making the more elaborate process expensive for many simple shapes.

Earstrip instead applies ear clipping. The method repeatedly identifies a convex corner whose triangle contains no other relevant boundary point, removes that triangle, and continues until the polygon is fully divided. The implementation also handles holes by connecting them to the outer boundary with safe bridges, turning the geometry into a boundary that the clipping process can traverse.

The developer’s initial complete ear-clipping version took 1.12 seconds on the dataset. Subsequent changes focused on the cost of testing candidate ears, especially for the relatively small number of large polygons where repeatedly scanning many vertices becomes expensive. The final benchmark reflects those accumulated optimizations rather than a simple implementation of the textbook technique.

Earstrip accepts the same arguments as earcut, which may make experiments easier for teams already using that interface. The release gives map-engine developers another option when throughput matters more than producing Delaunay-quality triangles. Its practical advantage will still depend on data shape, runtime, processor and integration costs, so users will need to benchmark it against their own workloads before switching production renderers.