{"id":28452008,"url":"https://github.com/technobre/powerutils.benchmarkdotnet.reporter","last_synced_at":"2026-06-24T10:31:28.487Z","repository":{"id":296870979,"uuid":"947013917","full_name":"TechNobre/PowerUtils.BenchmarkDotnet.Reporter","owner":"TechNobre","description":"Tool to analyze and compare .NET benchmark reports","archived":false,"fork":false,"pushed_at":"2026-06-04T23:29:03.000Z","size":994,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-10T00:05:12.999Z","etag":null,"topics":["benchmark","benchmarkdotnet","csharp","dotent","reports","tests"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/PowerUtils.BenchmarkDotnet.Reporter","language":"C#","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/TechNobre.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","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":"2025-03-12T02:47:48.000Z","updated_at":"2026-06-04T23:29:05.000Z","dependencies_parsed_at":"2025-06-21T11:23:43.595Z","dependency_job_id":"3c330efa-e0b2-4d68-a8e7-13276288942b","html_url":"https://github.com/TechNobre/PowerUtils.BenchmarkDotnet.Reporter","commit_stats":null,"previous_names":["technobre/powerutils.benchmarkdotnet.reporter"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/TechNobre/PowerUtils.BenchmarkDotnet.Reporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechNobre%2FPowerUtils.BenchmarkDotnet.Reporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechNobre%2FPowerUtils.BenchmarkDotnet.Reporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechNobre%2FPowerUtils.BenchmarkDotnet.Reporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechNobre%2FPowerUtils.BenchmarkDotnet.Reporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TechNobre","download_url":"https://codeload.github.com/TechNobre/PowerUtils.BenchmarkDotnet.Reporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechNobre%2FPowerUtils.BenchmarkDotnet.Reporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34726643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["benchmark","benchmarkdotnet","csharp","dotent","reports","tests"],"created_at":"2025-06-06T17:10:20.369Z","updated_at":"2026-06-24T10:31:28.482Z","avatar_url":"https://github.com/TechNobre.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PowerUtils.BenchmarkDotnet.Reporter\n\n![PowerUtils.BenchmarkDotnet.Reporter banner](https://raw.githubusercontent.com/TechNobre/PowerUtils.BenchmarkDotnet.Reporter/main/assets/logo/banner.png)\n\n***Tool to analyze and compare .NET benchmark reports***\n\n![Tests](https://github.com/TechNobre/PowerUtils.BenchmarkDotnet.Reporter/actions/workflows/tests.yml/badge.svg)\n[![Mutation tests](https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2FTechNobre%2FPowerUtils.BenchmarkDotnet.Reporter%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/TechNobre/PowerUtils.BenchmarkDotnet.Reporter/main)\n\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=TechNobre_PowerUtils.BenchmarkDotnet.Reporter\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=TechNobre_PowerUtils.BenchmarkDotnet.Reporter)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=TechNobre_PowerUtils.BenchmarkDotnet.Reporter\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=TechNobre_PowerUtils.BenchmarkDotnet.Reporter)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=TechNobre_PowerUtils.BenchmarkDotnet.Reporter\u0026metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=TechNobre_PowerUtils.BenchmarkDotnet.Reporter)\n[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=TechNobre_PowerUtils.BenchmarkDotnet.Reporter\u0026metric=bugs)](https://sonarcloud.io/summary/new_code?id=TechNobre_PowerUtils.BenchmarkDotnet.Reporter)\n\n[![NuGet](https://img.shields.io/nuget/v/PowerUtils.BenchmarkDotnet.Reporter.svg)](https://www.nuget.org/packages/PowerUtils.BenchmarkDotnet.Reporter)\n[![Nuget](https://img.shields.io/nuget/dt/PowerUtils.BenchmarkDotnet.Reporter.svg)](https://www.nuget.org/packages/PowerUtils.BenchmarkDotnet.Reporter)\n[![License: MIT](https://img.shields.io/github/license/TechNobre/PowerUtils.BenchmarkDotnet.Reporter.svg)](https://github.com/TechNobre/PowerUtils.BenchmarkDotnet.Reporter/blob/main/LICENSE)\n\n\n**PowerUtils.BenchmarkDotnet.Reporter** is a command-line tool used to analyze and compare .NET benchmark reports generated by [BenchmarkDotNet](https://www.nuget.org/packages/benchmarkdotnet). This tool is designed to run locally or in CI/CD pipelines, providing a simple way to visualize and compare benchmark results.\n\n\n- [Prepare environment](#prepare-environment)\n  - [Install Tool](#install-tool)\n  - [Update Tool](#update-tool)\n  - [List installed tools](#list-installed-tools)\n  - [Uninstall Tool](#uninstall-tool)\n- [Export reports using BenchmarkDotNet](#export-reports-using-benchmarkdotnet)\n- [How to use](#how-to-use)\n  - [Run the tool](#run-the-tool)\n  - [Commands](#commands)\n    - [`compare`](#compare)\n      - [Options:](#options)\n        - [Threshold Units](#threshold-units)\n      - [Example of usage:](#example-of-usage)\n      - [Error Handling Options](#error-handling-options)\n        - [Exit Codes](#exit-codes)\n- [GitHub Actions Setup](#github-actions-setup)\n- [Acknowledgments](#acknowledgments)\n- [Contribution](#contribution)\n\n\n\n## Prepare environment\n\n### Install Tool\n\nThis package is available through Nuget Repository: https://www.nuget.org/packages/PowerUtils.BenchmarkDotnet.Reporter\n\n**Locally**\n```bash\n# Create a tool manifest file in the current directory\ndotnet new tool-manifest\n# Install the tool in the current directory\ndotnet tool install PowerUtils.BenchmarkDotnet.Reporter\n```\n\n**Globally**\n```bash\ndotnet tool install --global PowerUtils.BenchmarkDotnet.Reporter\n```\n\n### Update Tool\n\n**Locally**\n```bash\ndotnet tool update PowerUtils.BenchmarkDotnet.Reporter\n```\n\n**Update Tool**\n```bash\ndotnet tool update --global PowerUtils.BenchmarkDotnet.Reporter\n```\n\n### List installed tools\n\n**Locally**\n```bash\ndotnet tool list\n```\n\n**Globally**\n```bash\ndotnet tool list --global\n```\n\n### Uninstall Tool\n\n**Locally**\n```bash\ndotnet tool uninstall PowerUtils.BenchmarkDotnet.Reporter\n```\n\n**Globally**\n```bash\ndotnet tool uninstall --global PowerUtils.BenchmarkDotnet.Reporter\n```\n\n\n\n## Export reports using BenchmarkDotNet\n\nTo use the `PowerUtils.BenchmarkDotnet.Reporter` tool, you first need to generate benchmark reports using [BenchmarkDotNet](https://www.nuget.org/packages/BenchmarkDotNet) and export them in JSON format. You can do this by looking at the documentation of BenchmarkDotNet [here](https://benchmarkdotnet.org/articles/configs/exporters.html) or following the examples below:\n\u003e NOTE: Now the `PowerUtils.BenchmarkDotnet.Reporter` tool supports all the Json Formatters provided by BenchmarkDotNet, so you can choose the one that best suits your needs.\n\n```csharp\n// TheBenchmark.cs\nusing BenchmarkDotNet.Attributes;\n\n[MemoryDiagnoser]\n[JsonExporterAttribute.Full]\n[JsonExporterAttribute.FullCompressed]\n[JsonExporterAttribute.Brief]\n[JsonExporterAttribute.BriefCompressed]\npublic class TheBenchmark\n{\n    [Benchmark]\n    public void TheMethod()\n    {\n        // Your benchmark code here\n    }\n}\n\n\n// Program.cs\nusing BenchmarkDotNet.Running;\n\nBenchmarkRunner.Run\u003cTheBenchmark\u003e();\n```\n\n**Or**\n\n```csharp\n// TheBenchmark.cs\nusing BenchmarkDotNet.Attributes;\n\n[MemoryDiagnoser]\npublic class TheBenchmark\n{\n    [Benchmark]\n    public void TheMethod()\n    {\n        // Your benchmark code here\n    }\n}\n\n\n// Program.cs\nusing BenchmarkDotNet.Running;\n\nvar config = ManualConfig\n    .Create(DefaultConfig.Instance)\n    .AddExporter(JsonExporter.Full)\n    .AddExporter(JsonExporter.FullCompressed)\n    .AddExporter(JsonExporter.Brief)\n    .AddExporter(JsonExporter.BriefCompressed);\n\nBenchmarkRunner.Run\u003cTheBenchmark\u003e(config);\n```\n\n\n\n## How to use\n\n### Run the tool\n\n**Locally**\n```bash\ndotnet pbreporter [command] [options]\n```\n\n**Globally**\n```bash\npbreporter [command] [options]\n```\n\n### Commands\n\n#### `compare`\n\nCompares two benchmark reports and generates a report with the differences.\n\n**Example:**\n```bash\npbreporter compare -b baseline-full.json -t target-full.json\n```\n\n##### Options:\n\n* (`-b`, `--baseline`) `\u003cbaseline\u003e`: Path to the folder or file with Baseline report. **[Required]**\n* (`-t`, `--target`) `\u003ctarget\u003e`: Path to the folder or file with target reports. **[Required]**\n* (`-tm`, `--threshold-mean`) `\u003cthreshold-mean\u003e`: Throw an error when the mean threshold is met. Examples: 5%, 10ms, 10us, 100ns, 1s.\n* (`-ta`, `--threshold-allocation`) `\u003cthreshold-allocation\u003e`: Throw an error when the allocation threshold is met. Examples: 5%, 10b, 10kb, 100mb, 1gb.\n* (`-f`, `--format`) `\u003cconsole|hit-txt|json|markdown\u003e`: Output format for the report. **[default: console]**\n* (`-o`, `--output`) `\u003coutput\u003e`: Output directory to export the diff report. Default is current directory. **[default: ./BenchmarkReporter]**\n* (`-fw`, `--fail-on-warnings`): Exit with error code when any threshold is hit during comparison. **[default: disabled]**\n* (`-ft`, `--fail-on-threshold-hit`): Exit with error code when any threshold is hit during comparison. **[default: disabled]**\n* (`-?`, `-h`, `--help`): Show help and usage information\n\n###### Threshold Units\n\n**Time (`-tm`):**\n\n| Unit | Description | Example |\n|------|-------------|---------|\n| `ns` | Nanoseconds | `100ns` |\n| `us` | Microseconds | `10us` |\n| `ms` | Milliseconds | `10ms` |\n| `s` | Seconds | `1s` |\n| `%` | Percentage relative to baseline | `5%` |\n\n**Memory (`-ta`):**\n\n| Unit | Description | Example |\n|------|-------------|---------|\n| `b` | Bytes | `10b` |\n| `kb` | Kilobytes | `10kb` |\n| `mb` | Megabytes | `10mb` |\n| `gb` | Gigabytes | `1gb` |\n| `%` | Percentage relative to baseline | `5%` |\n\n##### Example of usage:\n\n**Simple usage**\n```bash\npbreporter compare -b baseline-full.json -t target-full.json\n```\n\n**Passing folder paths**\n```bash\npbreporter compare -b ./baseline-reports -t ./target-reports\n```\n\u003e Note: You can pass a file path, a folder or mix both. The tool will automatically find the supported report files in the provided paths.\n\n**With output format and directory**\n```bash\npbreporter compare -b baseline-full.json -t target-full.json -f json -f markdown -o ./out\n```\n\n**With thresholds**\n```bash\npbreporter compare -b baseline-full.json -t target-full.json -tm 5% -ta 12b\n```\n\n**With thresholds and output threshold report**\n```bash\npbreporter compare -b baseline-full.json -t target-full.json -tm 5% -f hit-txt\n```\n\u003e Note: The `hit-txt` format will only generate when at least one threshold is hit.\n\n**With console output**\n```bash\npbreporter compare -b baseline-full.json -t target-full.json -f console\n```\n\u003e Note: The `console` format displays the comparison report directly in the terminal instead of creating a file.\n\n**With Markdown output**\n```bash\npbreporter compare -b baseline-full.json -t target-full.json -f markdown\n```\n\u003e Note: The `markdown` format is ideal for generating reports to upload to GitHub or other platforms that support Markdown rendering.\n\n**With multiple formats**\n```bash\npbreporter compare -b baseline-full.json -t target-full.json -f json -f markdown -f console\n```\n\n##### Error Handling Options\n\nThe tool provides options to control exit codes for CI/CD integration and automated quality gates.\n\n**Fail on warnings**\n```bash\npbreporter compare -b baseline-full.json -t target-full.json -fw\n```\n\u003e Note: Exits with code 1 if any warnings are generated during comparison (e.g., environment differences between baseline and target).\n\n**Fail on threshold hits**\n```bash\npbreporter compare -b baseline-full.json -t target-full.json -tm 5% -ta 10% -ft\n```\n\u003e Note: Exits with code 2 if any performance thresholds are exceeded during comparison.\n\n**Both error handling options**\n```bash\npbreporter compare -b baseline-full.json -t target-full.json -tm 5% -fw -ft\n```\n\u003e Note: If both conditions are met, warnings take priority and the tool exits with code 1.\n\n###### Exit Codes\n\n* **0**: Success - No issues detected\n* **1**: Warnings detected (when `--fail-on-warnings` is enabled)\n* **2**: Performance thresholds exceeded (when `--fail-on-threshold-hit` is enabled)\n\n\n## GitHub Actions Setup\n\nPowerUtils.BenchmarkDotnet.Reporter can be easily integrated into your CI/CD pipeline to automatically analyze and compare benchmark performance. For detailed instructions on setting up GitHub Actions workflows, see the [GitHub Actions Setup Guide](docs/github-actions-setup.md).\n\n\n## Acknowledgments\n\nThis project was inspired by and based on the [ResultsComparer tool](https://github.com/dotnet/performance/tree/main/src/tools/ResultsComparer) from the .NET performance repository.\n\n\n## Contribution\n\nIf you have any questions, comments, or suggestions, please open an [issue](https://github.com/TechNobre/PowerUtils.BenchmarkDotnet.Reporter/issues/new/choose) or create a [pull request](https://github.com/TechNobre/PowerUtils.BenchmarkDotnet.Reporter/compare).\n\nWant to contribute to this tool? Check out the [Test Data Documentation](docs/test-data.md) to see sample benchmark reports available for testing your changes and developing new features.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnobre%2Fpowerutils.benchmarkdotnet.reporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechnobre%2Fpowerutils.benchmarkdotnet.reporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnobre%2Fpowerutils.benchmarkdotnet.reporter/lists"}