Promises do not offload computationally intensive tasks; they only provide a way to wait for an operation to complete asynchronously. Heavy operations (e.g., image processing, large data computations) will still block the main thread, causing UI lag or unresponsiveness.
@@MonsterlessonsAcademy Oh okay. I think I get it. Okay so 1. Can this be used on the server side as well? 2. Is it similar to multi threading on Java?
2:11 Agreed, but... if you have a big feature rich app and are paying for hosting by the processor tick etc. isn't it cheaper to push as much of the processing onto the client as possible? Particularly for heavy use applications.
Not really. The goal is to make your app fast and comfortable for user to use. This usually means improving perforamance as much as possible. If it is possible to do something on backend I will always do it there instead of the client browser.
Download the FREE PDF Now. Pass Your Javascript Interview with Confidence! ➡ monsterlessons-academy.com/newsletter_subscribers/javascript_interview?
Well done! Best wishes for the new year.
Thank you! You too!
Cool explanation! Thank you
Glad it was helpful!
Had an application that was drastically improved with a simple webworker.
Yeap, same
How does this differ from using Promises?
I mean, shouldn't using a promise or an asynchronous function solve this issue?
Promises do not offload computationally intensive tasks; they only provide a way to wait for an operation to complete asynchronously.
Heavy operations (e.g., image processing, large data computations) will still block the main thread, causing UI lag or unresponsiveness.
@@MonsterlessonsAcademy Oh okay. I think I get it. Okay so
1. Can this be used on the server side as well?
2. Is it similar to multi threading on Java?
2:11 Agreed, but... if you have a big feature rich app and are paying for hosting by the processor tick etc. isn't it cheaper to push as much of the processing onto the client as possible? Particularly for heavy use applications.
Not really. The goal is to make your app fast and comfortable for user to use. This usually means improving perforamance as much as possible. If it is possible to do something on backend I will always do it there instead of the client browser.
Have a happy new year!!!
You too!
1st