-
Notifications
You must be signed in to change notification settings - Fork 66
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
Enable tprof #441
base: main
Are you sure you want to change the base?
Enable tprof #441
Conversation
PragTob
commented
Nov 27, 2024
- Fixes tprof :) #439
- also fixes one of the samples not being an .exs 😁
- also updates it and includes tprof
- might consider only adding it on elixir 1.17+ but may be too much
- still needs to be added to docs
* Fixes #439 * also fixes one of the samples not being an .exs 😁 * also updates it and includes tprof * might consider only adding it on elixir 1.17+ but may be too much * still needs to be added to docs
Of course I wrote a test that all built-in profilers work 😂 |
# anonymous fn/2 in :elixir_compiler_2.__FILE__/1 1 0.05 2 2.00 | ||
# :erlang.++/2 10000 14.46 533 0.05 | ||
# anonymous fn/1 in :elixir_compiler_2.__FILE__/1 10000 33.67 1241 0.12 | ||
# Enum.flat_map_list/2 10001 51.82 1910 0.19 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there is a way to pass opts to the profilers, like call_memory
to tprof
to get heap allocs?
https://hexdocs.pm/mix/Mix.Tasks.Profile.Tprof.html#profile/2-options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchee already supports profile_after: {profiler, opts}
🤦
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely! See https://github.com/bencheeorg/benchee?tab=readme-ov-file#configuration for profile_after
a profiler - either as a tuple of {profiler, opts} (e.g., {:fprof, [sort: :own]}) or just the profiler (e.g., :fprof), which is equivalent to {profiler, []}. The accepted built-in profilers are :cprof, :eprof and :fprof.
Should make that clearer/include it in the profiler section of the README though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah didn't see your response, sometimes github auto fetches sometimes it doesn't - but yeah :)
And of course I run 1.17 against erlang versions that don't have tprof yet and so I need to fix that behavior as well or fix the tests... 😅 Erlang versions are much worse though, sadly. |