I suspected that, but it cannot be because the straight
method without that line is much faster, and as you
change the $foo line you see the speed of the stupid
sort change.
I suspect a more fundamental issue with how map and grep
are implemented, and it should IMO be fixable.