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

tecnickcom / gogen / 28873208995
100%

Build:
DEFAULT BRANCH: main
Ran 07 Jul 2026 02:20PM UTC
Jobs 1
Files 168
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

07 Jul 2026 02:16PM UTC coverage: 99.971%. Remained the same
28873208995

push

github

nicolaasuni
perf(random): fewer allocations and faster UUID/UID generation and formatting

Optimize the random package's hot paths and add zero-allocation hex formatting to the UID types, preserving public behavior (aside from the new Format/Byte methods), the crypto-first lock-free design, 100% test coverage, and clean golangci-lint.

- UUIDv7: read the 8 random bytes into a stack-local buffer via io.ReadFull instead of going through the RandomBytes wrapper, skipping the extra call and error-wrapping setup on the hot path (~3% faster generation, unchanged single allocation); the reader-failure fallback still routes through RandUint64 so generation never panics.
- RandString: read entropy into the not-yet-finalized tail of the result buffer and map accepted bytes in place, instead of allocating a fresh buffer on every rejection-refill pass; the default-charset case drops from 4 allocations to 2 and is ~12% faster at n=16, with identical rejection-sampling behavior.
- UID64: compute the decade year once rather than evaluating time.Year() twice (~5% faster).
- TUID128 and TUID64: add zero-allocation Format(*[N]byte) and Byte() methods mirroring UUID, and encode Hex() through a single stack buffer via uhex.Hex64UB; TUID128.Hex is ~36% faster now that the two-string concatenation is gone, while staying at one allocation.
- TUID128.String: append both base-36 halves into one stack buffer with strconv.AppendUint and convert once, replacing two FormatUint calls plus a concatenation; the output is byte-identical and allocations drop from 3 to 1 (~28% faster).
- Docs: add performance notes to UUIDv7 and comparative notes to UUID.Format covering the table-driven uhex encoding versus fmt.Sprintf and encoding/hex.
- Tests and benchmarks: add Format/Byte tests and benchmarks for both UID types plus a String equivalence check that locks in the byte-identical output.

59 of 59 new or added lines in 4 files covered. (100.0%)

13881 of 13885 relevant lines covered (99.97%)

978.6 hits per line

Jobs
ID Job ID Ran Files Coverage
1 28873208995.1 07 Jul 2026 02:20PM UTC 168
99.97
GitHub Action Run
Source Files on build 28873208995
  • Tree
  • List 168
  • Changed 5
  • Source Changed 5
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28873208995
  • 81ed9dae on github
  • Prev Build on main (#28867038265)
  • Next Build on main (#28875040662)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc