{"id":26534832,"url":"https://github.com/iron-software/ironbenchmarks","last_synced_at":"2025-03-21T20:28:47.143Z","repository":{"id":76754693,"uuid":"530546479","full_name":"iron-software/IronBenchmarks","owner":"iron-software","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-06T04:20:10.000Z","size":101570,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-06T05:25:55.121Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iron-software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-08-30T07:32:28.000Z","updated_at":"2025-02-06T04:20:10.000Z","dependencies_parsed_at":"2023-02-27T13:45:23.195Z","dependency_job_id":"a132ad54-1a31-4c01-bf2d-09efee906c22","html_url":"https://github.com/iron-software/IronBenchmarks","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iron-software%2FIronBenchmarks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iron-software%2FIronBenchmarks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iron-software%2FIronBenchmarks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iron-software%2FIronBenchmarks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iron-software","download_url":"https://codeload.github.com/iron-software/IronBenchmarks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244864016,"owners_count":20523079,"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-03-21T20:28:46.634Z","updated_at":"2025-03-21T20:28:47.133Z","avatar_url":"https://github.com/iron-software.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IronBenchmarks\n\nA tool to measure the performance of pretty much anything. After measurements,\nit creates an Excel file report with data on performance and memory allocation presented in charts.\n\n## How to use the repository\n\n 1. Clone the repository to your machine.\n 2. This application uses IronXL to create reports based on the data collected\n from benchmarking various actions. For IronXL to be operational you need to\n provide it with a License key. To do so add your license key to\n **..\\IronBenchmarks\\IronBenchmarks.App\\appsettings.json** file under the\n `LicenseKeyIronXl` property, removing the \"PLACE YOUR KEY HERE\" placeholder.\n 3. To use a pre-defined project for benchmarking BarCode, PDF or Excel libraries\n provide license keys for IronBarCode, IronPdf or IronXL. To do so in Visual\n Studio right-click the respective project, then click *Manage User Secrets*.\n In the file **secrets.json** add one of the following snippets:\n\n ```json\n {\n   \"AppConfig\": {\n     \"LicenseKeyIronBarCode\": \"YOUR_KEY_HERE\"\n   }\n }\n ```\n\n ```json\n {\n   \"AppConfig\": {\n     \"LicenseKeyIronPdf\": \"YOUR_KEY_HERE\"\n   }\n }\n ```\n\n ```json\n {\n   \"AppConfig\": {\n     \"LicenseKeyIronXl\": \"YOUR_KEY_HERE\"\n   }\n }\n ```\n\n 4. Check versions of NuGet packages used in the repository that are going to be\n benchmarked; update or downgrade to your taste/needs.\n 5. Select `Release` configuration.\n 6. Build the solution.\n 7. Run the app from the command line under\n **..\\IronBenchmarks\\IronBenchmarks.App\\bin\\Debug\\net6.0** folder.\n  - To run Excel benchmarks use the `-xl` command-line argument\n  - To run PDF benchmarks use the `-pdf` command-line argument\n  - To run BarCode benchmarks use the `-bc` command-line argument\n\n 8. Look for a complete report under\n **..\\IronBenchmarks\\IronBenchmarks.App\\bin\\Debug\\net6.0\\Reports** (path is\n controlled with `ReportsFolder` property in **appsettings.json**). Every app\n run will create a new report.\n 9. Look for saved results of benchmark work under\n **..\\IronBenchmarks\\IronBenchmarks.App\\bin\\Debug\\net6.0\\Results** (path is\n controlled with `ResultsFolderName` property in **appsettings.json**).\n Files will be rewritten on each app run.\n\n## How to create new benchmarks\n\n**IronBenchmarks** uses [BenchmarkDotNet](https://benchmarkdotnet.org/) for\nmeasurements. To learn more about designing benchmarks with it check out the\n[Articles](https://benchmarkdotnet.org/articles/overview.html) section](https://benchmarkdotnet.org/articles/overview.html)\non their website.\n\nThings to keep in mind:\n\n 1. Reporting engine of **IronBenchmarks** is designed in such a way, that any class\n with a set of benchmarks is a class that measures one particular action by\n different libraries. For example, `IronBenchmarks.ExcelLibs.Benchmarks.DateCellBenchmark`\n class will measure how **Aspose.Cells**, **IronXL**, **ClosedXML**, **EPPlus**\n and **NPOI** will perform setting a date to a cell in a pre-created workbook.\n This design assumes, that each such class will contain an equal number of\n methods marked with `Benchmark` attribute. Names of methods should reflect the\n name of the library, that will perform benchmarked action in this method. The\n names of methods should be the same throughout the classes. To achieve that:\n it is recommended to use an abstract class from which the benchmark classes\n will inherit the structure of methods. For example, check out the\n `IronBenchmarks.PdfLibs.Benchmarks.BenchmarkBase` abstract class and how it\n is used in `IronBenchmarks.PdfLibs.Benchmarks.SavingLargeFileBenchmark` class.\n 2. In benchmark class override pre-defined in a base class methods and decorate\n them with `Benchmark` attribute.\n 3. To tell **BenchmarkDotNet** that it needs to gather memory allocation info,\n decorate your class with the `MemoryDiagnoser` attribute.\n 4. Decorate the benchmark class with the `ShortRunJob` attribute, if you need the\n runs for the methods of this class to be shorter, which will hinder the\n precision of the data, but will speed up the execution.\n 5. Create methods with `IterationSetup` and `IterationCleanup` to set up things\n before each call of the `Benchmark` marked method of your class and to clean up\n things after it was called. These methods will execute before and after EACH\n execution of the benchmark methods. For an example of how it is used check out\n `IronBenchmarks.ExcelLibs.Benchmarks.Bases.SheetOperationsBenchmarkBase` class.\n 6. In `IronBenchmarks.App.Program` class: add your class to the list of\n classes that will be run like so:\n\n```csharp\n...\nvar barcodeSummaries = new List\u003cSummary\u003e\n{\n    BenchmarkRunner.Run\u003cCreateBarcodeBenchmark\u003e(),\n    BenchmarkRunner.Run\u003cMyNewBenchmark\u003e(),\n};\n...\n```\n\n 7. Repeat the steps from **How to use the repository** to see the results of\n the benchmarking of your new class.\n\n## Useful features\n\n - Version 0.0.2 of IronBenchmarks allows appending the results of current\nbenchmarking to the report created earlier. This is useful if you want to add\nnew contenders to an already created report or (which is more important) to\n**benchmark different versions of the same library**. For example, you can run a\nbenchmark for BarCode with IronBarCode v2022.11, then downgrade in the\nIronBenchmarks.BarCodeLibs IronBarCode v2022.9, build the solution again and\nrun IronBenchmarks.App.exe with a `-a` or `-append` command-line argument.\nThis will run your benchmarks on an older version but will append the results to\nthe previous report, so you don't have to do it manually.\n - You can tell ReportGenerator to add versions of libraries to the report. To do\nso check out the implementation of `IronBenchmarks.App.Program.GetLibNamesWithVersions`\nor pass the ReportGenerator a manually created `Dictionary\u003cstring, string\u003e`\nwhere keys are the names of your benchmark contenders (!!!should be the same as\nthe names of your benchmark methods!!!) and values are versions that you wish to\nsee in the report. This will improve in future versions.\n\n## Notes\n\n - **IronBenchmarks.ExcelLibs** is using the customized assembly of an older\nversion of **IronXL**. It was renamed to **IronXLOld.dll**, all of its types'\nnamespaces were renamed from `IronXL` to `IronXLOld`, and it is stored in an\n**..\\IronBenchmarks\\packages** folder. It is added to **IronBenchmarks.IronXL**\nproject as an assembly, not a NuGet package. To use another version of IronXL\nas IronXLOld perform a similar renaming procedure and replace\n**..\\IronBenchmarks\\packages\\IronXLOld.dll** with your version.\n - The benchmarking process is really slow, so be prepared for the app to run for\nseveral minutes.\n - If you plan to commit any changes to this public repository, please be sure to\nnot include any sensitive information in the commit, such as License keys and\nso on. To add License keys discreetly, please use the User Secrets feature of\nVisual Studio.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firon-software%2Fironbenchmarks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firon-software%2Fironbenchmarks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firon-software%2Fironbenchmarks/lists"}