dominicletz
Creator of Elixir Desktop
Hi there,
this is a tool I’ve been using myself quite a bit recently for online debugging and performance analysis. It’s a simple remote shell Sampling Profiler module.
Here you can get it:
https://github.com/dominicletz/profiler
It’s focused on shell usage so all commands print to stdout. Usage is simple after including it in your project. E.g. here it’s used to profiler the Elixir compiler and shows use how much time is % spend in function calls:
iex(diode@leno)3> pid = spawn(fn() -> for _ <- 1..100000, do: Elixir.Code.compile_file("lib/debounce.ex") end)
#PID<0.731.0>
iex(diode@leno)4> Profiler.profile(pid)
96% {:erl_eval, :expr, 5, [file: 'erl_eval.erl', line: 411]}
96% {:erl_eval, :expr_list, 6, [file: 'erl_eval.erl', line: 888]}
96% {:erl_eval, :do_apply, 6, [file: 'erl_eval.erl', line: 680]}
96% {Enum, :reduce_range_inc, 4, [file: 'lib/enum.ex', line: 3371]}
96% {:erl_eval, :expr, 5, [file: 'erl_eval.erl', line: 232]}
96% {:erl_eval, :do_apply, 6, [file: 'erl_eval.erl', line: 680]}
78% {Code, :compile_file, 2, [file: 'lib/code.ex', line: 1157]}
74% {:elixir_compiler, :quoted, 3, [file: 'src/elixir_compiler.erl', line: 18]}
74% {:elixir_lexical, :run, 3, [file: 'src/elixir_lexical.erl', line: 14]}
74% {:elixir_compiler, :eval_forms, 3, [file: 'src/elixir_compiler.erl', line: 46]}
73% {:elixir, :eval_forms, 3, [file: 'src/elixir.erl', line: 263]}
73% {:elixir, :recur_eval, 3, [file: 'src/elixir.erl', line: 278]}
73% {:erl_eval, :do_apply, 6, [file: 'erl_eval.erl', line: 680]}
42% {:elixir_module, :compile, 5, [file: 'src/elixir_module.erl', line: 107]}
42% {:elixir_module, :eval_form, 6, [file: 'src/elixir_module.erl', line: 333]}
31% {:elixir_compiler, :compile, 3, [file: 'src/elixir_compiler.erl', line: 58]}
31% {:elixir_erl_compiler, :spawn, 2, [file: 'src/elixir_erl_compiler.erl', line: 20]}
10% {:elixir_compiler, :compile, 3, [file: 'src/elixir_compiler.erl', line: 60]}
21% {:elixir_module, :compile, 5, [file: 'src/elixir_module.erl', line: 140]}
21% {:elixir_erl_compiler, :spawn, 2, [file: 'src/elixir_erl_compiler.erl', line: 20]}
7% {:elixir_module, :compile, 5, [file: 'src/elixir_module.erl', line: 142]}
7% {:code_server, :call, 1, [file: 'code_server.erl', line: 139]}
18% {Code, :verify_loaded, 1, [file: 'lib/code.ex', line: 1394]}
17% {Module.ParallelChecker, :collect_results, 2, [file: 'lib/module/parallel_checker.ex', line: 31]}
:ok
By default it takes 10000 samples, one every millisecond and then analyzes the stack traces. Since the sampling is time based it’s especially useful when reduction count based profiling leads you to a red herring.
Have fun!
Trending in Announcing
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
New
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
offset-based pagination with...
New
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub.
Docs are at OpenaiEx User Gu...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly.
One of i...
New
Phoenix components for pagination, sortable tables and filter forms with Flop and (optionally) Ecto.
pagination
cursor pagination
sorta...
New
Please say hi to a new lib, Astro that aims to deliver easy-to-consume astronomy calculations of practical use. For now it only calculat...
New
Other Trending Topics
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
I am seeing a lot of aplications of Argumentum ad Vericundiam in software discussions. They do link some piece of writing and point us to...
New
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog
It says that Fly is going all-in on sprites, which is a worry ...
New
Hey folks,
I just published a post about Hologram’s funding and where the project goes next - the short version:
Curiosum as Main Spons...
New
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using.
We’re particularly inte...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #ai
- #iex
- #graphql
- #elixirconf-us
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming









