HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
dotnet
BenchmarkDotNet
C#2021–2024
dotnet / BenchmarkDotNet

BenchmarkDotNet

Powerful .NET library for benchmarking

4Distinct people
4Mentions
0Explicit recommenders
11.5KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Powerful .NET library for benchmarking

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 12:54:37 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year4 dated mentions

Observed mentions: 2021-11-21 13:18:31 UTC to 2024-07-23 09:03:52 UTC.

0122021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20222023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC000
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC202

What Hacker News says

4 sources
I haven't had chance to look over the code but I know that using Span for parsing might be a nice thing to try out. Have you considered making it compile to IL? Or if not that, using the Roslyn API to compile it to C# which is then automatically faster as a result of being compiled. Then getting AOT (ahead-of-time compilation) at build time gives you improved perf basically for free. I see neon has contributed a perf change, I know that he's an expert at using https://github.com/dotnet/BenchmarkDotNet so hopefully you'll be able to do some scientific tests soon. I would love to see another language here for the *Common* Language Runtime (CLR, the core of .NET).
In Show HN: Lisp in C#
Note that most of the performance improvements come from PGO, which is enabled with following environment variables. PGO is not enabled in .NET 6 by default, but will be in .NET 7 IIRC. set DOTNET_ReadyToRun=0 set DOTNET_TieredPGO=1 set DOTNET_TC_QuickJitForLoops=1 Here are my own benchmarks from a CPU intensive application without any IO and already optimized for allocations. Application runs a task graph either serially or in parallel. .NET 5 -------------------------- | Method | Mean | |------------ |---------:| | RunParallel | 473.4 us | | Run | 513.5 us | .NET 6 -------------------------- | Method | Mean | |------------ |---------:| | RunParallel | 452.5 us | | Run | 499.8 us | .NET 6 PGO -------------------------- | Method | Mean | |------------ |-
Read the rest
--------:| | RunParallel | 381.8 us | | Run | 412.2 us | .NET 5 - .NET 6 -> ~5% .NET 5 - .NET 6 PGO -> ~20% Here is what I learned from micro-optimizing a .NET application: - Use BenchmarkDotNet[0] for general measurements and Visual Studio profiler tools for detailed inspection. They help a lot. - Memory allocations matter. Using capturing lambdas, LINQ, even foreach on interfaces introduce allocations and slows down the application. You can use ClrHeapAllocationAnalyzer[1] to find these hidden allocations. - Using abstractions with interfaces and casting back to concrete types cause some overhead, though PGO will probably eliminate most of these. - Use LINQ cautiously as its variants are mostly slower than explicit coding. E.g. .Any() vs .Count == 0 - Checking Logger.IsEnabled() before calling Logger.Debug() etc. helps a lot. You can even automate this with Fody [2], but it breaks Edit&Continue and possibly .NET Hot Reload too, so it may hinder your productivity. [0] https://github.com/dotnet/BenchmarkDotNet [1] https://github.com/microsoft/RoslynClrHeapAllocationAnalyzer [2] https://github.com/jorisdebock/LoggerIsEnabled.Fody
In .NET 6 vs .NET 5 speedup

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.