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

antchfx / xpath / 37663645272
83%
master: 85%

Build:
Build:
LAST BUILD BRANCH: fix/not-number-string-argument
DEFAULT BRANCH: master
Ran 07 Oct 2026 06:02PM UTC
Jobs 1
Files 8
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 Oct 2026 05:32PM UTC coverage: 83.36% (-0.5%) from 83.868%
37663645272

Pull #149

github

thunderkatz
build: pre-compute translate() Replacer for string-literal src/dst

When the src and dst arguments of translate() are string literals
(operandNode values), the Replacer can be built once at query-compile
time rather than on every evaluation call.

Previously each call to translateFunc.func1 allocated a []rune for dst,
a []rune for the src range, a []string for the replacer pairs, and a
*strings.Replacer — four heap objects per DOM node visited. With large
documents these show up as a significant source of allocs in production
heap profiles.

translateFuncConst accepts the literal src and dst strings, builds the
Replacer eagerly, and returns a closure whose only per-call work is
evaluating the first argument and calling replacer.Replace.

Benchmark (200-node document, translate(@style,'ABCDEF','abcdef')):
  per-call overhead before: ~18 allocs / 784 B
  per-call overhead after:    0 allocs /   0 B (Replacer pre-built)

Dynamic src/dst (rare in practice) continue to use translateFunc
unchanged, so no correctness or behaviour change for that path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pull Request #149: build: pre-compute translate() Replacer for string-literal src/dst

20 of 20 new or added lines in 2 files covered. (100.0%)

18 existing lines in 2 files now uncovered.

2590 of 3107 relevant lines covered (83.36%)

338.88 hits per line

Coverage Regressions

Lines Coverage ∆ File
16
90.94
-2.74% func.go
2
82.62
-0.3% build.go
Jobs
ID Job ID Ran Files Coverage
1 37663645272.1 07 Oct 2026 06:02PM UTC 8
83.36
GitHub Action Run
Source Files on build 37663645272
  • Tree
  • List 8
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #149
  • PR Base - master (#37638893654)
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