• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

uber / h3-go / 36476859224
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: perf/small-ops
DEFAULT BRANCH: master
Ran 28 Sep 2026 08:09PM UTC
Jobs 1
Files 19
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Sep 2026 08:06PM UTC coverage: 100.0%. Remained the same
36476859224

push

github

justinhwang
perf: generic flat hash table and buffer reuse for CellsToMultiPolygon in x/h3go

Generalize the open-addressing cell set from PR 140 into flatTable[K Index, V],
a linear-probing table keyed by any H3 index type with an inline value. cellSet
becomes an alias for flatTable[Cell, struct{}], and the value field is placed
first so a set entry stays 8 bytes (Go pads a trailing zero-size field).

Use it in CellsToMultiPolygon, which was the last parity benchmark where the
pure-Go path was materially slower than cgo (188 allocs/op):

- buildArcs indexes edge to arc position in a flatTable[DirectedEdge, int]
  instead of a Go map, and enumerates each cell's edges into a stack array via
  the new appendDirectedEdges instead of a heap slice per cell.
- buildOutlineLoops counts a loop's arcs first and allocates its vertex slice
  once (one vertex per arc, two at Class III resolutions), then appends every
  edge boundary straight into it through the new DirectedEdge.appendBoundary.
- The stable sorts move from sort.SliceStable to slices.SortStableFunc.

The boundary builders now append into a caller-supplied slice. Cell.Boundary
and DirectedEdge.Boundary preallocate their maximum size, so they make one
allocation instead of growing through four, and callers that consume the
result immediately (CellArea, EdgeLength, Vertex.LatLng, hexRadiusKm) get the
buffer on the stack.

Output ordering is unchanged; the cgo parity tests cover it.

benchstat, Go implementation only, 10 runs each, Apple M3 Max:

                         │   old (6b129ec)   │             new              │
                         │      sec/op       │   sec/op     vs base         │
CellsToMultiPolygon      46.25µ ± 13%   33.18µ ± 4%  -28.27% (p=0.000 n=10)
CellToBoundary           477.5n ±  6%   426.2n ± 2%  -10.76% (p=0.000 n=10)
DirectedEdgeBoundary     880.7n ± 40%   325.5n ± 5%  -63.04% (p=0.000 n=10)
VertexLatLng             221.0n ± 17%   179.4n ± 3%  -18.85% (p=0.000 n=10)
DirectedEdges   ... (continued)

123 of 123 new or added lines in 7 files covered. (100.0%)

4350 of 4350 relevant lines covered (100.0%)

3046060.17 hits per line

Jobs
ID Job ID Ran Files Coverage
1 Go- - 36476859224.1 28 Sep 2026 08:09PM UTC 19
100.0
GitHub Action Run
Source Files on build 36476859224
  • Tree
  • List 19
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 2fbbffec on github
  • Prev Build on master (#36468931543)
  • Next Build on perf/multipolygon-flat-index (#36477088470)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc