O'Reilly logo

Adopting Elixir by Jose Valim, Bruce Tate, Ben Marx

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Profiling

Profiling is a performance tuning technique that measures primarily the frequency and duration of function calls. Erlang/OTP ships with three profilers. cprof counts the number of invocations, eprof measures execution time, and fprof measures both frequency and time. Each has its own advantages and disadvantages. cprof runs quite fast and has a minimal impact on execution times, but doesn’t tell you as much as full execution times. On the other hand, fprof provides much more data, but expect it to impact your execution time.

Elixir provides integration with cprof, eprof, and fprof via the Mix tool. In this section, we’ll provide a quick example of using cprof and fprof.

Imagine that your load tests found one fairly slow route. After ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required