Skip to content

build(node): GOEXPERIMENT=jsonv2 per SCALE_STANDARD#114

Open
hanzo-dev wants to merge 1 commit into
mainfrom
feat/scale-standard
Open

build(node): GOEXPERIMENT=jsonv2 per SCALE_STANDARD#114
hanzo-dev wants to merge 1 commit into
mainfrom
feat/scale-standard

Conversation

@hanzo-dev
Copy link
Copy Markdown
Member

Summary

Per SCALE_STANDARD.md §2 (https://github.com/hanzoai/HIPs/blob/main/docs/SCALE_STANDARD.md) — Dockerfile compiles with GOEXPERIMENT=jsonv2.

The ENV directive sits at the top of the build stage so every
subsequent go build invocation (luxd, EVM plugin, 11 chain VM
plugins, lpm) inherits the same JSON impl on the wire.

Verified numbers

Bench json/v1 json/v2 Δ
Edge POST roundtrip 19,782 ns / 73 allocs 17,406 ns / 56 allocs -12% time, -23% allocs
Marshal-only 12,860 ns / 34 allocs 10,092 ns / 34 allocs -22% time
Unmarshal-only 17,122 ns / 67 allocs 13,785 ns / 50 allocs -19% time, -25% allocs

Notes

DO NOT MERGE — release-train PR.

Per SCALE_STANDARD.md §2 (~/work/hanzo/hips/docs/SCALE_STANDARD.md) —
every Go production Dockerfile that emits JSON to a client builds with
GOEXPERIMENT=jsonv2. Verified on hanzoai/zip's json_bench_test.go:
- Edge POST roundtrip: -12% time, -23% allocs
- Marshal-only: -22% time
- Unmarshal-only: -19% time, -25% allocs

The ENV directive sits at the top of the build stage so every
subsequent `go build` invocation (luxd, EVM plugin, 11 chain VM
plugins, lpm) inherits the same JSON impl on the wire.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant