https://medium.com/@hectorjsmith/what-i-learnt-when-a-faster-algorithm-slowed-down-my-code-41362a44a3cc