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

Use runtime.CallersFrames #365

Merged
merged 2 commits into from
Mar 10, 2017
Merged

Use runtime.CallersFrames #365

merged 2 commits into from
Mar 10, 2017

Conversation

bufdev
Copy link
Contributor

@bufdev bufdev commented Mar 9, 2017

Just doing #354

@prashantv
Copy link
Collaborator

Can you post a summary of any differences in the benchmark results from switching to CallerFrames? Just curious what kind of performance penalty we're paying (if any).

@akshayjshah
Copy link
Contributor

The relevant benchmark here is BenchmarkStackField.

@bufdev
Copy link
Contributor Author

bufdev commented Mar 10, 2017

# master
BenchmarkStackField-8   	 1000000	      1032 ns/op	     449 B/op	       2 allocs/op
# runtime-frames
BenchmarkStackField-8   	 1000000	      1008 ns/op	     449 B/op	       2 allocs/op

no change it seems like

@akshayjshah
Copy link
Contributor

akshayjshah commented Mar 10, 2017

The escape analyzer & inlining have our back here - even though CallerFrames returns a reference, the func gets inlined so it doesn't escape and so we're not penalized.

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

Successfully merging this pull request may close these issues.

3 participants