Need Blazor Wasm Performance Improvement on CPU Intensive Calculations #28080
Replies: 3 comments 5 replies
-
You'd need to actually explain what you're trying to do before we can deduce what you're trying to achieve is possible. |
Beta Was this translation helpful? Give feedback.
-
@KieranDevvs I'm not certain what additional info you need. The app lets the user develop a personal finance model that contains one or more "building blocks" the user chooses and configures. Each time the user changes a building block (e.g. changing the gross income from a job or the forecasted return from an investment account), the app recalculates the model by invoking various methods in a set of building block objects, iterating over the number of years in the model. In the user model I used for the benchmark performance mention above, the model contains 40 building block instances across 13 different building block types. Each building block puts the results it calculate into columns of a DataTable that they share. The recalculation performs no I/O or UI changes. Not sure that helps. I'm afraid I don't want to share the code itself. |
Beta Was this translation helpful? Give feedback.
-
@KieranDevvs Just closing this issue out. Here's a post of the issue with the repro. I am being told that AOT will the fix in .Net6 which won't release until November, 2021. Thanks for the help. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a c# WinForms app that I have been converting to Blazor Wasm. It needs to perform a cpu-intensive calculation after most user inputs. The calculations entail repetitively (30-50 times) invoking a number of methods in a set of 25-35 objects depending on the scenario. Once started, the exact same calculation code runs in the WinForms and Blazor apps.
I am seeing a ~20 fold degradation in performance under Blazor (e.g. 350ms in WinForms vs 7000ms in Blazor). Does that level of degradation make sense? Is a big part of it inherent to running within a browser? Is Blazor Wasm a big part of it? Are there any ways to significantly reduce it? The objects that perform the calculations could easily be put in a class library.
Beta Was this translation helpful? Give feedback.
All reactions