Update: the ets code is using a bulk insert (a list of tuples) - giving it the apparent edge over the map code. Replacing individual Map.put/3
calls with a consolidated maps:merge/2
call improved matters for the map as a cache case.
For the process dictionary approach see:
Improving a slow solution for Longest Collatz Sequence