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: tune value of BITS #7908

Closed
josharian opened this issue Apr 30, 2014 · 5 comments
Closed

cmd/compile: tune value of BITS #7908

josharian opened this issue Apr 30, 2014 · 5 comments

Comments

@josharian
Copy link
Contributor

Large data structures (I'm looking at you, unicode tables) exceed the current register
optimizer's capacity, so some code gets left unoptimized. To see this, run 'go build -a
-gcflags="-w -w" unicode'.

This is controlled by BITS in go.h. Looking just at binary size of hello world as a
proxy for optimization, I see:

BITS=5: 1834544
BITS=6: 1830448
BITS=8: 1830448
BITS=12: 1826352

The impact is small, and increasing BITS increases the memory usage and runtime of the
compiler. However, I was unable to detect that difference on my laptop. I've not tried
on (say) a Raspberry Pi.

Once the compiler is in Go, and we have good tools for measuring the impact on build
performance, let's tune BITS based on real world programs -- or perhaps better, have
BITS dynamically adjust as needed.
@ianlancetaylor
Copy link
Contributor

Comment 1:

Labels changed: added repo-main.

@josharian
Copy link
Contributor Author

Comment 2:

Labels changed: added release-go1.5, removed release-go1.4.

@bradfitz bradfitz modified the milestone: Go1.5 Dec 16, 2014
@josharian
Copy link
Contributor Author

Once the compiler is in Go, we might want to use something like http://research.swtch.com/sparse for these data structures during registerization and liveness analysis.

@josharian
Copy link
Contributor Author

Surprisingly, this also happens in the 90 line Write function in encoding/binary:

encoding/binary/binary.go:335: internal compiler error: variable not optimized: @"".v·47

@rsc rsc removed the repo-main label Apr 14, 2015
@rsc rsc changed the title cmd/gc: tune value of BITS cmd/compile: tune value of BITS Jun 8, 2015
@rsc
Copy link
Contributor

rsc commented Jun 29, 2015

Too late for Go 1.5.

@rsc rsc modified the milestones: Unplanned, Go1.5 Jun 29, 2015
@josharian josharian self-assigned this Jun 29, 2015
@golang golang locked and limited conversation to collaborators Jun 26, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants