step 1: Oh no, this numerical optimization written in #Python is too slow.
step 2: Let's #RiiR!
step 3: I bet #argminrs will be really fast!!
step 4: Ok, that's faster than Python, but I expected more. What will it be? Is heap allocation the bottleneck? Will I need to switch to a more efficient HashMap implementation? Cache some intermediate values?
step 5: Let's profile!
1/2