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: loading N packages takes O(N²) time #20578

Closed
rsc opened this issue Jun 5, 2017 · 4 comments
Closed

cmd/link: loading N packages takes O(N²) time #20578

rsc opened this issue Jun 5, 2017 · 4 comments
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Jun 5, 2017

There are some deduplication scans in the linker to avoid loading the same package (same import path) multiple times. These use a linear scan over all packages already loaded, so loading N packages takes O(N²) time (even with no duplicates). These scans should be replaced by map checks, cutting the time for N packages to O(N).

I have a CL and will send it.

@rsc rsc added this to the Go1.9 milestone Jun 5, 2017
@rsc rsc self-assigned this Jun 5, 2017
@gopherbot
Copy link

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

@odeke-em
Copy link
Member

odeke-em commented Jun 5, 2017

Hmm, how come gobot didn't close this issue when CL https://go-review.googlesource.com/c/44852/ was merged into master as 51711d1.

@bradfitz
Copy link
Contributor

bradfitz commented Jun 5, 2017

Maybe because Github has been having problems today? https://status.github.com/messages

@bradfitz bradfitz closed this as completed Jun 5, 2017
@odeke-em
Copy link
Member

odeke-em commented Jun 5, 2017

Ah, gotcha.

@golang golang locked and limited conversation to collaborators Jun 5, 2018
@rsc rsc removed their assignment Jun 23, 2022
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

4 participants