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: tables of interface data generate too much code. #6289

Closed
robpike opened this issue Aug 30, 2013 · 5 comments
Closed

cmd/compile: tables of interface data generate too much code. #6289

robpike opened this issue Aug 30, 2013 · 5 comments

Comments

@robpike
Copy link
Contributor

robpike commented Aug 30, 2013

The initialization of the pre-defined color palettes in package image/color/palette
generate an init function with more than 45KB of instructions. In principle, it could be
done entirely in data.

The tables are 512 interface values: type image.Color holding an image.RGBA. The RGBA
value could fit in a word, and the interface's type pointer is known, so in principle
the tables could be laid out at compile time. As it stands, it's about 90 bytes of init
code to generate each table entry.
@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 1:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 2:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 3:

Labels changed: added repo-main.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title cmd/gc: tables of interface data generate too much code. cmd/compile: tables of interface data generate too much code. Jun 8, 2015
@josharian
Copy link
Contributor

I have a fix for this waiting for 1.8

josharian added a commit to josharian/go that referenced this issue May 27, 2016
When possible, emit static data rather than
init functions for interface values.

This:

* cuts 32k off cmd/go
* removes several error values from runtime init
* cuts the size of thenimage/color/palette compiled package from 103k to 34k
* reduces the time to build the package in golang#15520 from 8s to 1.5s

Fixes golang#6289
Fixes golang#15528

Change-Id: I317112da17aadb180c958ea328ab380f83e640b4
josharian added a commit to josharian/go that referenced this issue Jun 19, 2016
When possible, emit static data rather than
init functions for interface values.

This:

* cuts 32k off cmd/go
* removes several error values from runtime init
* cuts the size of the image/color/palette compiled package from 103k to 34k
* reduces the time to build the package in golang#15520 from 8s to 1.5s

Fixes golang#6289
Fixes golang#15528

Change-Id: I317112da17aadb180c958ea328ab380f83e640b4
josharian added a commit to josharian/go that referenced this issue Jun 24, 2016
When possible, emit static data rather than
init functions for interface values.

This:

* cuts 32k off cmd/go
* removes several error values from runtime init
* cuts the size of the image/color/palette compiled package from 103k to 34k
* reduces the time to build the package in golang#15520 from 8s to 1.5s

Fixes golang#6289
Fixes golang#15528

Change-Id: I317112da17aadb180c958ea328ab380f83e640b4
@gopherbot
Copy link

CL https://golang.org/cl/26668 mentions this issue.

josharian added a commit to josharian/go that referenced this issue Aug 31, 2016
When possible, emit static data rather than
init functions for interface values.

This:

* cuts 32k off cmd/go
* removes several error values from runtime init
* cuts the size of the image/color/palette compiled package from 103k to 34k
* reduces the time to build the package in golang#15520 from 8s to 1.5s

Fixes golang#6289
Fixes golang#15528

Change-Id: I317112da17aadb180c958ea328ab380f83e640b4
@bradfitz bradfitz modified the milestones: Go1.8, Unplanned Sep 11, 2016
@golang golang locked and limited conversation to collaborators Sep 12, 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