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

99designs / gqlgen / 35136891423
0%

Build:
DEFAULT BRANCH: master
Ran 16 Sep 2026 06:53PM UTC
Jobs 1
Files 0
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

16 Sep 2026 06:50PM UTC coverage: 0.0%. Remained the same
35136891423

push

github

web-flow
perf: build the "no child fields" error lazily, without a global var (#4293)

* perf: share the "no child fields" error across all fields of a scalar/enum type

graphql.NewScalarFieldContext's fast path (introduced in #4086 for
argument-less scalar/enum fields) built a fresh error via errors.New(...) on
every single field resolution, even though the message only depends on the
GraphQL type name and there's a small, fixed set of those per schema. #4086's
own verbose fallback path (fields with args) already constructs this error
lazily inside the Child closure; only the fast path evaluated it eagerly as a
function argument.

Add Data.UniqueScalarChildFieldErrors, mirroring the existing
UniqueChildFieldTypes/childFields_* pattern, to emit one shared error value
per distinct scalar/enum type name, and have the fast-path template reference
it instead of calling errors.New per field. NewScalarFieldContext's signature
is unchanged — this only changes what gets passed into it.

Benchmark on _examples/todo's fieldContext_Todo_id, before/after, 100% of the
delta accounted for by the removed errors.New call:

    before: 48.36 ns/op   184 B/op   3 allocs/op
    after:  40.69 ns/op   168 B/op   2 allocs/op

On a production schema with several hundred scalar/enum-typed fields, this
removes one allocation per field per request, unconditionally, regardless of
query shape.

* Revert "perf: share the "no child fields" error across all fields of a scalar/enum type"

This reverts commit 2fdbbdd66.

* perf: build the "no child fields" error lazily, without a global var

@StevenACoffman objected to the shared-global-error approach from the
previous commit: gqlgen is actively moving away from package-level
mutable state (RULES.md #9), and generated code/templates should stay
simple. @korotin proposed a compromise: keep NewScalarFieldContext's
fast path, but pass the scalar/enum type name instead of a pre-built
error, and build the error lazil... (continued)

0 of 0 relevant lines covered (NaN%)

0.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 35136891423.1 16 Sep 2026 06:53PM UTC 0
0.0
GitHub Action Run
Source Files on build 35136891423
Detailed source file information is not available for this build.
  • Back to Repo
  • de2df484 on github
  • Prev Build on master (#34894474957)
  • Next Build on master (#35470548626)
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