szogyenyid,

To all the #webdev folks using #php in their stack. Did you know that using count($myArr) in your for loops' check uses almost twice as much energy than saving this value to a variable and using that one?

On my laptop, a for-loop used 0.79 Watts with a pre-calculated count(), and 1.51 Watts when calling the function in the loop's check.

You can measure it yourself with the tool I've written this weekend: https://github.com/szogyenyid/joulenne

#green #sustainability #sustainable #software

  • All
  • Subscribed
  • Moderated
  • Favorites
  • webdev
  • DreamBathrooms
  • ngwrru68w68
  • modclub
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • GTA5RPClips
  • JUstTest
  • tacticalgear
  • normalnudes
  • tester
  • osvaldo12
  • everett
  • cubers
  • ethstaker
  • anitta
  • provamag3
  • Leos
  • cisconetworking
  • megavids
  • lostlight
  • All magazines