{"id":26673741,"url":"https://github.com/mjebrahimi/dotnet-collections-benchmark","last_synced_at":"2025-04-12T06:14:06.704Z","repository":{"id":218031439,"uuid":"743767232","full_name":"mjebrahimi/DotNet-Collections-Benchmark","owner":"mjebrahimi","description":"🚀 A comprehensive performance comparison benchmark between different .NET collections.","archived":false,"fork":false,"pushed_at":"2024-08-16T20:44:36.000Z","size":5491,"stargazers_count":70,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T06:14:01.809Z","etag":null,"topics":["benchmark","benchmarking","benchmarks","big-o","big-o-notation","big-o-notation-algorithm","big-o-performance","collection","collections","csharp","data-structure","data-structures","data-structures-algorithms","data-structures-and-algorithms","datastructure","datastructures","datastructures-algorithms","dotnet","performance"],"latest_commit_sha":null,"homepage":"https://mjebrahimi.github.io/DotNet-Collections-Benchmark/","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/mjebrahimi.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}},"created_at":"2024-01-16T00:10:13.000Z","updated_at":"2025-03-14T12:03:24.000Z","dependencies_parsed_at":"2024-01-19T11:05:00.176Z","dependency_job_id":"43d2e557-d92d-4ea8-b536-4bb10a6b535d","html_url":"https://github.com/mjebrahimi/DotNet-Collections-Benchmark","commit_stats":null,"previous_names":["mjebrahimi/dotnet-collections-benchmark"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjebrahimi%2FDotNet-Collections-Benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjebrahimi%2FDotNet-Collections-Benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjebrahimi%2FDotNet-Collections-Benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjebrahimi%2FDotNet-Collections-Benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjebrahimi","download_url":"https://codeload.github.com/mjebrahimi/DotNet-Collections-Benchmark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525138,"owners_count":21118619,"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":["benchmark","benchmarking","benchmarks","big-o","big-o-notation","big-o-notation-algorithm","big-o-performance","collection","collections","csharp","data-structure","data-structures","data-structures-algorithms","data-structures-and-algorithms","datastructure","datastructures","datastructures-algorithms","dotnet","performance"],"created_at":"2025-03-26T01:37:31.759Z","updated_at":"2025-04-12T06:14:06.666Z","avatar_url":"https://github.com/mjebrahimi.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n![.NET Collections Benchmark](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/repository-image.png)\n\n# .NET Collections Benchmark\n\nA comprehensive performance comparison benchmark between different .NET collections.\n\n\u003e If you are working with small collections (e.g. 100 items) or your code is not HOT path (not executed frequently), it's not a big deal and you usually don't need to worry about your collection's performance. (It's better not to waste your time with premature micro-optimizations)\n\u003e \n\u003e However, if you are dealing with Large collections (e.g. 100K, 1M, or more items) or your code is  HOT path (executed frequently), you should be obsessed with performance and choosing the best collection type based on your needs and conditions.\n\u003e \n\u003e This benchmark report helps you to choose the best collection type in terms of performance based on your needs and conditions.\n\n## Give it a Star! ⭐️\n\nIf you find this repository useful and like it, why not give it a star? if not, never mind! :)\n\n## Benchmarks\n\n- [Benchmark of Collection Searching (Contains method) in terms of Execution Time (Mean)](#benchmark-of-collection-searching-contains-method-in-terms-of-execution-time-mean)\n- [Benchmark of Collection Searching (Contains method) in terms of Allocation Size](#benchmark-of-collection-searching-contains-method-in-terms-of-allocation-size)\n- [Benchmark of Collection Initializing in terms of Execution Time (Mean)](#benchmark-of-collection-initializing-in-terms-of-execution-time-mean)\n- [Benchmark of Collection Initializing in terms of Allocation Size](#benchmark-of-collection-initializing-in-terms-of-allocation-size)\n- [Benchmark of Collection Searching (TryGetValue method) in terms of Execution Time (Mean)](#benchmark-of-collection-searching-trygetvalue-method-in-terms-of-execution-time-mean)\n- [Benchmark of Collection Searching (TryGetValue method) in terms of Allocation Size](#benchmark-of-collection-searching-trygetvalue-method-in-terms-of-allocation-size)\n\n### Benchmark of Collection Searching (Contains method) in terms of Execution Time (Mean)\n\n- **Visit [HTML Page](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchContains-Mean.html)**\n- **Visit [Full Image](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchContains-Mean.png)**\n\n![Benchmark-SearchContains-Mean-Preview](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchContains-Mean-Preview.png)\n\n### Benchmark of Collection Searching (Contains method) in terms of Allocation Size\n\n- **Visit [HTML Page](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchContains-Allocated.html)**\n- **Visit [Full Image](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchContains-Allocated.png)**\n\n![Benchmark-SearchContains-Allocated-Preview](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchContains-Allocated-Preview.png)\n\n### Benchmark of Collection Initializing in terms of Execution Time (Mean)\n\n- **Visit [HTML Page](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-Initialize-Mean.html)**\n- **Visit [Full Image](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-Initialize-Mean.png)**\n\n![Benchmark-Initialize-Mean-Preview](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-Initialize-Mean-Preview.png)\n\n### Benchmark of Collection Initializing in terms of Allocation Size\n\n- **Visit [HTML Page](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-Initialize-Allocated.html)**\n- **Visit [Full Image](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-Initialize-Allocated.png)**\n\n![Benchmark-Initialize-Allocated-Preview](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-Initialize-Allocated-Preview.png)\n\n### Benchmark of Collection Searching (TryGetValue method) in terms of Execution Time (Mean)\n\n- **Visit [HTML Page](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchTryGetValue-Mean.html)**\n- **Visit [Full Image](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchTryGetValue-Mean.png)**\n\n![Benchmark-SearchTryGetValue-Mean-Preview](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchTryGetValue-Mean-Preview.png)\n\n### Benchmark of Collection Searching (TryGetValue method) in terms of Allocation Size\n\n- **Visit [HTML Page](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchTryGetValue-Allocated.html)**\n- **Visit [Full Image](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchTryGetValue-Allocated.png)**\n\n![Benchmark-SearchTryGetValue-Allocated-Preview](https://mjebrahimi.github.io/DotNet-Collections-Benchmark/Benchmark-SearchTryGetValue-Allocated-Preview.png)\n\n## BenchmarkDotNetVisualizer🌈\n\nAll the benchmarks are created by [BenchmarkDotNetVisualizer](https://github.com/mjebrahimi/BenchmarkDotNetVisualizer).\n\n## Todo\n\n- [ ] Add .NET 9.0 **OrderedDictionary** to the benchmarks\n- [ ] Add benchmarks for other operations such as **Add**, **Insert**, **Remove**, and **Update**.\n\n## Useful Resources\n\n- [.NET Big-O Algorithm Complexity Cheat Sheet](https://github.com/RehanSaeed/.NET-Big-O-Algorithm-Complexity-Cheat-Sheet)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjebrahimi%2Fdotnet-collections-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjebrahimi%2Fdotnet-collections-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjebrahimi%2Fdotnet-collections-benchmark/lists"}