$ the-wire · showcase
Compiler #-names removed from b.Loop keepalives, bootstrap flags dropped
By RepoJournal · Filed · About Go · Composed from the cited sources · methodology
Go's compiler stops preserving bookkeeping variables that made b.Loop benchmarks look slow, and cmd/dist no longer forces purego or math_big_pure_go when building toolchain1.
The interaction between b.Loop and rangefunc was reporting overly slow results because rangefunc introduces bookkeeping and error-checking variables that are normally optimized out for small loops. The b.Loop transformation preserved those variables to prevent their optimization, which caused the apparent slowdown; that preservation is now removed [1]. Separately, cmd/dist no longer sets purego or math_big_pure_go when building toolchain1. The math_big_pure_go setting dates to when Go 1.4 was required to bootstrap the compiler, considerations that no longer apply, and the purego setting was added for gccgo bootstrap, which can't currently bootstrap the go command because it would need a newer version than gccgo supports [2].
gopls fixed two user-visible edges. Unimported completion now reports types correctly: pkgIDmatches previously handled only Function, Variable, Struct and Constant symbol kinds, so interfaces and named non-struct types from workspace packages were dropped and struct types were labeled "var"; every type is now reported as "type (from ...)", matching the other search paths [3]. gopls also now rejects bad syntax in split/join lines, verifying that opening and closing delimiters are valid, ordered, and match source delimiter characters before computing TextEdits, since parser error recovery on incomplete code can produce AST nodes with token.NoPos or synthetic delimiters [4].
On the tooling and infrastructure side, gopls's SIMD spec picked up two changes: ConvertToZ width rounding now uses the z={zB}{zN}x{xL} constraint so width-rounded methods such as (Float64x2).ConvertToFloat32() appear [5], and specgen gained directives for marking methods as commutative and noting documentation categories [6]. golang/build updated GRPC to v1.83.2 to fix broken Plan9 compilation [7]. The owners table saw the inliner added as a primary-owner entry [8], tools/cmd/goimports and tools/internal/imports moved to shared owners [9], and tools/go/analysis and tools/go/ssa reassigned [10][11].
The vulnerability database added 60 reports under data/reports [12] and 29 reports under data/excluded [13]. On the website, the Tour of Go gained French, German, Korean, and Simplified Chinese translations [14]. In cmd/go, the build action was split into two to prepare for early export: the first action produces export data and the second produces the object for the linker, though for now the full cmd/compile invocation still runs in the first action [15].
Action items
- → Re-run any b.Loop benchmarks that showed unexpected rangefunc slowdowns golang/go [plan]
- → Update google.golang.org/grpc to v1.83.2 if you build on Plan9 golang/build [plan]
- → Check gopls unimported completion type rendering after upgrading golang/tools [monitor]
References
- [1] cmd/compile: remove compiler #-names from b.Loop keepalives, walk closure ↗ golang/go
- [2] cmd/dist: don't set purego or math_big_pure_go when building toolchain1 ↗ golang/go
- [3] gopls/internal/golang/completion: report types in unimported completion ↗ golang/tools
- [4] gopls/internal/golang: reject bad syntax in split/join lines ↗ golang/tools
- [5] simd/internal/spec: fix ConvertToZ width rounding ↗ golang/go
- [6] simd/internal/spec: add categories and commutativity ↗ golang/go
- [7] all: update GRPC package version ↗ golang/build
- [8] devapp/owners: add inliner entry in owner table ↗ golang/build
- [9] devapp/owners: change tools/cmd/goimports & tools/internal/imports owner ↗ golang/build
- [10] devapp/owners: change tools/go/analysis owners to mkalil ↗ golang/build
- [11] devapp/owners: change tools/go/ssa owners to aputman ↗ golang/build
- [12] data/reports: add 60 reports ↗ golang/vulndb
- [13] data/excluded: add 29 reports ↗ golang/vulndb
- [14] _content/tour: add translations ↗ golang/website
- [15] cmd/go: split build action into two ↗ golang/go