{"id":13507600,"url":"https://github.com/parroty/exprof","last_synced_at":"2026-02-22T10:35:23.958Z","repository":{"id":11154229,"uuid":"13524342","full_name":"parroty/exprof","owner":"parroty","description":"A simple code profiler for Elixir using eprof.","archived":false,"fork":false,"pushed_at":"2020-12-17T14:55:12.000Z","size":42,"stargazers_count":180,"open_issues_count":1,"forks_count":11,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-21T19:02:51.965Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parroty.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-12T15:56:49.000Z","updated_at":"2025-09-27T07:04:58.000Z","dependencies_parsed_at":"2022-09-23T20:40:24.830Z","dependency_job_id":null,"html_url":"https://github.com/parroty/exprof","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/parroty/exprof","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parroty%2Fexprof","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parroty%2Fexprof/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parroty%2Fexprof/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parroty%2Fexprof/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parroty","download_url":"https://codeload.github.com/parroty/exprof/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parroty%2Fexprof/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29709402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T10:34:24.778Z","status":"ssl_error","status_checked_at":"2026-02-22T10:32:23.200Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T02:00:36.814Z","updated_at":"2026-02-22T10:35:23.928Z","avatar_url":"https://github.com/parroty.png","language":"Elixir","funding_links":[],"categories":["Code Analysis"],"sub_categories":[],"readme":"ExProf\n============\n\n[![Build Status](https://github.com/parroty/excoveralls/workflows/tests/badge.svg)](https://github.com/parroty/exprof/actions)\n[![hex.pm version](https://img.shields.io/hexpm/v/exprof.svg)](https://hex.pm/packages/exprof)\n[![hex.pm downloads](https://img.shields.io/hexpm/dt/exprof.svg)](https://hex.pm/packages/exprof)\n\nA simple code profiler for Elixir using eprof.\n\nIt provides a simple macro as a wrapper for Erlang's \u003ca href=\"http://www.erlang.org/doc/man/eprof.html\" target=\"_blank\"\u003e:eprof\u003c/a\u003e profiler.\n\n### Install\nAdd `:exprof` to `deps` section of `mix.exs`.\n\n```elixir\n  def deps do\n    [ {:exprof, \"~\u003e 0.2.0\"} ]\n  end\n```\n\n### Usage\nimport \"ExProf.Macro\", then use \"profile\" macro to start profiling. It\nprints out results, and returns them as list of records, along with the\nresult of the profiled block.\n\n```elixir\ndefmodule SampleRunner do\n  import ExProf.Macro\n\n  @doc \"analyze with profile macro\"\n  def do_analyze do\n    profile do\n      :timer.sleep 2000\n      IO.puts \"message\\n\"\n    end\n  end\n\n  @doc \"get analysis records and sum them up\"\n  def run do\n    {records, _block_result} = do_analyze\n    total_percent = Enum.reduce(records, 0.0, \u0026(\u00261.percent + \u00262))\n    IO.inspect \"total = #{total_percent}\"\n  end\nend\n```\n\n### Run\nAn example to use in iex console.\n\n```elixir\n$ iex -S mix\n..\niex(1)\u003e SampleRunner.run\nmessage\n\nFUNCTION                                 CALLS      %  TIME  [uS / CALLS]\n--------                                 -----    ---  ----  [----------]\n'Elixir.IO':puts/2                           1   0.86     1  [      1.00]\nio:o_request/3                               1   1.72     2  [      2.00]\nio:put_chars/2                               1   1.72     2  [      2.00]\nerlang:group_leader/0                        1   1.72     2  [      2.00]\nio:request/2                                 1   2.59     3  [      3.00]\nio:execute_request/2                         1   2.59     3  [      3.00]\n'Elixir.SampleRunner':'-run/0-fun-0-'/0      1   2.59     3  [      3.00]\n'Elixir.IO':map_dev/1                        1   3.45     4  [      4.00]\nerlang:demonitor/2                           1   4.31     5  [      5.00]\nio:io_request/2                              1   6.03     7  [      7.00]\nio:wait_io_mon_reply/2                       1   6.90     8  [      8.00]\n'Elixir.IO':puts/1                           1   8.62    10  [     10.00]\nunicode:characters_to_binary/2               1  11.21    13  [     13.00]\ntimer:sleep/1                                1  14.66    17  [     17.00]\nerlang:monitor/2                             1  31.03    36  [     36.00]\n\"total = 100.0\"\n```\n\n### Add a Mix Task\nAn example to use as mix tasks.\n\n```elixir\ndefmodule Mix.Tasks.Exprof do\n  @shortdoc \"Profile using ExProf\"\n  use Mix.Task\n  import ExProf.Macro\n\n  def run(_mix_args) do\n    profile do: do_work(2)\n  end\n\n  defp do_work(n) do\n    :timer.sleep(n * 1000)\n  end\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparroty%2Fexprof","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparroty%2Fexprof","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparroty%2Fexprof/lists"}