{"id":27639458,"url":"https://github.com/stevearc/benchmark.nvim","last_synced_at":"2025-08-28T02:41:30.618Z","repository":{"id":264124503,"uuid":"891753782","full_name":"stevearc/benchmark.nvim","owner":"stevearc","description":"Benchmarking and profiling tools for Neovim plugins","archived":false,"fork":false,"pushed_at":"2024-11-22T05:48:48.000Z","size":21,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-08T00:56:10.555Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/stevearc.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2024-11-20T22:30:11.000Z","updated_at":"2024-11-25T14:17:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"a44dbfc7-8ce3-442b-9d82-e353d1ba0151","html_url":"https://github.com/stevearc/benchmark.nvim","commit_stats":null,"previous_names":["stevearc/benchmark.nvim"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevearc%2Fbenchmark.nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevearc%2Fbenchmark.nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevearc%2Fbenchmark.nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevearc%2Fbenchmark.nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevearc","download_url":"https://codeload.github.com/stevearc/benchmark.nvim/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevearc%2Fbenchmark.nvim/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259090389,"owners_count":22803672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2025-04-23T22:16:24.108Z","updated_at":"2025-06-10T14:11:52.803Z","avatar_url":"https://github.com/stevearc.png","language":"Lua","funding_links":[],"categories":["Lua"],"sub_categories":[],"readme":"# benchmark.nvim\n\nBenchmarking and profiling tools for Neovim plugins\n\n\u003e [!WARNING]  \n\u003e This API is not stable and can change at any time. It is recommended to pin to a commit until the 1.0 release.\n\nCheck out the [examples/](examples/) to see how to use benchmark.nvim.\n\nIf you want to see how benchmark.nvim can be incorporated into your own repo to run benchmarks or do profiling, check out how [oil.nvim does it](https://github.com/stevearc/oil.nvim/blob/master/Makefile).\n\n## API\n\n\u003c!-- API --\u003e\n\n## sandbox()\n\n`sandbox()` \\\nSandbox the neovim environment to a temporary directory\n\n\n## reset()\n\n`reset()` \\\nReset neovim buffers and windows\n\n\n## install_plugin(path)\n\n`install_plugin(path)` \\\nClone a plugin and add it to the runtimepath\n\n| Param | Type     | Desc                                                         |\n| ----- | -------- | ------------------------------------------------------------ |\n| path  | `string` | Path of github plugin (e.g. \"stevearc/oil.nvim\") or full url |\n\n## avg(nums, opts)\n\n`avg(nums, opts): integer` \\\nCalculate the average of a list of numbers\n\n| Param | Type                             | Desc |\n| ----- | -------------------------------- | ---- |\n| nums  | `number[]`                       |      |\n| opts  | `nil\\|{trim_outliers?: integer}` |      |\n\n## std_dev(nums, opts)\n\n`std_dev(nums, opts): number` \\\nCalculate the standard deviation of a list of numbers\n\n| Param | Type                             | Desc |\n| ----- | -------------------------------- | ---- |\n| nums  | `number[]`                       |      |\n| opts  | `nil\\|{trim_outliers?: integer}` |      |\n\n## run(opts, func, done)\n\n`run(opts, func, done)` \\\nRun a function multiple times and collect the timing information\n\n| Param       | Type                       | Desc                                                         |\n| ----------- | -------------------------- | ------------------------------------------------------------ |\n| opts        | `benchmark.RunOpts`        |                                                              |\n| \u003etitle      | `nil\\|string`              | Title to display in the UI                                   |\n| \u003eiterations | `nil\\|integer`             | Number of times to run the function                          |\n| \u003ewarm_up    | `nil\\|integer`             | Number of warm-up iterations                                 |\n| \u003ebefore     | `nil\\|fun()`               | A function to be run before each iteration                   |\n| \u003eafter      | `nil\\|fun()`               | A function to be run after each iteration                    |\n| func        | `fun(callback: fun())`     | The function to benchmark. Must call the callback when done. |\n| done        | `fun(times_ns: integer[])` | The function to call when all iterations are done            |\n\n## format_time(ns)\n\n`format_time(ns): string` \\\nConvert a raw nanosecond value to a human readable string\n\n| Param | Type      | Desc |\n| ----- | --------- | ---- |\n| ns    | `integer` |      |\n\n## jit_profile(opts)\n\n`jit_profile(opts): fun()` \\\nA thin wrapper around the LuaJIT profiler\n\n| Param     | Type                            | Desc                                                         |\n| --------- | ------------------------------- | ------------------------------------------------------------ |\n| opts      | `nil\\|benchmark.JitProfileOpts` |                                                              |\n| \u003eflags    | `nil\\|string`                   | See https://luajit.org/ext_profiler.html (default \"3Fpli1s\") |\n| \u003efilename | `nil\\|string`                   | Filename to write the profile to                             |\n\nReturns:\n\n| Type  | Desc                                         |\n| ----- | -------------------------------------------- |\n| fun() | stop Call this function to stop the profiler |\n\n## flame_profile(opts)\n\n`flame_profile(opts): fun(), fun(callback?: fun())` \\\nCreate a profile in the chrome trace format. Call this BEFORE requiring any modules.\n\n| Param     | Type                              | Desc                                                   |\n| --------- | --------------------------------- | ------------------------------------------------------ |\n| opts      | `nil\\|benchmark.FlameProfileOpts` |                                                        |\n| \u003epattern  | `nil\\|string`                     | Glob pattern to match modules to profile (e.g. \"oil*\") |\n| \u003efilename | `nil\\|string`                     | Filename to write the profile to                       |\n\nReturns:\n\n| Type                  | Desc                                           |\n| --------------------- | ---------------------------------------------- |\n| fun()                 | start Call this function to start the profiler |\n| fun(callback?: fun()) | stop Call this function to stop the profiler   |\n\n\n\u003c!-- /API --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevearc%2Fbenchmark.nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevearc%2Fbenchmark.nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevearc%2Fbenchmark.nvim/lists"}