Skip to content

.NET 10 has ~1.8x higher RPS than .NET 11 preview 7 on a minimal ASP.NET Core app #132951

Closed

Description

@EgorBo

A minimal ASP.NET Core app serves ~1.8x fewer requests/sec on .NET 11 preview 7 than on .NET 10.

Source

webbench.cs (file-based app, no project file):

#:sdk Microsoft.NET.Sdk.Web

var builder = WebApplication.CreateSlimBuilder(args);
builder.Logging.SetMinimumLevel(LogLevel.Warning);
var app = builder.Build();
app.MapGet("/", () => "Hello, World!");
app.Run();

Script

run.sh:

#!/bin/bash
SDKS=${SDKS:-"net10 net11"}
MODES=${MODES:-"jit aot"}
SDK_ROOT=${SDK_ROOT:-$HOME/sdks}
OUT=${OUT:-/tmp/aspnet-repro-out}
BUILD=${BUILD:-1}
URL=http://127.0.0.1:5111

set -e
cd "$(cd "$(dirname "$0")" && pwd)"
trap 'kill $PID 2>/dev/null || true' EXIT

build() {
  local props="-p:PublishAot=false"
  [ "$2" = aot ] && props="-p:PublishAot=true -p:IlcInstructionSet=native"
  rm -rf "$HOME/.local/share/dotnet/runfile/webbench-"*
  DOTNET_ROOT="$SDK_ROOT/$1" PATH="$SDK_ROOT/$1:$PATH" \
    dotnet publish webbench.cs -c Release -r linux-x64 --self-contained $props -o "$OUT/$1-$2" -v q --nologo >/dev/null
}

run() {
  ASPNETCORE_URLS=$URL taskset -c 0-7 "$1/webbench" >/dev/null 2>&1 &
  PID=$!
  for _ in $(seq 1 100); do curl -sf -o /dev/null $URL && break; sleep 0.2; done
  taskset -c 16-23 bombardier -c 32 -d 5s $URL >/dev/null 2>&1
  taskset -c 16-23 bombardier -c 32 -d 10s $URL 2>&1 | awk '/Reqs\/sec/{print $2}'
  kill $PID; wait $PID 2>/dev/null || true
  sleep 1
}

if [ "$BUILD" = 1 ]; then
  rm -rf "$OUT"; mkdir -p "$OUT"
  for s in $SDKS; do for m in $MODES; do build "$s" "$m"; done; done
fi

printf "%-8s %12s %12s\n" sdk "JIT rps" "NAOT rps"
for s in $SDKS; do
  j=""; a=""
  for m in $MODES; do r=$(run "$OUT/$s-$m"); [ "$m" = jit ] && j=$r || a=$r; done
  printf "%-8s %12s %12s\n" "$s" "$j" "$a"
done

Results

Median of 3 runs, requests/sec:

SDK JIT RPS NAOT RPS
10.0.11 326,676 188,161
11.0.0-preview.7.26381.103 177,858 176,568
  • JIT regressed by 45.6% in .NET 11.
  • NAOT was 42.4% slower than JIT in .NET 10.

Environment

  • Linux x64 (WSL2, Ubuntu 24.04), 32 logical cores
  • Server pinned to cores 0-7, load generator pinned to cores 16-23
  • For faster warmup, I recommend disabling Hill Climbing and Tiered Compilation

Prerequisites:

curl -sSL -o dotnet-install.sh https://dot.net/v1/dotnet-install.sh && chmod +x dotnet-install.sh
./dotnet-install.sh --channel 10.0 --install-dir $HOME/sdks/net10 --no-path
./dotnet-install.sh --version 11.0.100-preview.7.26381.103 --install-dir $HOME/sdks/net11 --no-path

curl -sSL -o ~/bin/bombardier https://github.com/codesenberg/bombardier/releases/download/v1.2.6/bombardier-linux-amd64
chmod +x ~/bin/bombardier

