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
Milestone

Comments

@josharian
Copy link
Contributor

@josharian josharian commented Feb 20, 2018

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

@mvdan

This comment has been minimized.

Copy link
Member

@mvdan 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

This comment has been minimized.

Copy link
Member

@martisch martisch commented Feb 20, 2018

Likely both.

@josharian

This comment has been minimized.

Copy link
Contributor Author

@josharian josharian commented Feb 20, 2018

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

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jul 17, 2019

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

@agnivade

This comment has been minimized.

Copy link
Contributor

@agnivade agnivade commented Jul 17, 2019

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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.