Open Closed

Critical perfomance issue Blazor webapp interactive auto #8834


User avatar
1
maria_ruiz created
  • ABP Framework version: v9.0.4

  • UI Type: Blazor webapp Interactive Auto

  • Database System: EF Core (SQL Server)

  • Tiered (for MVC) or Auth Server Separated (for Angular): no

Good morning,

In relation to this ticket:
https://abp.io/support/questions/8743/Critical-Performance-Issue-in-Blazor-WebAssembly-with-ABP-Affecting-Multiple-Production-Applications

The conclusion you gave us was to migrate to webapp, this migration has been done at a great cost of time,
However the problem is still there, the wasm is downloaded using blazor server and it is still very slow.

We have now changed it to use a CDN to download the files,
We have published it and we can give you the link to the application where it has been applied,

Any other solution?


3 Answer(s)
  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Hi,

    Sorry to hear that scenario that you are experiencing. Unfortunately, the current performance issues are inherent to Blazor itself. As it operates as a WebAssembly, initialization occurs within the browser and is highly dependent on client-side performance. Consequently, slower machines or mobile devices may require significantly more time to initialize the application.

    I worked on this performance situation formerly and here is my findings:
    Blazor performance is related to the following 2 points:

    • Network Quality (How fast the connection)

    • Client-Performance (Initializing WASM runtime on the client-side)
      image.png

    And 2 main point can affect to the performance:

    image.png

    If both are the problem, you can't even see the page properly, it takes over than 10secs
    image.png

    As far as I understood, you already made all the optimizations about networking including using CDN. But the main topic is the client-performance currently.

    This was my benchmark results back in ABP v7.4 and .NET 8 RC.1
    image.png

    Here how it works:

    • Download the wasm & javascript

    • Starts dotnet javascript

    • Javascript calls dotnet.wasm and starts initialize dotnet wasm runtime.

      • After dotnet wasm runtime initialized:

    • It downloads entry point and all the dependent DLL files.

    • Loads all the DLL files to the runtime.

    • Then your application starts working.

    So your code won't be compiled to the WASM. Only dotnet runtime is WASM in the scenario, and initializing that dotnet runtime written in wasm takes some time. And than second bottleneck is loading DLL files to the runtime. If you have a lot of DLL files, it'll take a lot more time even they're already downloaded. With ABP, there are already a lot of DLL files for infrastructure and modules.

    What can you do next?

  • User Avatar
    0
    maria_ruiz created

    Thank you for you review,

    We had come to the same conclusion, abp loads too many direct dll (about 130 approx) and transitive,

    The trimmer is not valid (https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/configure-trimmer?view=aspnetcore-9.0) as it does not work well when using reflection.

    We will try to implement the PWA configuration,

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    I expect this feature will be available stable in Blazor in future
    https://github.com/dotnet/runtime/issues/91219

    But for now, it doesn't work in the current state of neither Blazor WASM nor Blazor Web App.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 18, 2025, 10:42