abp icon indicating copy to clipboard operation
abp copied to clipboard

Can abp Blazor be this fast?

Open sturlath opened this issue 3 years ago • 24 comments
trafficstars

Steves Sanderson Blazor WASM is.. well.. Blazor fast.. can abp.io get this fast please 695423!

Sorry but abo.io’s Blazor is super slow..

sturlath avatar Jun 26 '22 01:06 sturlath

ABP.IO has not its own Blazor. We are using the same one. Just adding some more libraries, adding authorization and some other real business requirements. Blazor is getting slow when we add these.

ABP's Angular UI, for example, is super fast. Try https://commercial-demo.abp.io/ for example, which is a large application. ABP's Angular UI is using the same backend with the Blazor UI, which is also built with ABP.

I noted that. If I have time I will add ABP to this example to see how ABP is making it slower.

hikalkan avatar Jun 26 '22 08:06 hikalkan

Yes sorry for this "outburst" of mine 😅 and I know yours is not special version. To note I´m happy with everything abp.io but loading of my Blazor backend is terribly slow (by any standard) what ever I have tried.

So when you see something like this you wonder why mine is taking such a long time.

Then you see that he is using "It’s a combination of static pre-rendering and max trimming settings" and this BlazorWasmPreRendering nuget

I have looked at lists like this Blazor performance best practices and they don´t mention this package for instance.

But now that we can see that WASM can be Blazing fast so why not default file new from abp.io? Can something be done or is the framework just to heavy (doing much more than Steves version)?

sturlath avatar Jun 27 '22 18:06 sturlath

OK, we will test and work on these. Thanks.

hikalkan avatar Jun 28 '22 06:06 hikalkan

Actually, it is wonderful developing Blazor with ABP framework. It makes developing so easy to communicate UI with backend. I see only loading time problem even after caching assemblies.

Loading after caching

I tried to understand why Blazor is slow on loading. There are nearly 5-6 seconds gap between requests from backend. I am not sure it is related to backend side. So I imported source projects of ABP from github (v5.2.2 and v5.3.1) and checked loading times. I couldn't find what triggers openid-configuration so I investigated "application-configuration" request. Even it takes only 90ms to download it from backend it takes 2 seconds to complete initializing module "WebAssemblyCachedApplicationConfigurationClient"

Loading after caching image image image

I checked also InitializeAsync of "WebAssemblyCachedApplicationConfigurationClient", it takes 2 seconds var configurationDto = await ApplicationConfigurationAppService.GetAsync();

As I understand from browser and log files, fetching data from backend is so fast, but processing it in Blazor side is slow. It goes to AbpApplicationConfigurationClientProxy but I couldn't investigate more because I need to import other projects to understand what happens there.

I hope there is not a big issue while initializing modules of Blazor and it can be solved soon.

omer-repo avatar Jul 04 '22 17:07 omer-repo

Thanks @omer-repo I will check it.

maliming avatar Jul 05 '22 00:07 maliming

Hi we have figured that most of our problems is related to Blazor compressed dll´s not served to the browser (they get created) so we are trying to add autostart="false" to <script src="_framework/blazor.webassembly.js" ></script> that I think you are adding in BundlingService.cs

Here is a quick video about it.

I created a support ticked for this issue. Shouldn´t the compression be default in the template?

sturlath avatar Aug 17 '22 21:08 sturlath

Thanks @sturlath 👍

maliming avatar Aug 18 '22 00:08 maliming

We are having problems overriding/removing-and-re-adding the script tag.

Just asking here in case this is something that is not currently possible but could then be introduced into version 6.0? (I can´t go live with users downloading over 100 MB website can I?)

sturlath avatar Aug 19 '22 08:08 sturlath

I will check it

realLiangshiwei avatar Aug 19 '22 08:08 realLiangshiwei

@realLiangshiwei did you by any change have time checking this out?

Being able to override this would be great but next best would be to only have to wait for abp 6.0 and not 7.0 (thats the reason for my pestering sorry)

sturlath avatar Aug 22 '22 07:08 sturlath

@realLiangshiwei did you by any change have time checking this out?

Being able to override this would be great but next best would be to only have to wait for abp 6.0 and not 7.0 (thats the reason for my pestering sorry)

See: https://github.com/abpframework/abp/issues/13771

realLiangshiwei avatar Aug 22 '22 08:08 realLiangshiwei

Thanks @omer-repo I will check it.

Hi @maliming , could you get a look the delay issue on loading

omer-repo avatar Aug 22 '22 13:08 omer-repo

hi We will check this asap. Thanks

maliming avatar Aug 24 '22 05:08 maliming

@realLiangshiwei Im not sure this is fixed in 6.0 https://github.com/abpframework/abp/issues/13771

When we try to load up a Blazor WASM its still taking long time (and MB’s) to dowload. Are there any other steps to do?

An why isn’t this a default functionality in the file new project template? Who would ever want to serve 100 MB page?

sturlath avatar Oct 14 '22 12:10 sturlath

@realLiangshiwei any feedback on this? Did you manage to try this out yourself and get the download size down?

Are we really doomed to be stuck with 100 MB Blazor backends? Is anybody using it out there?

If I wasn´t so deep into my development I would move from abp.io's version of Blazor but I can´t so I can only ask you to figure this out for us poor souls that choose it to begin with!

So, all feedback appreciated on this one1

sturlath avatar Oct 21 '22 11:10 sturlath

I removed this from 7.0-preview milestone. It doesn't mean we don't actively tracking it. However, this is not a concrete development that we will complete in a certain date range.

hikalkan avatar Nov 02 '22 13:11 hikalkan

Ahead-of-time (AOT) compilation: https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/webassembly?view=aspnetcore-7.0#ahead-of-time-aot-compilation

realLiangshiwei avatar Nov 09 '22 09:11 realLiangshiwei

How about this performance increase from Blazorise that abp.io is missing, @hikalkan? Something we can push into 7.0?

sturlath avatar Nov 13 '22 16:11 sturlath

Hi, @sturlath

See: https://github.com/abpframework/abp/issues/14734

realLiangshiwei avatar Nov 18 '22 14:11 realLiangshiwei

Thanks @realLiangshiwei yes, I spotted this and asked this question.

sturlath avatar Nov 19 '22 11:11 sturlath

I saw this comment I don´t know if this is something that can be used in abp.io but can hopefully close these loading gaps

You can essentially put all of these inside a link header with preload to speed things up.

sturlath avatar Nov 19 '22 14:11 sturlath

We are now serving our Blazor WASM with static websites and CDN í Azure and that combined with Brotli compression is making huge difference.

But I just wanted to add to @omer-repo about the "timeouts" in the loads.

We can see 5+3 sec in loading where nothing seems to be happening and was wondering what is going on there and if there is any work going on getting that down?

image

sturlath avatar Dec 07 '22 08:12 sturlath

Its not only us wondering about these things https://support.abp.io/QA/Questions/4210/Blazor-WASM-on-Azure-App---awful-loading-times

Can somebody tell us if this is being looked at? And if you have, the results? Is it fixable or will the abp wasm never be usable?

And then if you havent looked at it, why?

sturlath avatar Dec 17 '22 07:12 sturlath

anyone working on it?

dongfo avatar Jan 03 '24 10:01 dongfo