𝔼𝕩𝕦𝕤𝕚𝕒@lemmy.world to memes@lemmy.world · 2 days agoTrue Spaghetti codelemmy.worldexternal-linkmessage-square36fedilinkarrow-up1872arrow-down13cross-posted to: programmer_humor@programming.dev
arrow-up1869arrow-down1external-linkTrue Spaghetti codelemmy.world𝔼𝕩𝕦𝕤𝕚𝕒@lemmy.world to memes@lemmy.world · 2 days agomessage-square36fedilinkcross-posted to: programmer_humor@programming.dev
minus-squarewise_pancake@lemmy.calinkfedilinkarrow-up37arrow-down1·2 days agoI have a great performance optimization for this What if instead of 1s sleep, we did 0.5s sleep? That’s a 100% improvement.
minus-squareAmanduh@lemm.eelinkfedilinkarrow-up14·2 days agoIt’s not sleeping for 1 second, $1 is an input parameter in the script
minus-squareJackbyDev@programming.devlinkfedilinkEnglisharrow-up2·6 hours agoI took it as meaning sleep for a number of seconds equal to half the value you’re sorting. So like f "(( $1 / 2 ))" & or however math works in bash, I always forget.
I have a great performance optimization for this
What if instead of 1s sleep, we did 0.5s sleep? That’s a 100% improvement.
It’s not sleeping for 1 second, $1 is an input parameter in the script
I took it as meaning sleep for a number of seconds equal to half the value you’re sorting. So like
f "(( $1 / 2 ))" &
or however math works in bash, I always forget.That sounds expensive