runtime : Callers and CallersFrames is expensive , can i cached CallersFrames 's result .
198 views
Skip to first unread message
kor zhao
unread,
Jul 27, 2021, 1:57:54 PM7/27/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
help
Ian Lance Taylor
unread,
Jul 27, 2021, 4:18:17 PM7/27/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to kor zhao, golang-nuts
Sorry, I'm not sure exactly what you are asking.
The value returned by runtime.Callers is just a slice, and the value
returned by runtime.CallersFrames is an ordinary value. It's fine to
save those values however you like.
Ian
Ian Cottrell
unread,
Jul 27, 2021, 5:08:12 PM7/27/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
Not sure if it the same issue, but one problem is that runtime.CallersFrames returns a *Frames, which means it does an allocation. It would be nice to have a call that either returned a Frames by value, or one that takes a frame to reset and fill in.