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: memory reductions slowed down the linker #31898

Closed
aclements opened this issue May 8, 2019 · 2 comments
Closed

cmd/link: memory reductions slowed down the linker #31898

aclements opened this issue May 8, 2019 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@aclements
Copy link
Member

CL 173938, which switched to using mmap'd symbol name strings, made the linker 15% slower. Based on the profile, the reason appears to be completely silly: the new call to r.rd.Offset() in objReader.readSymName is remarkably expensive. The Seek call used to find the offset is roughly 20% of the profile.

@cherrymui suggested we could make bio.Reader directly use the mmap'ed backing store when we have it and simply track its own offset. We should also avoid the Offset call if we don't have the mmap'ed backing store, since we don't need it then.

Alternatively, we could continue using the underlying file, but track the offset ourselves in bio.Reader.

/cc @thanm @cherrymui

@aclements aclements added this to the Go1.13 milestone May 8, 2019
@thanm
Copy link
Contributor

thanm commented May 8, 2019

Good catch. Your analysis makes sense...

@andybons andybons added the NeedsFix The path to resolution is known, but the work has not been done. label May 8, 2019
@thanm thanm self-assigned this May 8, 2019
@gopherbot
Copy link

Change https://golang.org/cl/176039 mentions this issue: cmd/link: fix link time regression in object file reading

@golang golang locked and limited conversation to collaborators May 8, 2020
@rsc rsc unassigned thanm Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants