Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> "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



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: