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

stephenafamo / scan / 28873360656
90%
main: 90%

Build:
Build:
LAST BUILD BRANCH: perf/reuse-row-scan-buffers
DEFAULT BRANCH: main
Ran 07 Jul 2026 02:19PM UTC
Jobs 1
Files 9
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:17PM UTC coverage: 90.016% (+0.05%) from 89.969%
28873360656

Pull #9

github

sandonemaki
perf: reuse per-row scan buffers in Row

The per-row scan path (scanCurrentRow, run once per row for every mapper
type and every query) allocated two slices on each row:

- scanDestinations was reallocated with make() purely to reset state,
  even though the before hook re-populates the same indices
  deterministically each row.
- createTargets allocated a fresh []any for rows.Scan on every row,
  even though drivers don't retain it past the Scan call.

Keep both slices on Row, allocated once in wrapRows, and reuse them each
row: zero scanDestinations in place (go.mod is go 1.18, so no clear()
builtin) and refill scanTargets — every index is overwritten each row,
so no stale values linger.

Safe because before(v) -> scanCurrentRow -> after(val) is synchronous
per row and columns are constant per query.

Wide-struct bench (11 cols, 100 rows):
  ScanAll: 520 -> 321 allocs/op (-38%), 134704 -> 88512 B/op (-34%)
  ScanOne:  16 -> 15 allocs/op,          2808 ->  2552 B/op
Pull Request #9: perf: reuse per-row scan buffers in Row

5 of 5 new or added lines in 1 file covered. (100.0%)

577 of 641 relevant lines covered (90.02%)

42.4 hits per line

Jobs
ID Job ID Ran Files Coverage
1 28873360656.1 07 Jul 2026 02:19PM UTC 9
90.02
GitHub Action Run
Source Files on build 28873360656
  • Tree
  • List 9
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #9
  • PR Base - main (#28859538099)
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