Introduction
Last time I compared Go 1.26 and .NET 10 strictly on memory allocation, and the conclusion was that the winner depended entirely on the workload: Go for strings and concurrency, .NET for collections and hash sets.
This is the follow-up, with three changes that make it a much more interesting fight:
- .NET 11 (SDK 11.0.100, runtime 11.0.0) — including its new Runtime Async implementation, which I explicitly enabled.
- Go 1.27.4 — the latest release, built with
GOAMD64=v3to match .NET’s x86-64-v3 ReadyToRun baseline. - A wider benchmark surface — 14 workloads instead of 6, plus an actual ASP.NET Core vs
net/httprequests-per-second comparison.
Both sides are Release builds on the same machine, and every number below comes from the same harness, the same data structures and the same algorithms.
What changed since the last round
| Previous post | This post | |
|---|---|---|
| Go | 1.26.5 | 1.27.4 |
| .NET | 10.0.302 | 11.0.100 / runtime 11.0.0 |
| .NET async | compiler state machines | runtime-async=on |
| Workloads | 6 | 14 |
| HTTP | — | Kestrel vs net/http, 3 endpoints |
The .NET 10 column is still included for the microbenchmarks, so you can see whether the new runtime actually moved the needle.
What .NET 11 brings to this fight
The .NET 11 runtime release notes are mostly about code generation, and a few of those changes are directly relevant to the workloads below:
- Runtime Async (V2). Instead of the C# compiler emitting a state machine struct and an
AsyncTaskMethodBuilderdance into everyasyncmethod, the runtime handles suspension and resumption. Synchronously-completing awaits no longer need a heap-allocated state machine, and continuations no longer captureExecutionContextby default. - JIT bounds-check elimination. More loop shapes now prove their index is in range, so array-heavy code drops redundant comparisons.
- Checked-context elimination and better guarded devirtualization, which matter for interface-heavy collection code.
- ReadyToRun x86-64-v3 images, with
Comparer<T>.Defaultspecialization in precompiled code (Microsoft’s benchmarks show up to ~20× on collection operations that use the default comparer). Math.BigMullowering to a singleMULinstruction when you need the high half of a 64×64-bit product.- x86-64-v2 as the minimum supported baseline, with v3 used for the precompiled images.
Only one of these is a switch you can flip, and it is the one people keep asking about:
<PropertyGroup>
<TargetFramework>net11.0</TargetFramework>
<Features>runtime-async=on</Features>
</PropertyGroup>
I did not take that on faith. Reflecting over a one-method probe assembly shows the compiler-generated state machine is gone with the feature enabled:
# run inside a net11.0 process, over the compiled probe.dll
[Reflection.Assembly]::LoadFile("probe.dll").GetTypes() |
Where-Object Name -like '*>d*'
# <Features>runtime-async=on -> no results
# default net11.0 -> <Hot>d__1
# <UseRuntimeAsync>false -> <Hot>d__1
(The >d* filter instead of *d__* catches local-function state machines too — the 14-workload harness names them <<ConcurrencyBench>g__WorkAsync|15_0>d, with no double underscore.)
For the ON/OFF comparison later in this post, the “off” build uses <UseRuntimeAsync>false</UseRuntimeAsync> with everything else identical. (Note: <Features>runtime-async=off</Features> does not do that — it left state machines in place in my builds. UseRuntimeAsync=false is the reliable switch.)
Methodology
Microbenchmarks
- .NET: Release, workstation GC,
TieredPGO=true, invariant globalization. No Server GC, because these are short-lived single-process runs. - Go:
go build -trimpath -ldflags "-s -w",GOAMD64=v3, Go 1.27.4 viaGOTOOLCHAIN. - Isolation: each of the 14 workloads runs in its own process. This matters for peak-memory numbers — a single process running all workloads reports the cumulative heap high-water mark for every row after the first.
- Sampling: 2 warmup calls, then 11 timed iterations; the median of those 11 is the sample.
- Repetition: 8 full sweeps, with the runtime order rotated between sweeps (first, last, middle) to cancel out slow drift in CPU frequency and background load. The number in the tables is the median of the 8 sweep medians.
- Allocation: measured on a separate call after a forced full GC, using
GC.GetTotalAllocatedBytes(precise: false)andruntime.MemStats.TotalAlloc. Both count every byte allocated, including objects that were collected immediately. - Peak WSS: process working set sampled every 10 ms during the measured call.
One transparency note: Go’s time.Now() on this Windows build quantized to roughly 0.5 ms, which is fatal for sub-millisecond workloads (bfs measured as 0.000 ms). I switched the Go harness to QueryPerformanceCounter for all timings. The .NET harness uses Stopwatch, which is already QPC-based.
HTTP
- Servers: ASP.NET Core 11 (
WebApplication.CreateSlimBuilder, Kestrel, Server GC + concurrent GC,DOTNET_PROCESSOR_COUNT=8) and ASP.NET Core 10 built from the sameProgram.cs; Go 1.27.4net/httpwithGOMAXPROCS=8. - Endpoints:
/plaintext(13-byte string),/json(one object),/json100(array of 100 objects). Both sides serialize JSON on every request — no caching tricks on either side. - Load: bombardier with
--fasthttp -c 128 -d 15s, after a 5 s warmup per endpoint. - Pinning: the server gets 8 logical CPUs (
0x00FF), the load generator gets the other 8 (0xFF00), so they never compete for cores. - Repetition: 6 interleaved reps per runtime, medians reported. Interleaving matters — running one runtime to completion and then the next hands the later runtime a warmer, slower machine.
All of this is loopback HTTP with no TLS, no reverse proxy and no database. It measures the framework’s request path, nothing else.
Hardware
AMD Ryzen 7 2700X (8 cores / 16 threads), 32 GB RAM, Windows, x64.
The workloads
| Workload | What it stresses |
|---|---|
primes | Trial division up to 1,000,000 — pure integer/branch work |
math | 10M iterations of sqrt/sin/cos — floating point and intrinsic calls |
string_naive | 100k iterations of result += i with truncation — worst-case string churn |
string_builder | Same loop with StringBuilder / strings.Builder |
string_buffer | Same loop with a stack/[]byte buffer and direct formatting |
collections | Build 1M ints, filter evens, square — dynamic growth |
collections_prealloc | Same, with capacity known up front |
sort_1m | Sort 1,000,000 random ints |
json_roundtrip | Serialize + deserialize a 10,000-item list, 20 times |
dict_lookup | 1M-entry dictionary, 5M random lookups |
concurrency_10k | 10,000 async operations, each suspending once (Task.Yield) |
async_tree | Recursive async tree (depth 8, 100 iterations) — depth-first await, no real I/O |
bfs | 10,000-node graph, 30,000 edges, array-backed queue |
dfs | Same graph, array-backed stack |
Round 1: execution time
| Workload | Go 1.27.4 | .NET 10 | .NET 11 | Go vs .NET 11 |
|---|---|---|---|---|
| primes | 188.0 ms | 180.6 ms | 186.8 ms | tie |
| math | 334.2 ms | 299.3 ms | 303.5 ms | .NET 1.10× faster |
| string_naive | 232.9 ms | 97.0 ms | 100.2 ms | .NET 2.32× faster |
| string_builder | 4.38 ms | 0.57 ms | 0.59 ms | .NET 7.4× faster |
| string_buffer | 1.50 ms | 0.51 ms | 0.51 ms | .NET 2.9× faster |
| collections | 13.17 ms | 10.55 ms | 11.15 ms | .NET 1.18× faster |
| collections_prealloc | 4.70 ms | 6.94 ms | 7.07 ms | Go 1.50× faster |
| sort_1m | 98.05 ms | 79.87 ms | 84.27 ms | .NET 1.16× faster |
| json_roundtrip | 324.9 ms | 267.3 ms | 250.6 ms | .NET 1.30× faster |
| dict_lookup | 426.6 ms | 250.5 ms | 260.0 ms | .NET 1.64× faster |
| concurrency_10k | 9.22 ms | 6.31 ms | 6.97 ms | .NET 1.32× faster |
| async_tree | 9.18 ms | 10.01 ms | 9.18 ms | tie |
| bfs | 0.18 ms | 0.19 ms | 0.19 ms | tie |
| dfs | 0.31 ms | 0.27 ms | 0.28 ms | .NET ~1.1× faster |
CPU-bound work is a coin flip
primes is a dead heat: 188 ms vs 187 ms. math favors .NET by about 10%, and that gap has been stable across every run I’ve done on this machine — Go’s math.Sin/math.Cos are portable implementations, while .NET binds to the platform’s math libraries where possible.
Neither result should drive a language decision. If your workload is a tight numeric loop, both runtimes are within 10% of each other and the surrounding system will matter more.
Is .NET 11 actually slower than .NET 10?
The table above compares across sweeps, which leaves a few percent of sweep-to-sweep noise between the two .NET builds. Several of those deltas landed inside that band, so I re-ran the comparison as a paired experiment: 20 rounds, each round running both builds back-to-back for every workload, with the order flipped every round. Below are medians of the 20 round medians, plus a two-sided sign test over the per-round winners:
| Workload | .NET 10 | .NET 11 | Δ time | .NET 11 wins | p |
|---|---|---|---|---|---|
primes | 214.88 ms | 216.04 ms | +0.5% | 10/20 | 1.00 |
math | 371.02 ms | 368.81 ms | −0.6% | 13/20 | 0.26 |
string_naive | 122.56 ms | 121.40 ms | −1.0% | 9/20 | 0.82 |
string_builder | 0.66 ms | 0.66 ms | −0.8% | 9/20 | 0.82 |
string_buffer | 0.61 ms | 0.59 ms | −2.0% | 11/20 | 0.82 |
collections | 12.44 ms | 12.42 ms | −0.1% | 10/20 | 1.00 |
collections_prealloc | 7.97 ms | 8.20 ms | +2.8% | 7/20 | 0.26 |
sort_1m | 92.04 ms | 90.33 ms | −1.9% | 10/20 | 1.00 |
json_roundtrip | 304.43 ms | 290.54 ms | −4.6% | 13/20 | 0.26 |
dict_lookup | 315.31 ms | 299.54 ms | −5.0% | 12/20 | 0.50 |
concurrency_10k | 7.08 ms | 7.87 ms | +11.1% | 3/20 | 0.003 |
async_tree | 11.10 ms | 10.57 ms | −4.8% | 13/20 | 0.26 |
bfs | 0.22 ms | 0.22 ms | −1.1% | 9/20 | 0.82 |
dfs | 0.30 ms | 0.31 ms | +2.8% | 9/20 | 0.82 |
Absolute times here run ~15% higher than in the sweep table — the machine was in a slower state by then — so read the deltas, not the absolutes.
Only one row is statistically real. concurrency_10k is 11% slower on .NET 11 and won just 3 of 20 rounds (p = 0.003); it was also slower in all eight original sweeps, so this is the one genuine regression. Everything else is inside ±5% with no consistent winner: primes, collections and sort_1m — the three that looked slowest in the sweep table — are at parity, and dict_lookup, json_roundtrip and async_tree even came out ~5% faster, though not at a significant win rate. Allocation is effectively identical on 13 of 14 workloads — within ~9 KB, and under 4 KB of that on the two CPU-bound rows; only concurrency_10k moves, from 1.13 MB to 1.96 MB.
So the fair conclusion is parity, not regression. .NET 11 is not slower than .NET 10 on CPU-bound or allocation-heavy code, and it is not faster either — the JIT work in this release doesn’t move these particular loops. The one real regression is the async suspension path, and that is the price of the Runtime Async design covered in Round 4.
Strings: .NET wins the clock, Go wins the bytes
This is the most counterintuitive row in the table. The naive += loop allocates 1.39 GB in .NET and 750 MB in Go (UTF-16 vs UTF-8), yet .NET finishes in 100 ms while Go takes 233 ms.
That is not a contradiction — it is a difference in how the two collectors handle short-lived garbage. .NET’s gen0 collector is extremely good at reclaiming objects that die immediately, and it runs on a dedicated thread while the mutator keeps going. Go’s concurrent collector has to keep up with the same churn, and at this allocation rate it simply doesn’t.
The gap gets bigger once you stop writing naive code:
| Pattern | Go | .NET 11 | Time winner |
|---|---|---|---|
result += i | 232.9 ms / 750 MB | 100.2 ms / 1.39 GB | .NET 2.3× |
| Growable builder | 4.38 ms / 3.62 MB | 0.59 ms / 52.5 KB | .NET 7.4× |
| Pre-allocated buffer | 1.50 ms / 14.8 KB | 0.51 ms / 39.6 KB | .NET 2.9× |
StringBuilder truncating with sb.Length = 5000 is an in-place write; Go’s strings.Builder has no length setter, so the Go version has to materialize and re-copy. That single language difference explains most of the 7.4×.
Collections: the growth strategy still decides
The old finding holds:
- Without preallocation, Go allocates 80.0 MB and .NET 20.0 MB — .NET is 4× leaner and 18% faster. Go 1.27 still grows large slices by roughly 1.25×, so the total churn is about 5× the final size;
List<T>doubles, so it’s about 2×. - With preallocation, Go is suddenly 1.5× faster (4.70 ms vs 7.07 ms), even though it allocates more (15.3 MB vs 9.6 MB).
appendinto a slice with spare capacity is about as cheap as a memory write gets;List<T>.Addstill pays a capacity check per call.
So the advice is unchanged, but sharper: if you know the size, preallocate — and in Go, preallocation buys you speed, not just fewer collections.
Sorting, JSON and dictionaries
sort_1m: .NET 84 ms vs Go 98 ms. Both use introsort variants over a 1M-element array; the difference is mostly the comparison/swap code the JIT produces. (Also: a Gointis 8 bytes, a C#intis 4 — the Go array is twice as large, which is why it allocates 7.6 MB vs 3.8 MB.)json_roundtrip: .NET 251 ms vs Go 325 ms.System.Text.Jsonhas had a lot of investment in the last few releases, and it shows; Go’sencoding/jsonis reflection-based and allocates 84 MB vs 62 MB.dict_lookup: the largest speed gap in the microbenchmarks — .NET 260 ms vs Go 427 ms (1.64×). Five million random lookups into a 1M-entry map is exactly the workload where Go’s hash-map layout pays for itself in cache misses. Go 1.24 moved maps to Swiss tables, which improved this path, but it’s still the widest gap here.
Concurrency and graphs
concurrency_10k (10,000 tasks that each hit Task.Yield) is 6.97 ms in .NET 11 vs 9.22 ms in Go — .NET is 32% faster to spawn, suspend and resume. That is the opposite of the previous post, which measured .NET at 19 ms against Go’s 5.4 ms, but the reversal is not Runtime Async’s doing: in this harness .NET 10 measures 6.31 ms, and the Runtime Async OFF build is faster still at 6.67 ms. Turning the feature on costs ~5% of time and 73% of allocation here (Round 4). The cross-post swing is a harness difference — different process model, QPC-timed medians instead of a single pass — which is exactly why I don’t compare numbers across posts.
async_tree is a tie at 9.18 ms. Recursive async code with depth-first awaits doesn’t produce much scheduling pressure, so both runtimes end up in the same place.
For the graph traversals I hoisted graph construction out of the timed region, so the numbers isolate traversal:
| Go | .NET 11 | |
|---|---|---|
| BFS | 0.18 ms | 0.19 ms |
| DFS | 0.31 ms | 0.28 ms |
Both are effectively tied. Note that this contradicts the 14× BFS gap in the previous post — because that benchmark compared Go’s slice queue against .NET’s Queue<int>, and Queue<int> was the wrong tool. With an array-backed ring buffer on the .NET side, the gap disappears. The lesson is about data structures, not runtimes.
Round 2: allocation
| Workload | Go 1.27.4 | .NET 10 | .NET 11 | .NET 11 vs Go |
|---|---|---|---|---|
| primes | 7.6 KB | 47.9 KB | 44.6 KB | Go ~6× less¹ |
| math | 12.9 KB | 66.7 KB | 63.1 KB | Go ~5× less¹ |
| string_naive | 750.5 MB | 1.39 GB | 1.39 GB | Go 47% less |
| string_builder | 3.62 MB | 52.4 KB | 52.5 KB | .NET 99% less |
| string_buffer | 14.8 KB | 39.5 KB | 39.6 KB | Go 2.7× less |
| collections | 80.0 MB | 20.0 MB | 20.0 MB | .NET 75% less |
| collections_prealloc | 15.3 MB | 9.6 MB | 9.6 MB | .NET 37% less |
| sort_1m | 7.64 MB | 3.84 MB | 3.84 MB | .NET 50% less |
| json_roundtrip | 84.2 MB | 62.5 MB | 62.5 MB | .NET 26% less |
| dict_lookup | 36.1 MB | 22.2 MB | 22.2 MB | .NET 38% less |
| concurrency_10k | 784 KB | 1.13 MB | 1.96 MB | Go 2.5× less |
| async_tree | 3.90 MB | 4.11 MB | 4.11 MB | Go 5% less |
| bfs | 241.5 KB | 150.0 KB | 150.1 KB | .NET 38% less |
| dfs | 241.5 KB | 150.0 KB | 150.1 KB | .NET 38% less |
| Total | 982.5 MB | 1.51 GB | 1.51 GB | Go 35% less |
¹ Below ~100 KB, most of the difference is runtime bookkeeping rather than the algorithm; both are effectively zero.
Two things stand out:
The total is a lie of averages. 1.39 GB of the .NET total is the single naive string loop, and 750 MB of Go’s is the same loop. If you exclude string_naive, the picture flips completely:
| Go | .NET 11 | |
|---|---|---|
Total excluding string_naive | 232.0 MB | 124.7 MB |
Outside of string concatenation, .NET 11 allocates 46% less than Go across these workloads. That is consistent with the previous post (which found .NET 74% leaner outside strings) — the categories didn’t change, only the magnitudes.
concurrency_10k is the one place .NET 11 got worse. Go allocates 784 KB, .NET 10 allocated 1.13 MB, and .NET 11 with Runtime Async allocates 1.96 MB — 73% more than .NET 10. That’s not a mistake in the harness: it’s the same effect the dedicated probe shows, and it’s the subject of Round 4.
Round 3: peak memory and GC pressure
| Workload | Go peak WSS | .NET 11 peak WSS | Go live heap | .NET 11 live heap | .NET 11 gen0 |
|---|---|---|---|---|---|
| primes | 7.0 MB | 26.4 MB | 1.0 MB | 0.7 MB | 0 |
| math | 7.0 MB | 26.4 MB | 1.0 MB | 0.8 MB | 0 |
| string_naive | 26.0 MB | 33.3 MB | 2.8 MB | 4.3 MB | 355 |
| string_builder | 11.5 MB | 27.4 MB | 1.9 MB | 0.7 MB | 0 |
| string_buffer | 7.0 MB | 26.7 MB | 1.0 MB | 0.7 MB | 0 |
| collections | 33.5 MB | 40.2 MB | 12.5 MB | 16.3 MB | 2 |
| collections_prealloc | 43.0 MB | 33.9 MB | 16.3 MB | 10.2 MB | 1 |
| sort_1m | 30.0 MB | 28.3 MB | 8.6 MB | 4.5 MB | 0 |
| json_roundtrip | 15.5 MB | 69.2 MB | 4.7 MB | 13.1 MB | 9 |
| dict_lookup | 77.5 MB | 130.3 MB | 37.1 MB | 22.9 MB | 1 |
| concurrency_10k | 19.0 MB | 36.3 MB | 2.3 MB | 2.7 MB | 0 |
| async_tree | 18.0 MB | 33.1 MB | 3.1 MB | 0.8 MB | 1 |
| bfs | 9.0 MB | 26.5 MB | 1.2 MB | 0.8 MB | 0 |
| dfs | 9.0 MB | 26.4 MB | 1.2 MB | 0.8 MB | 0 |
Three observations:
- .NET has a ~26 MB floor for any process. Go’s floor is ~7 MB. If you’re deploying hundreds of tiny sidecars, that difference is real money.
- Peak WSS and live heap tell different stories. In
dict_lookup, .NET’s live heap is smaller (22.9 MB vs 37.1 MB) but its peak working set is much larger (130.3 MB vs 77.5 MB). Go’s map has a bigger steady-state footprint; .NET’s GC lets the heap grow into the machine and doesn’t hand memory back aggressively. If you care about steady-state RSS, measure RSS, notGC.GetTotalMemory. - GC counts are tiny everywhere except the naive string loop. 355 gen0 collections for 1.39 GB of churn is the collector doing exactly what it was designed to do. Gen1/gen2 collections were zero for 10 of the 14 workloads; the only ones that promoted anything were
collections,collections_prealloc,dict_lookupandjson_roundtrip, with 1–6 each.
Round 4: Runtime Async ON vs OFF
This is the part I was most curious about, so I wrote a separate probe suite and ran the ON and OFF builds alternately for 9 rounds, taking medians. Alternating is important: a full ON sweep followed by a full OFF sweep would mostly measure the machine getting warmer.
| Workload | ON time | OFF time | ON alloc | OFF alloc | Alloc delta |
|---|---|---|---|---|---|
async_completed_task (no await) | 3.43 ms | 2.25 ms | 6.87 MB | 6.87 MB | 0% |
await_fromresult (100k) | 3.34 ms | 4.35 ms | 6.87 MB | 13.73 MB | −50% |
await_completedtask (100k) | 3.41 ms | 3.10 ms | 6.87 MB | 6.87 MB | 0% |
await_yield (10k) | 8.14 ms | 7.82 ms | 1.96 MB | 1.12 MB | +75% |
chain3_completed (20k chains of 4) | 2.82 ms | 7.83 ms | 1.38 MB | 6.87 MB | −80% |
suspended_10k (TCS) | 8.84 ms | 8.07 ms | 3.48 MB | 2.01 MB | +73% |
async_void_loop (5k × 10 yields) | 9.73 ms | 9.64 ms | 1.04 MB | 0.55 MB | +90% |
The pattern is unambiguous, and it is not the one-sided story the feature name suggests:
When awaits complete synchronously, Runtime Async is a huge win. await Task.FromResult(...) cuts allocation in half, and a 4-deep chain of already-completed awaits drops from 7.83 ms / 6.87 MB to 2.82 ms / 1.38 MB — 2.8× faster and 80% less allocation. That’s the case Runtime Async was built for: async methods used as cheap wrappers, cached results, ValueTask fast paths, and deep call chains that never actually suspend.
When an await genuinely suspends, it currently costs more. Task.Yield across 10,000 operations allocates 75% more with the feature on; TaskCompletionSource suspension 73% more; a loop that yields ten times per operation 90% more. The time difference is small (1–10%), so this is about GC pressure, not throughput. This contradicts the release notes, which list await Task.Yield() as avoiding extra allocations in runtime-async paths; in this probe — a single mid-method yield — it clearly doesn’t.
The main suite agrees: concurrency_10k is exactly the Task.Yield case, and it goes from 1.13 MB (.NET 10 / Runtime Async off) to 1.96 MB (Runtime Async on), while still being 32% faster than Go on time.
There’s also one result I can’t fully explain and won’t hide: an async Task<int> method with no await at all was 52% slower with the feature on (3.43 vs 2.25 ms) with identical allocation. That method still goes through the async method path, and in this build that path is slower when there is nothing to await. The release notes point to inlining of await-less async calls as a Runtime Async win, so this is probably a tiering artifact in a short-lived console process — but I can only report what the harness measured. It’s a reminder that “turn on the new codegen” is not automatically a win in every shape.
My take: enable Runtime Async if your async code is dominated by synchronously-completing awaits (which is most business code). If you have hot paths built on Task.Yield or millions of TaskCompletionSource suspensions, benchmark before and after — you may trade throughput for allocation, and the trade may not be worth it.
Round 5: ASP.NET Core 11 vs net/http
Same endpoints, same JSON, same 128 concurrent connections, both servers pinned to 8 logical CPUs with the load generator on the other 8. Six interleaved runs, medians:
| Endpoint | Runtime | Reqs/sec | p50 | p99 | Server CPU | RSS | Peak RSS |
|---|---|---|---|---|---|---|---|
/plaintext | Go 1.27.4 | 46,778 | 1.94 ms | 14.16 ms | 80.2% | 19.5 MB | 20.8 MB |
/plaintext | .NET 10 | 65,102 | 2.00 ms | 5.52 ms | 83.9% | 53.1 MB | 67.0 MB |
/plaintext | .NET 11 | 63,668 | 2.00 ms | 5.54 ms | 83.5% | 54.1 MB | 68.9 MB |
/json | Go 1.27.4 | 43,187 | 2.03 ms | 15.52 ms | 79.7% | 19.7 MB | 20.9 MB |
/json | .NET 10 | 65,866 | 2.00 ms | 4.72 ms | 83.1% | 56.7 MB | 75.5 MB |
/json | .NET 11 | 64,666 | 2.00 ms | 5.08 ms | 83.0% | 58.1 MB | 79.9 MB |
/json100 | Go 1.27.4 | 26,319 | 1.94 ms | 38.45 ms | 75.7% | 20.1 MB | 21.1 MB |
/json100 | .NET 10 | 44,874 | 2.71 ms | 6.16 ms | 88.1% | 58.2 MB | 75.5 MB |
/json100 | .NET 11 | 44,000 | 2.75 ms | 6.74 ms | 87.7% | 61.5 MB | 79.9 MB |
Throughput: .NET 11 wins by 36–67%
/plaintext: 63,668 vs 46,778 RPS (+36%)/json: 64,666 vs 43,187 RPS (+50%)/json100: 44,000 vs 26,319 RPS (+67%)
The JSON gap is the most interesting one, because it’s where the frameworks differ most in philosophy: Kestrel plus System.Text.Json is a highly-tuned serializer writing into pooled buffers, while encoding/json reflects over the struct on every call.
Tail latency: .NET wins by 2.6–5.7×
The medians look similar — Go is even faster at p50 on /plaintext (1.94 ms vs 2.00 ms) and clearly faster on /json100 (1.94 ms vs 2.75 ms). But the tails are not close:
| Endpoint | Go p99 | .NET 11 p99 | Ratio |
|---|---|---|---|
/plaintext | 14.16 ms | 5.54 ms | 2.6× |
/json | 15.52 ms | 5.08 ms | 3.1× |
/json100 | 38.45 ms | 6.74 ms | 5.7× |
This is the classic Go GC signature: the concurrent collector keeps average latency low, then a cycle lands and a batch of requests waits. Under 128 concurrent connections, the slowest 1% of requests pay for it. If your SLO is p99, that’s the number that pages you, not the median.
Throughput per CPU-second
RPS alone rewards whichever runtime burns more CPU. Dividing throughput by the server’s measured CPU time:
| Endpoint | Go RPS/CPU-s | .NET 11 RPS/CPU-s | .NET advantage |
|---|---|---|---|
/plaintext | 7,289 | 9,531 | 1.31× |
/json | 6,772 | 9,738 | 1.44× |
/json100 | 4,343 | 6,268 | 1.44× |
So .NET isn’t winning just by using more cores — it’s doing 30–44% more work per CPU-second. That also means the .NET numbers would survive a smaller container better than the raw RPS suggests.
Memory: Go wins by ~3×
The one place Go dominates is footprint: 19–20 MB RSS versus 54–62 MB for .NET 11 (peak 21 MB vs 69–80 MB). If you run 50 of these processes, that’s roughly 1 GB versus 3 GB of resident memory before you’ve served a single request.
.NET 10 vs .NET 11 on HTTP: a tie
Despite all the JIT work in .NET 11, the server numbers are statistically identical: −2.2% on /plaintext, −1.8% on /json, −1.9% on /json100. Across six interleaved reps the run-to-run spread was larger than the difference between the versions. If you were hoping Runtime Async would move request throughput, it doesn’t — Kestrel’s request path isn’t the shape the feature optimizes.
The scoreboard
| Dimension | Winner | Margin |
|---|---|---|
CPU-bound loops (primes, math) | .NET 11 | 0–10% |
| Naive string churn (time) | .NET 11 | 2.3× |
| Naive string churn (bytes) | Go | 47% less |
| Builder / buffer strings (time) | .NET 11 | 2.9–7.4× |
| Builder / buffer strings (bytes) | Split | .NET 99% less (builder), Go 2.7× less (buffer) |
| Dynamic collections | .NET 11 | 18% faster, 75% less allocation |
| Preallocated collections | Go | 1.5× faster |
| Sorting | .NET 11 | 16% faster, 50% less allocation |
| JSON round-trip | .NET 11 | 30% faster, 26% less allocation |
| Dictionary lookups | .NET 11 | 1.64× faster, 38% less allocation |
| Task-based concurrency (time) | .NET 11 | 32% faster |
| Task-based concurrency (bytes) | Go | 2.5× less (1.5× vs .NET 10) |
| Graph traversal | Tie | ±10% |
| HTTP throughput | .NET 11 | +36% to +67% |
| HTTP tail latency (p99) | .NET 11 | 2.6–5.7× |
| HTTP memory | Go | ~3× less RSS |
| Process floor | Go | ~7 MB vs ~26 MB |
| .NET 11 vs .NET 10, 13 of 14 workloads | Parity | ±5% |
.NET 11 vs .NET 10, Task.Yield | .NET 10 | 11% faster, 43% less allocation |
Key takeaways
Runtime Async is a real win for the common case, and a regression for the suspending case. Synchronously-completing chains got 2.8× faster with 80% less allocation;
Task.Yield/TCS suspension allocates 73–90% more. Measure your own await shapes before flipping the switch — “on” is not automatically better.Go’s allocation advantage is entirely about strings. Outside
string_naive, .NET allocated 46% less than Go across these 14 workloads. The headline “Go uses less memory” is a UTF-8 vs UTF-16 story, not a general one.Preallocation is Go’s trump card. With capacity known up front, Go beat .NET by 1.5× on the exact workload where .NET beat it by 18% without preallocation. In Go,
make([]T, 0, n)is a performance decision, not just a GC one.Go’s GC buys median latency and pays in the tail. p50 was a tie (Go even slightly ahead), but p99 was 2.6–5.7× worse. If your SLO is p99, that’s the whole ballgame.
.NET’s throughput advantage survives normalization. It isn’t just burning more CPU: 30–44% more requests per CPU-second across all three endpoints.
Go’s footprint is the reason to pick it for infrastructure. ~20 MB RSS and a ~7 MB floor versus ~55–62 MB and ~26 MB. At scale, that’s the difference between one node and three.
.NET 10 → .NET 11 is a parity release on raw throughput. A 20-round paired test found no significant difference on 13 of the 14 workloads (all within ±5%), allocation was effectively unchanged, and HTTP throughput was flat. The single real regression is
Task.Yieldsuspension: ~11% slower with 74% more allocation. The wins in this release are elsewhere — synchronously-completing await chains are 2.8× faster with 80% less allocation — so upgrade for the async codegen, not for a free CPU speedup.
The Bottom Line
Go 1.27 and .NET 11 are not converging; they’re optimizing for different things.
- Pick .NET 11 when you need request throughput, tail latency, JSON/serialization speed, or dictionary-heavy data processing. With Runtime Async enabled, its async fast path is now genuinely cheap: for awaits that complete synchronously, allocation halves and deep chains get ~2.8× faster.
- Pick Go when footprint, startup, and deployment simplicity dominate: sidecars, CLI tools, edge workers, anything you run in large numbers. Its p50 is competitive and its memory use is a third of .NET’s.
And in both cases: the difference between naive and optimized code (up to 7× here, 88,000× in the string case last time) is still much larger than the difference between the runtimes. Profile first, then choose.
