Skip to content

Commit c1ade9d

Browse files
committed
sys/generated: don't do lazy initialization of all targets
Currently registration of targets calls targets.Get which does slow lazy initialization. This adds several seconds to start of every binary and test. Don't do that.
1 parent de73685 commit c1ade9d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sys/generated/generated.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ type Desc struct {
2424
}
2525

2626
func Register(os, arch, revision string, init func(*prog.Target), files embed.FS) {
27-
sysTarget := targets.Get(os, arch)
27+
// Does not call targets.Get b/c it does slow lazy initialization of targets.
28+
sysTarget := targets.List[os][arch]
2829
target := &prog.Target{
2930
OS: os,
3031
Arch: arch,

0 commit comments

Comments
 (0)