+ 5

Why animation runs way slowly and loading time increases ?

So when I increase the number of stars in following code from 50 to 300 as well as randomLeft and randomTop to 200 from 70, the problem mentioned above occurs,how can I avoid this ? https://code.sololearn.com/WTeL5g3S66ys/?ref=app

23rd Jun 2020, 10:35 PM
Abhay
Abhay - avatar
2 odpowiedzi
+ 3
Try using a blob with a web worker for your load loop code. https://itnext.io/achieving-parallelism-in-javascript-using-web-workers-8f921f2d26db Scroll down to inline web workers.
24th Jun 2020, 1:16 AM
ChaoticDawg
ChaoticDawg - avatar
+ 2
ChaoticDawg thanks :)
24th Jun 2020, 9:56 AM
Abhay
Abhay - avatar