Performance of Loops in Map