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

romshark / datapages / 37689647710

07 Oct 2026 08:57PM UTC coverage: 44.209% (+0.05%) from 44.163%
37689647710

push

github

romshark
perf: Stop copying strings written to responses

The writers that wrap a response have no WriteString,
which makes io.WriteString copy every string into a new slice.
offline.Middleware also hides ReadFrom,
which http.FileServer uses for sendfile.

Allocations per request:

    example/counter GET /                            27 -> 19
    offline.Middleware, page of 22 WriteString       35 -> 14
    offline.Middleware, 30 KB script via FileServer  18 -> 17

ReadFrom forwards only a response that passes through.
A page still copies through Write, which decides on its first bytes
and commits no status before the source produces a byte.

36 of 36 new or added lines in 3 files covered. (100.0%)

1 existing line in 1 file now uncovered.

16290 of 36848 relevant lines covered (44.21%)

583.45 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.3
/runtime/httpserve/core.go


Source Not Available

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