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/link: slow on large inputs #2073

Closed
gopherbot opened this issue Jul 15, 2011 · 19 comments
Closed

cmd/link: slow on large inputs #2073

gopherbot opened this issue Jul 15, 2011 · 19 comments

Comments

@gopherbot
Copy link

by remigius.gieben:

This is *not* with the latest Go version, but with 1b38d90eebcd (release-branch.r58)
release/release.r58
For completeness I add the full p.6, I hope I find the time to narrow it down a bit.

What steps will reproduce the problem?
1. Take the p.6
2. Try to link it '6l p.6

What is the expected output?
An executable.

What do you see instead?
The linker takes a long time instead of being lightning fast. In fact I had to kill it,
because it just takes too long.

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Linux (Ubuntu 11.04)

Which revision are you using?  (hg identify)
(release-branch.r58) release/release.r58


Please provide any additional information below.
I use Ragel to output Go code for a parser I'm creating. This parser works, but now I
run into this problem. It depends on my dns package, so for completeness I'll add that
too.

Attachments:

  1. p.6 (9113 bytes)
  2. dns.a (4399774 bytes)
@gopherbot
Copy link
Author

Comment 1 by remigius.gieben:

This test compiles and links quickly:
gopack grc _test/dns.a _gotest_.6
See attached files.

Attachments:

  1. dns.a (1521822 bytes)
  2. gotest.6 (1377035 bytes)

@gopherbot
Copy link
Author

Comment 2 by remigius.gieben:

This is with 1 change in the Ragel .rl file (to add (DNS) DS record parsing) and makes
it much slower.

Attachments:

  1. dns.a (2249892 bytes)
  2. gotest.6 (2105018 bytes)

@gopherbot
Copy link
Author

Comment 3 by remigius.gieben:

And this is with RRSIG and DNSKEY parsing and that looks like a hang..

Attachments:

  1. dns.a (4504310 bytes)
  2. gotest.6 (4359244 bytes)

@gopherbot
Copy link
Author

Comment 4 by remigius.gieben:

I'm trying the latest weekly, but this fails due to the new 'goto' rules. Ragel isn't
aware of those.

@gopherbot
Copy link
Author

Comment 5 by remigius.gieben:

On Linux/386 with 8g/8l things *do* work. A small testing programming to be linked with
'dns.a' akes about 2 seconds:
% time 8l p.8
2.81s user 0.22s system 3.06s elapsed 99%CPU (8l p.8)
% time 6l p.6
<still running after a couple of minutes>
This is with the current version of Go DNS (https://github.com/miekg/godns)

@gopherbot
Copy link
Author

Comment 6 by remigius.gieben:

Ah, there we go:
% time 6l p.6
865.68s user 0.31s system 866.91s elapsed 99%CPU (6l p.6)

@gopherbot
Copy link
Author

Comment 7 by remigius.gieben:

I'm not entirely sure I linked the correct code on Linux/386. Right now, the linking
there also takes a long time (after a 'make install' with the latest dns code).
Sorry for the noise, Comment 5. is bogus.

@gopherbot
Copy link
Author

Comment 8 by remigius.gieben:

After more debugging I figured out what was going on. Ragel was creating a 10MB large
.go file. No wonder things came to a crawl. Having said that, the compilation was still
very quick, only the linking seems to suffer.

@adg
Copy link
Contributor

adg commented Jul 24, 2011

Comment 9:

I don't think we need to worry about supporting 10mb source files.

Status changed to WontFix.

@rsc
Copy link
Contributor

rsc commented Jul 24, 2011

Comment 10:

Making 6l more efficient is on my medium-to-long term to-do list.

Status changed to LongTerm.

@rsc
Copy link
Contributor

rsc commented Dec 9, 2011

Comment 11:

Labels changed: added priority-later.

@rsc
Copy link
Contributor

rsc commented Sep 12, 2012

Comment 13:

Labels changed: added go1.1maybe.

@robpike
Copy link
Contributor

robpike commented Mar 7, 2013

Comment 14:

Labels changed: removed go1.1maybe.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 15:

Labels changed: added go1.3.

@robpike
Copy link
Contributor

robpike commented Aug 20, 2013

Comment 16:

Labels changed: removed go1.3.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 17:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 18:

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

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 19:

Labels changed: added repo-main.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title cmd/ld: slow on large inputs cmd/link: slow on large inputs Jun 8, 2015
@josharian
Copy link
Contributor

There's no source code here to reproduce with, and the object file format has changed, so testing with the attached object files is not possible. Closing as not reproducible. If you have continuing performance issues with the compiler or linker, please file a new issue with reproduction steps.

@golang golang locked and limited conversation to collaborators Jan 30, 2018
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