{"id":37032621,"url":"https://github.com/wickedflame/measuremap","last_synced_at":"2026-01-14T04:00:00.124Z","repository":{"id":62363084,"uuid":"45492063","full_name":"WickedFlame/MeasureMap","owner":"WickedFlame","description":"Profiling and Benchmarking .NET Code made simple","archived":false,"fork":false,"pushed_at":"2025-10-16T06:44:23.000Z","size":1037,"stargazers_count":0,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-17T08:51:24.265Z","etag":null,"topics":["benchmark","benchmark-testing","benchmarking","dotnet","performance","performance-testing","profiler","profiling"],"latest_commit_sha":null,"homepage":"","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/WickedFlame.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":"2015-11-03T19:59:28.000Z","updated_at":"2025-10-16T06:42:01.000Z","dependencies_parsed_at":"2024-12-06T14:38:01.372Z","dependency_job_id":"2cb95d83-28df-41bc-a955-72b91e8580c3","html_url":"https://github.com/WickedFlame/MeasureMap","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/WickedFlame/MeasureMap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WickedFlame%2FMeasureMap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WickedFlame%2FMeasureMap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WickedFlame%2FMeasureMap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WickedFlame%2FMeasureMap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WickedFlame","download_url":"https://codeload.github.com/WickedFlame/MeasureMap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WickedFlame%2FMeasureMap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408950,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"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","benchmark-testing","benchmarking","dotnet","performance","performance-testing","profiler","profiling"],"created_at":"2026-01-14T03:59:59.359Z","updated_at":"2026-01-14T04:00:00.118Z","avatar_url":"https://github.com/WickedFlame.png","language":"C#","readme":"# MeasureMap\nProfiling and Benchmarking .NET Code made simple\n\n[![Build status](https://img.shields.io/appveyor/build/chriswalpen/measuremap/master?label=Master\u0026logo=appveyor\u0026style=for-the-badge)](https://ci.appveyor.com/project/chriswalpen/measuremap/branch/master)\n[![Build status](https://img.shields.io/appveyor/build/chriswalpen/measuremap/dev?label=Dev\u0026logo=appveyor\u0026style=for-the-badge)](https://ci.appveyor.com/project/chriswalpen/measuremap/branch/dev)\n  \n[![NuGet Version](https://img.shields.io/nuget/v/measuremap.svg?style=for-the-badge\u0026label=Latest)](https://www.nuget.org/packages/measuremap/)\n[![NuGet Version](https://img.shields.io/nuget/vpre/measuremap.svg?style=for-the-badge\u0026label=RC)](https://www.nuget.org/packages/measuremap/)\n  \nMeasureMap allows profiling and benchmarking from simple code fragments to full applications.\n  \nVisit [https://wickedflame.github.io/MeasureMap/](https://wickedflame.github.io/MeasureMap/) for the full documentation.\n  \nMeasureMap uses the builder pattern and a fluent API to make profiling or benchmarking as simple as possible.\n  \n## Profiling\nThe Builder for profiling is initiated with the ProfilerSession when running the StartSession method.\n  \n```csharp\nvar result = ProfilerSession.StartSession()\n\t.Task(() =\u003e \n\t{\n\t\t// This represents the Task that needs testint\n\t\tSystem.Threading.Thread.Sleep(TimeSpan.FromSeconds(0.001));\n\t})\n\t.SetIterations(200)\n\t.Assert(pr =\u003e pr.Iterations.Count() == 1)\n\t.RunSession();\n\nresult.Trace();\n\nAssert.IsTrue(result.AverageMilliseconds \u003c 20);\n```\nRunSession executes the profiler for the registered Task.\n\n## Benchmarking\nBenchmarks are basically just multiple Profiler-Sessions that are run in one Session.  \nThe Benchmarks are registered to and executed by the BenchmarkRunner.\n  \nBenchmarks can be run in two ways\n- FluentAPI\n- Attributes\n\n### FluentAPI\n```csharp\nvar sha256 = SHA256.Create();\nvar md5 = MD5.Create();\n\nvar data = new byte[10000];\nnew Random(42).NextBytes(data);\n\nvar runner = new BenchmarkRunner();\nrunner.SetIterations(10);\nrunner.Task(\"sha256\", () =\u003e sha256.ComputeHash(data));\nrunner.Task(\"md5\", () =\u003e md5.ComputeHash(data));\n\nvar result = runner.RunSessions();\n\nresult.Trace();\n```\n### Attributes\n```csharp\n[Iterations(10)]\n[Threads(10)]\n//[Duration(10)]\n[RunWarmup(false)]\npublic class  WorkflowBenchmark\n{\n    private readonly SHA256 _sha256;\n    private readonly MD5 _md5;\n    private readonly byte[] _data;\n    \n    public WorkflowBenchmark()\n    {\n        _sha256 = SHA256.Create();\n        _md5 = MD5.Create();\n\n        _data = new byte[10000];\n        new Random(42).NextBytes(_data);\n    }\n    \n    [OnStartPipeline]\n    public void Setup()\n    {\n    }\n\n    [OnEndPipeline]\n    public void End()\n    {\n    }\n\n    [Benchmark]\n    public void sha256()\n    {\n        // Simulate some work\n        _sha256.ComputeHash(_data);\n    }\n\n    [Benchmark]\n    public void md5(IExecutionContext ctx)\n    {\n        // Simulate some work\n        _md5.ComputeHash(_data);\n    }\n}\n```\n```csharp\n[Test]\npublic void WorkflowTest_Benchmark()\n{\n    var runner = new BenchmarkRunner();\n    var result = runner.RunSession\u003cWorkflowBenchmark\u003e();\n    result.Trace();\n}\n```\n\n## Tracing the Result\nThe result is by default traced as Markdown  \n```\n### MeasureMap Benchmark\n Iterations:\t\t10\n#### Summary\n| Name   | Avg Time         | Avg Ticks | Total            | Fastest | Slowest | Memory Increase |\n|------- |----------------: |---------: |----------------: |-------: |-------: |---------------: |\n| sha256 | 00:00:00.0000924 | 924       | 00:00:00.0009243 | 776     | 1471    | 1392            |\n| md5    | 00:00:00.0000485 | 485       | 00:00:00.0004858 | 409     | 534     | 1392            |\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwickedflame%2Fmeasuremap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwickedflame%2Fmeasuremap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwickedflame%2Fmeasuremap/lists"}