AndyTaylorTweet / Pi-Star_DV_Dash

Pi-Star DV Dashboard (Based on works by Hans-J. Barthen (DL5DI) and Kim Huebel (DG9VH)).
http://www.pistar.uk/downloads/
111 stars 120 forks source link

Performance/optimization #165

Closed kn2tod closed 2 years ago

kn2tod commented 2 years ago

unnecessary recalculation of loop limit INSIDE the loop!

MW0MWZ commented 2 years ago

Does this: for ($i = 0; $i < count($localTXList); $i++) { Vs: $TXListLim = count($localTXList); for ($i = 0; $i < $TXListLim; $i++) {

really represent a performance increase?

kn2tod commented 2 years ago

Yes. Of the few examples given for improving performance, this is almost a verbatim line copy from: O'Reilly Programming PHP 4th ed, page 346. Not a biggie obviously, but every little bit helps. Remember: Pi-Zero's struggle mightily just to keep up. :)

MW0MWZ commented 2 years ago

Change applied - didn't use this PR since it contains other changes.