Activity

  1. dotnet-policy-service commented on Aug 30, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
    See info in area-owners.md if you want to be subscribed.

  2. EgorBo commented on Aug 30, 2026

    @EgorBo
    MemberAuthor

    I haven't ran any investigation yet, but very likely ThreadPool/Semaphore/Spinwait related.

  3. dotnet-policy-service commented on Aug 30, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @JulieLeeMSFT, @VSadov
    See info in area-owners.md if you want to be subscribed.

  4. changed the title [-].NET 10 has ~1.7x higher RPS than .NET 11 preview 7 on a minimal ASP.NET Core app[/-] [+].NET 10 has ~1.8x higher RPS than .NET 11 preview 7 on a minimal ASP.NET Core app[/+] on Aug 30, 2026
  5. EgorBo commented on Aug 30, 2026

    @EgorBo
    MemberAuthor

    Looks like it might be fixed by #132765 cc @VSadov

  6. hez2010 commented on Aug 31, 2026

    @hez2010
    Contributor

    Looks like it might be fixed by #132765 cc @VSadov

    Tested with the latest nightly build but it still repros.

  7. EgorBo commented on Aug 31, 2026

    @EgorBo
    MemberAuthor

    Looks like it might be fixed by #132765 cc @VSadov

    Tested with the latest nightly build but it still repros.

    I am unable to reproduce your results.

    I see no regression between .NET 10, .NET 11 P7 and latest main on Windows-x64 (kind of makes sense from the #132765 that it's mostly Unix only).
    But I do see this regression fixed on linux-x64 in the latest main.

  8. hez2010 commented on Aug 31, 2026

    @hez2010
    Contributor

    I see no regression between .NET 10, .NET 11 P7 and latest main on Windows-x64

    It might be caused by my thread affinity config in the test script. Will test it again later.

  9. EgorBo commented on Aug 31, 2026

    @EgorBo
    Author
  10. EgorBo commented on Aug 31, 2026

    @EgorBo
    MemberAuthor

    @EgorBot minimalapi -linux_amd -linux_arm -aws_graviton5 -commits ae59a93,main -profiler

  11. added this to the 11.0.0 milestone on Sep 3, 2026
  12. removed
    untriagedNew issue has not been triaged by the area owner
    on Sep 3, 2026
  13. self-assigned this
    on Sep 8, 2026
  14. VSadov commented on Sep 11, 2026

    @VSadov
    Member

    I get roughly the same results regardless net10, net11-p7, net11-rc2

    sdk           JIT rps     NAOT rps
    net10        65344.08     65083.23
    net11        69017.86     67568.45
    

    This is on a relatively fast machine, in WSL.
    The RPS seem lower than reported.
    I also do not see AOT RPS being much lower than JIT in net10.

  15. VSadov commented on Sep 11, 2026

    @VSadov
    Member

    The RPS seem lower than reported.

    Hold on. That is because I was resolving connectivity issues to external hosts recently and left WSL network in mirrored mode.
    If I turn that off I see the following:

    sdk           JIT rps     NAOT rps
    net10       277276.46    179714.59
    net11_p7    150176.42    144324.34
    net11_r2    286418.71    256211.41
    

    I do see that AOT was slower in net10, everything was slower in preview7 and now everything is faster than net10.
    (AOT is still behind JIT, but much less so)

  16. EgorBo commented on Sep 11, 2026

    @EgorBo
    MemberAuthor

    The RPS seem lower than reported.

    Hold on. That is because I was resolving connectivity issues to external hosts recently and left WSL network in mirrored mode. If I turn that off I see the following:

    sdk           JIT rps     NAOT rps
    net10       277276.46    179714.59
    net11_p7    150176.42    144324.34
    net11_r2    286418.71    256211.41
    

    I do see that AOT was slower in net10, everything was slower in preview7 and now everything is faster than net10. (AOT is still behind JIT, but much less so)

    yep, that's more like it. I already double-confirmed locally that it's #132765
    Given the backport is merged I guess we can close it.

  17. locked and limited conversation to collaborators on Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

  • Status
    No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions