Notice that the destructing assignment, the for...of loop and the repeated construction of the [[0, 0], ...] array each slow down the loop by some microseconds.
Waste an hour lifetime to do tests on Pyrenean Sierra or Deep Forest, which are the only maps using this painter.
Take my word for it that the sm45 doesn't improve the performance of these aspects or try it yourself: https://github.com/leper/0ad/tree/sm45
Read the createArea function and note that the greatest part of performance of rmgen is repeatedly randomizing of placer coordinates until the constraint is met and that the painter is only executed in O(n²) on the given points,
hence those milliseconds being irrelevant.