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/compile: don't compile some unexported, inlined functions #41117

Open
josharian opened this issue Aug 28, 2020 · 2 comments
Open

cmd/compile: don't compile some unexported, inlined functions #41117

josharian opened this issue Aug 28, 2020 · 2 comments

Comments

@josharian
Copy link
Contributor

@josharian josharian commented Aug 28, 2020

If a function is:

  • inlined at all call sites
  • not exported
  • not referred to by value (any uses of the function are as a static call)
  • not present in any interface types in its containing package

then we don't need to compile that function.

I suspect that these conditions are frequently met, cheap to check, and reasonably easy to implement.

I thought we had an issue for this, but I don't see one. I don't plan to work on this. I'm filing it in case someone else wants to. :)

@josharian josharian added the ToolSpeed label Aug 28, 2020
@josharian josharian added this to the Unplanned milestone Aug 28, 2020
@networkimprov
Copy link

@networkimprov networkimprov commented Aug 29, 2020

At what line would it report a compile error if not compiled?

@josharian
Copy link
Contributor Author

@josharian josharian commented Aug 29, 2020

We’d still have to typecheck it.

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
You can’t perform that action at this time.