Re: Any reason using pointers in service methods #88
-
I have read a lot of articles recommended to use values in Go to improve cache locality. So is there any practical reason behind using pointers across all services functions in wtf ?
|
Beta Was this translation helpful? Give feedback.
Answered by
benbjohnson
Oct 28, 2024
Replies: 1 comment
-
You could also do non-pointers but I find that using pointers tends to make the calling code a bit easier to use. It's rare that pointer versus non-pointer code has a noticeable impact unless you're doing tight loops or a large volume of data. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
huyfm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You could also do non-pointers but I find that using pointers tends to make the calling code a bit easier to use. It's rare that pointer versus non-pointer code has a noticeable impact unless you're doing tight loops or a large volume of data.