{"id":47624612,"url":"https://github.com/nvim-contrib/nvim-pprof","last_synced_at":"2026-04-01T22:38:01.082Z","repository":{"id":346039272,"uuid":"1181454687","full_name":"nvim-contrib/nvim-pprof","owner":"nvim-contrib","description":"A Neovim plugin that displays Go pprof profiler data with heat-gradient signs, inline hints, and floating summaries","archived":false,"fork":false,"pushed_at":"2026-03-22T03:52:00.000Z","size":2451,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-22T12:47:05.329Z","etag":null,"topics":["go","golang","lua","neovim","neovim-plugin","pprof","profiling"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/nvim-contrib.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-14T06:44:46.000Z","updated_at":"2026-03-22T03:52:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nvim-contrib/nvim-pprof","commit_stats":null,"previous_names":["nvim-contrib/nvim-pprof"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/nvim-contrib/nvim-pprof","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-contrib%2Fnvim-pprof","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-contrib%2Fnvim-pprof/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-contrib%2Fnvim-pprof/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-contrib%2Fnvim-pprof/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nvim-contrib","download_url":"https://codeload.github.com/nvim-contrib/nvim-pprof/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-contrib%2Fnvim-pprof/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"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":["go","golang","lua","neovim","neovim-plugin","pprof","profiling"],"created_at":"2026-04-01T22:38:00.495Z","updated_at":"2026-04-01T22:38:01.059Z","avatar_url":"https://github.com/nvim-contrib.png","language":"Lua","readme":"# nvim-pprof\n\n\u003e Go pprof profiler integration for Neovim\n\n[![test](https://github.com/nvim-contrib/nvim-pprof/actions/workflows/test.yml/badge.svg)](https://github.com/nvim-contrib/nvim-pprof/actions/workflows/test.yml)\n[![Release](https://img.shields.io/github/v/release/nvim-contrib/nvim-pprof?include_prereleases)](https://github.com/nvim-contrib/nvim-pprof/releases)\n[![License](https://img.shields.io/github/license/nvim-contrib/nvim-pprof)](LICENSE)\n[![Neovim](https://img.shields.io/badge/Neovim-0.11%2B-blueviolet?logo=neovim\u0026logoColor=white)](https://neovim.io)\n\n## Features\n\n- Load and parse Go pprof profiles (CPU, memory, allocations)\n- Heat-gradient signs in the sign column and line numbers showing hot/cold lines\n- Inline virtual text hints showing flat/cum values per line\n- Floating top-N function summary with profile type label, sparkline bar, and pass/fail threshold coloring\n- Peek window showing callers/callees for any function\n- Location list populated with all profiled hotspot lines\n- File watcher for auto-reload when profiles change on disk\n\n![signs](doc/tapes/output/signs.webp)\n\n## Requirements\n\n- Neovim \u003e= 0.11\n- Go toolchain (`go tool pprof`)\n\n## Installation\n\n### lazy.nvim\n\n```lua\n{\n  \"nvim-contrib/nvim-pprof\",\n  opts = {},\n}\n```\n\n### packer.nvim\n\n```lua\nuse({\n  \"nvim-contrib/nvim-pprof\",\n  config = function()\n    require(\"pprof\").setup()\n  end,\n})\n```\n\n## Generating profile files\n\nThe plugin reads a pre-generated pprof profile — it does not run tests itself.\n\nBy default the plugin searches for profile files in the current working\ndirectory using the patterns `cpu.prof`, `mem.prof`, `*.prof`, `*.pprof`.\nOverride with the `file` option if your tool writes elsewhere.\n\n| Profile type | Command | Default file |\n| ------------ | ------- | ------------ |\n| CPU (tests)  | `go test -cpuprofile cpu.prof -bench .` | `cpu.prof` |\n| Memory (tests) | `go test -memprofile mem.prof -bench .` | `mem.prof` |\n| Block / mutex | `go test -blockprofile block.prof` | `block.prof` |\n| CPU (live app) | `go tool pprof http://localhost:6060/debug/pprof/profile` | *(pass path directly)* |\n\n## Configuration\n\n```lua\nrequire(\"pprof\").setup({\n  -- binary used to invoke pprof; defaults to \"go\" (runs `go tool pprof`)\n  -- pprof_bin = \"go\",\n\n  -- glob patterns searched in cwd when no path is given to :PProfLoad\n  -- defaults to: { \"cpu.prof\", \"mem.prof\", \"*.prof\", \"*.pprof\" }\n  -- file = { \"cpu.prof\", \"*.prof\" },\n\n  -- register :PProf* commands (default: true)\n  commands = true,\n\n  auto_reload = {\n    enabled    = false, -- auto-reload profile when .prof file changes on disk\n    timeout_ms = 500,   -- debounce delay before reloading\n  },\n\n  browser = {\n    port = 8080,  -- HTTP port for the pprof web server (:PProfServerStart)\n    open = true,  -- open the system browser automatically on start; set false for headless\n  },\n\n  -- called after a profile is loaded\n  on_load = nil,\n\n  signs = {\n    cold        = { hl = \"PprofHeatCold\", text = \"▎\" }, -- coldest lines\n    warm        = { hl = \"PprofHeatWarm\", text = \"▎\" }, -- mid-range lines\n    hot         = { hl = \"PprofHeatHot\",  text = \"▎\" }, -- hottest lines\n    group       = \"pprof\",  -- sign group name (:h sign-group)\n    signhl      = false,    -- show glyph in sign column (toggleable at runtime)\n    numhl       = true,     -- color the line number (toggleable at runtime)\n    linehl      = false,    -- color the entire line background (toggleable at runtime)\n    heat_levels = 5,        -- number of gradient steps between cold and hot\n  },\n\n  highlights = {\n    cold = { fg = \"#3b82f6\", bg = \"#1e3a5f\" },\n    warm = { fg = \"#f59e0b\", bg = \"#7a4f05\" },\n    hot  = { fg = \"#ef4444\", bg = \"#7f1d1d\" },\n  },\n\n  line_hints = {\n    enabled   = false,                     -- show hints automatically after load\n    format    = \"{flat} flat | {cum} cum\", -- {flat} and {cum} are substituted\n    position  = \"eol\",                     -- \"eol\" | \"right_align\" | \"inline\"\n    highlight = { link = \"Comment\" },\n  },\n\n  top = {\n    default_count = 20,\n    border        = \"rounded\",\n    width         = 0.70,  -- fraction of editor columns\n    height        = 0.50,  -- fraction of editor lines\n    min_flat_pct  = 5.0,   -- threshold: flat% \u003e= this gets `fail` colour; 0 disables\n    window        = {},    -- extra options passed to nvim_open_win\n    highlights = {\n      header        = { link = \"Title\" },\n      column_header = { link = \"Comment\" },\n      border        = { link = \"FloatBorder\" },\n      normal        = { link = \"NormalFloat\" },\n      cursor_line   = { link = \"CursorLine\" },\n      pass          = { link = \"Comment\" },        -- flat% below threshold\n      fail          = { link = \"DiagnosticWarn\" },  -- flat% at or above threshold\n    },\n  },\n\n  peek = {\n    border  = \"rounded\",\n    width   = 0,  -- 0 = auto-size to content; fraction \u003e 0 = fixed ratio\n    height  = 0,\n    window  = {},\n    highlights = {\n      header      = { link = \"Title\" },\n      border      = { link = \"FloatBorder\" },\n      normal      = { link = \"NormalFloat\" },\n      cursor_line = { link = \"CursorLine\" },\n    },\n  },\n})\n```\n\n## Usage\n\n### Commands\n\n| Command                | Description                                                                                          |\n| ---------------------- | ---------------------------------------------------------------------------------------------------- |\n| `:PProfLoad[!] [file]` | Load a profile file. No argument auto-finds in cwd. `!` always shows a picker                       |\n| `:PProfSigns [action]` | Show/hide/toggle heat signs. Default: `toggle`                                                       |\n| `:PProfHints [action]` | Show/hide/toggle inline hints. Default: `toggle`                                                     |\n| `:PProfTop [count]`    | Show top-N functions in a floating window                                                            |\n| `:PProfPeek [func]`    | Show callers/callees. No argument uses treesitter to detect the function at cursor                   |\n| `:PProfQuickfix`       | Populate quickfix list with one entry per profiled file                                              |\n| `:PProfLoclist`        | Populate location list with hotspot lines                                                            |\n| `:PProfServerStart [port]` | Auto-load profile (or reuse cached), start pprof web server, open browser when `browser.open` is true (default port: 8080) |\n| `:PProfServerStop`     | Stop the pprof web server                                                                            |\n| `:PProfClear`          | Clear all profile data, signs, hints, and floats                                                     |\n\n![hints](doc/tapes/output/hints.webp)\n\n### Lua API\n\n```lua\nlocal pprof = require(\"pprof\")\n\n-- load\npprof.load()                          -- auto-find in cwd using config.file patterns\npprof.load(\"path/to/cpu.prof\")        -- load from explicit path\npprof.load(nil, true)                 -- force picker\n\n-- signs (all channels)\npprof.show_line_signs()\npprof.hide_line_signs()\npprof.toggle_line_signs()\n\n-- sign column glyph / line number / full-line background (runtime toggles)\npprof.show_signhl()   pprof.hide_signhl()   pprof.toggle_signhl()\npprof.show_numhl()    pprof.hide_numhl()    pprof.toggle_numhl()\npprof.show_linehl()   pprof.hide_linehl()   pprof.toggle_linehl()\n\n-- inline hints\npprof.show_line_hints()\npprof.hide_line_hints()\npprof.toggle_line_hints()\n\n-- floating windows\npprof.top(count)\npprof.peek(func_name)\n\n-- quickfix / loclist navigation\npprof.quickfix()\npprof.loclist()\n\n-- jump to next/previous hotspot sign\npprof.jump_next()\npprof.jump_prev()\n\n-- pprof web server\npprof.start_server()         -- start at default port; opens browser when browser.open = true\npprof.start_server(9090)     -- start at custom port\npprof.stop_server()          -- stop the server\n\n-- clear\npprof.clear()\n```\n\n### Top window keys\n\n| Key         | Action                                   |\n| ----------- | ---------------------------------------- |\n| `sf`        | Sort by flat                             |\n| `sc`        | Sort by cum                              |\n| `Enter`     | Jump to source for function under cursor |\n| `q` / `Esc` | Close                                    |\n\nThe window title shows the detected profile type (e.g. `[cpu]`, `[heap]`).\nEach row includes a 10-character sparkline bar (█░) normalised to the hottest\nentry, and the flat% column is coloured pass/fail against `top.min_flat_pct`.\n\n![top](doc/tapes/output/top.webp)\n\n### Quickfix / loclist workflow\n\n```\n:PProfQuickfix   → quickfix list of profiled files, hottest first\n:PProfLoclist    → location list of hotspot lines in current file\n```\n\nNavigate the quickfix list with `:cnext` / `:cprev` (or `]q` / `[q` with a mapping).\nNavigate the location list with `:lnext` / `:lprev`.\n\n### Peek keybinding\n\n`:PProfPeek` detects the function name under the cursor via treesitter, so\nyou can map it directly:\n\n```lua\nvim.keymap.set(\"n\", \"\u003cleader\u003epp\", \"\u003ccmd\u003ePProfPeek\u003cCR\u003e\",\n  { desc = \"pprof: peek callers/callees\" })\n```\n\n![peek](doc/tapes/output/peek.png)\n\n### neotest integration\n\nThe plugin ships built-in neotest consumers so the profile reloads automatically after every test run.\n\n**Generic consumer** — works for any setup where the profile file is written to a known location in cwd:\n\n```lua\nrequire(\"neotest\").setup({\n  consumers = {\n    pprof = require(\"pprof.neotest\"),\n  },\n})\n```\n\n**Go consumer** — searches the neotest output directories for profile files first, then falls back to cwd. Configure neotest-go to emit a profile:\n\n```lua\nrequire(\"neotest\").setup({\n  adapters = {\n    require(\"neotest-go\")({\n      args = { \"-cpuprofile\", \"cpu.prof\" },\n    }),\n  },\n  consumers = {\n    pprof = require(\"pprof.neotest.go\"),\n  },\n})\n```\n\nBoth consumers can be combined:\n\n```lua\nrequire(\"neotest\").setup({\n  consumers = {\n    pprof    = require(\"pprof.neotest\"),\n    pprof_go = require(\"pprof.neotest.go\"),\n  },\n})\n```\n\n## Contributing\n\nContributions are welcome. Please open an issue or pull request on\n[GitHub](https://github.com/nvim-contrib/nvim-pprof).\n\n## License\n\n[MIT](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvim-contrib%2Fnvim-pprof","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnvim-contrib%2Fnvim-pprof","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvim-contrib%2Fnvim-pprof/lists"}