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: cache objabi.PathToPrefix in sym.Library #44727

Closed
qingyunha opened this issue Mar 2, 2021 · 1 comment
Closed

cmd/link: cache objabi.PathToPrefix in sym.Library #44727

qingyunha opened this issue Mar 2, 2021 · 1 comment
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Performance

Comments

@qingyunha
Copy link
Contributor

There are several places using pkg := objabi.PathToPrefix(lib.Pkg), it may be good to cache it in sym.Library.

link/internal/ld/data.go:       pkg = objabi.PathToPrefix(pkg)
link/internal/ld/go.go:         loadcgo(ctxt, filename, objabi.PathToPrefix(lib.Pkg), data[p0:p1])
link/internal/ld/ld.go: l.Pkgprefix = objabi.PathToPrefix(pkg)
link/internal/ld/lib.go:        pkg := objabi.PathToPrefix(lib.Pkg)
link/internal/ld/lib.go:        pkg := objabi.PathToPrefix(lib.Pkg)
link/internal/ld/link.go:       pkg := objabi.PathToPrefix(l.Pkg)
link/internal/loader/loader.go: pkg = objabi.PathToPrefix(pkg) // the object file contains escaped package path
link/internal/loader/loader.go: pkgprefix := objabi.PathToPrefix(lib.Pkg) + "."
@seankhliao seankhliao added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Performance labels Mar 2, 2021
@cherrymui
Copy link
Member

It doesn't seem to me that any of them is on performance-critical code path. If you disagree, send a CL with measurements. Thanks.

link/internal/ld/ld.go: l.Pkgprefix = objabi.PathToPrefix(pkg)

I don't see that in the current code. What version of the code are you looking at?

@golang golang locked and limited conversation to collaborators Mar 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Performance
Projects
None yet
Development

No branches or pull requests

4 participants