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

Comments

@qingyunha
Copy link
Contributor

@qingyunha qingyunha commented Mar 2, 2021

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) + "."
@cherrymui
Copy link
Contributor

@cherrymui cherrymui commented Mar 2, 2021

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?

@cherrymui cherrymui closed this Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants