New games every week!
JSE - Not a Lot... Blog
19th October 2021
Spent hours, yesterday, trying to squeeze every little bit out of the engine that I could.

-=-=-

Some folk will tell you that oldskool ifs "if (xx) {do this;} else {do that;}" are slower than the modern style of "xx : do this : do that;"
This doesn't appear to be the case, and all the time and effort I spent converting everything yesterday, has resulting in things running SLOWER on some browsers.
Big fat waste of time.

Ctrl+Z FTW.

Modern Javascript's optimisers are doing a great job, and in most cases, readability wins out, so stick with what you can understand, and let the browser do its own thing.

A few rejigs of the placement of numbers, and the removal of temporary variables seem to have helped a lot more.
I'm still having the biggest amount of slowdown when doing arrays. I though I'd found a nice method of speeding them up, yesterday, but in actual fact I'd simply broken the multi-dim functionality! Oops!!
More Ctrl+Z, there.
I'll probably give that another go, today, with multi-dim's in mind. Hopefully it works out a little better.
Views 65, Upvotes 4  
Daily Blog , Jse , Optimising
New games every week!
Site credits : Jayenkai made this.
(c) Jayenkai 2023 and onwards, RSS feed

Blog - JSE - Not a Lot... - AGameAWeek