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

uber / h3-go
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: conformance/dedup
DEFAULT BRANCH: master
Repo Added 18 Sep 2018 05:56PM UTC
Files 20
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

LAST BUILD ON BRANCH bench/b-loop
branch: bench/b-loop
CHANGE BRANCH
x
Reset
  • bench/b-loop
  • bench-ranges
  • bench/typed-sinks
  • chore-upgrade-h3-core
  • ci/nightly
  • conformance/contract
  • conformance/curated
  • conformance/dedup
  • conformance/digest-merkle
  • conformance/digest-streams
  • conformance/digests
  • conformance/floats
  • conformance/hierarchy
  • conformance/inspection
  • conformance/regions
  • conformance/sets
  • conformance/traversal-edges-vertexes-localij
  • conformance/unsafe
  • feat-add-error-codes
  • feat/construct-cell-grid-disk-unsafe
  • feat/latlng-to-cells-batch
  • fix/edge-length-tolerance
  • fix/great-circle-fma
  • gilley/adopt-modules
  • gilley/test-str
  • gilley/travis
  • griddisk-negative-k-guard
  • h3go/distance-fma
  • h3go/exact-projection-test
  • h3go/exhaustive-invariants
  • h3go/polar-latitude
  • joegilley-patch-2
  • joegilley-patch-3
  • justinhwang/4.3
  • justinhwang/4.5
  • justinhwang/badge
  • justinhwang/bindings
  • justinhwang/bit
  • justinhwang/bump
  • justinhwang/changelog
  • justinhwang/coverage
  • justinhwang/doc
  • justinhwang/docs
  • justinhwang/edge
  • justinhwang/err
  • justinhwang/forward-gnomonic-opt
  • justinhwang/from_string
  • justinhwang/generics
  • justinhwang/github
  • justinhwang/greatcircle
  • justinhwang/griddiskunsafe
  • justinhwang/gridring
  • justinhwang/indexdigit
  • justinhwang/intpow
  • justinhwang/latlngcell
  • justinhwang/latlngstr
  • justinhwang/numverts
  • justinhwang/paritytest-benchmarks
  • justinhwang/purego-phase-a
  • justinhwang/purego-phase-b
  • justinhwang/purego-phase-c
  • justinhwang/purego-phase-d
  • justinhwang/purego-phase-e
  • justinhwang/purego-phase-f
  • justinhwang/purego-phase-g
  • justinhwang/readme
  • justinhwang/remove-h3core
  • justinhwang/stack
  • justinhwang/tostring
  • justinhwang/tovec3-projection-opt
  • justinhwang/unsafe
  • justinhwang/vertex
  • maintainer-banner
  • master
  • perf/cell-area-boundary
  • perf/grid-distance
  • perf/griddisk-safe-hashset
  • perf/latlng-sincos
  • perf/multipolygon-flat-index
  • perf/polygon-to-cells-flat-sets
  • perf/small-ops
  • pin-github-actions-sha
  • refs/tags/v3.7.0
  • refs/tags/v3.7.1
  • refs/tags/v4.0.0
  • refs/tags/v4.0.1
  • refs/tags/v4.1.0
  • refs/tags/v4.1.1
  • refs/tags/v4.1.2
  • refs/tags/v4.2.0
  • refs/tags/v4.2.1
  • refs/tags/v4.2.2
  • refs/tags/v4.2.3
  • refs/tags/v4.2.4
  • refs/tags/v4.3.0
  • refs/tags/v4.4.0
  • refs/tags/v4.4.1
  • refs/tags/v4.5.0
  • update-h3
  • upgrade-github-actions-node24
  • v3.0.0
  • v3.0.1
  • v3.0.2
  • v4
  • vscode
  • zcoleman/exposing-polygontocells-containment
  • zcoleman/issue-78

14 Oct 2026 07:29PM UTC coverage: 100.0%. Remained the same
38624198008

Pull #168

github

justinhwang
bench: use b.Loop in every benchmark and drop the result sinks

The root package's benchmarks still counted to b.N and stored each result
in a package-level variable so the compiler could not discard the call.
Since Go 1.24 b.Loop does both jobs: it keeps the arguments and results of
every call written between its braces alive, and it resets the timer
before the first iteration, so the sinks and the one explicit ResetTimer
are redundant. The module already requires Go 1.24 and the other
benchmarks already use b.Loop.

Convert the nineteen b.N loops, remove the sink variables in bench_test.go,
h3_bench_test.go and x/h3go/latlng_test.go, and keep only the inputs at
package scope so they are not constant-folded into the measured call.
Error-returning calls are written as blank assignments for errcheck; the
keep-alive applies to assigned values as well as to bare calls.

paritytest is unchanged. Its benchmarks already use b.Loop, but the
measured call sits inside a closure invoked from the loop, outside the
keep-alive's syntactic scope, so its sink helper still has a job.

The numbers move for the sub-nanosecond benchmarks only. b.Loop costs
about two nanoseconds per iteration on this machine (its inlined fast
path plus the keep-alive store), which a b.N loop with a global sink did
not pay: Resolution goes from 0.35 to 2.2 ns/op and IsValid from 2.3 to
2.7, while NumCells, already on b.Loop, stays at 2.3. LatLngToVec3,
LatLngToCell and GridDisk are unchanged within noise. Comparisons across
this commit on the bit-twiddling benchmarks are therefore not meaningful;
comparisons after it are.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Pull Request #168: bench: use b.Loop in every benchmark and drop the result sinks

4550 of 4550 relevant lines covered (100.0%)

4166505.92 hits per line

Relevant lines Covered
Build:
Build:
4550 RELEVANT LINES 4550 COVERED LINES
4166505.92 HITS PER LINE
Source Files on bench/b-loop
  • Tree
  • List 20
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
38624198008 bench/b-loop bench: use b.Loop in every benchmark and drop the result sinks The root package's benchmarks still counted to b.N and stored each result in a package-level variable so the compiler could not discard the call. Since Go 1.24 b.Loop does both jobs: ... Pull #168 14 Oct 2026 07:33PM UTC justinhwang github
100.0
See All Builds (487)
  • Repo on GitHub
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