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

research/pointer-params/ #4

Open
utterances-bot opened this issue Sep 7, 2021 · 6 comments
Open

research/pointer-params/ #4

utterances-bot opened this issue Sep 7, 2021 · 6 comments
Labels

Comments

@utterances-bot
Copy link

Pointers Might Not be Ideal as Arguments

https://golang.design/research/pointer-params/

Copy link
Member

changkun commented Sep 7, 2021

@Yanwenjiepy 感谢指出,应该是个笔误,已修正。

Copy link

xorcare commented Jan 31, 2022

Hello, I found your article and began to conduct my research, at the moment I think that there is a connection not with the size of the structure, but with the number of fields that it has:

Pointers Might Not be Ideal as Arguments

Modified generator source code: Gist

@changkun
Copy link
Member

changkun commented Jan 31, 2022

Hello, I found your article and began to conduct my research, at the moment I think that there is a connection not with the size of the structure, but with the number of fields that it has.

@xorcare Thanks for a follow-up to this article. The article was written at Go 1.16 and back then there was no register-based calling convention, and inline optimization was also not as good as 1.17. If you run the experiment on 1.17, the conclusion might be different.

Still, I think the conclusion of the article would need some sort of update. Thanks again for bringing this up to discussion 👍

@xorcare
Copy link

xorcare commented Jan 31, 2022

JFYI. Environment information:

  • cpu: Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz
  • go version go1.17.6 darwin/amd64

@changkun
Copy link
Member

@xorcare Then it makes some sense. If switch to go 1.16, you may reproduce the article's conclusion.

Copy link

5idu commented Jul 7, 2023

666

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants
@changkun @xorcare @5idu @utterances-bot and others