4 ms·
> "Yeah, I'm here. I've just never seen that before. It's a very...inventive sorting algorithm. How would you optimize it?" > In a flash, one line of code is c
by Paul-Craft 3y ago
> "Yeah, I'm here. I've just never seen that before. It's a very...inventive sorting algorithm. How would you optimize it?"
> In a flash, one line of code is changed:
-forM_ values (\time -> forkIO $ threadDelay (100000 * time) >> writeChan chan time)
+forM_ values (\time -> forkIO $ threadDelay (10000 * time) >> writeChan chan time)
> "It is now ten times faster."
Related: https://thedailywtf.com/articles/The-Speedup-Loop https://thedailywtf.com/articles/The-Speedup-Loop