Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: use runtime.zeroVal for small zero-valued readonly static vars #23948

Open
josharian opened this issue Feb 20, 2018 · 5 comments
Open
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. Performance
Milestone

Comments

@josharian
Copy link
Contributor

Split out from #23929. No reason to have lots of different zero-valued readonly symbols when we can re-use runtime.zeroVal.

@mvdan
Copy link
Member

mvdan commented Feb 20, 2018

Is this for performance, or to reduce binary size? Or perhaps both?

@bradfitz bradfitz added this to the Unplanned milestone Feb 20, 2018
@martisch
Copy link
Contributor

Likely both.

@josharian
Copy link
Contributor Author

Performance: lower cache impact of reading zero values.

Binary size: fewer symbols.

Toolspeed: less to link.

I’d expect very minor improvements on all three.

@gopherbot
Copy link

Change https://golang.org/cl/186477 mentions this issue: cmd/compile: optimize comparisons with zero values

@agnivade
Copy link
Contributor

This was my first serious foray into the front-end. I wanted to take this opportunity and thank @martisch for guiding me on this, and his patience for bearing with my questions while stumbling around the front-end code. Thanks Martin !

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. Performance
Projects
None yet
Development

No branches or pull requests

6 participants