This is a fun one: I just sent go.dev/cl/790740, which elides method wrappers for embedded types at offset zero, common for mixins/inherited data types. Doing this removes 60 _thousand_ method wrappers from tsgo's AST package, dropping the compilation of our main exe from 49s to 28s on my machine.
Post
It also shaves 1.3% off of the cmd/compile binary as it also uses embedding in the same way tsgo does for its AST/types (and, probably will even more in the future if I'm able to find time) In addition, 0.6% off of go, 0.66% off of pprof. This is more or less a "fix" for github.com/golang/go/is...
github.comcmd/compile: deduplicate wrappers for promoted methods · Issue #57916 · golang/goGiven: type X int func (*X) m() {} type A struct { X } type B struct { b int32; X } type C struct { c uint32; X } the compiler currently synthesizes method wrappers for the promoted methods: func (...
Yeah one less floppy disk for TS devs to carry around in their backpack. That means fewer back problems in later life.
0 reposts2 likes
No replies yet.