The attached patches improve the performance of BlockBlockDist.
The first patch (previously attached to
XTENLANG-1365) improves the performance of blockBlockRegionForPlace by constructing the region directly from mins and maxes, rather than by region algebra. (It also applies the same approach to BlockDist.)
The second patch copies the offset and maxOffset methods from BlockDist, which are more efficient as they avoid the creation of a RectLayout, instead using methods on the Region object.
Testing on the PME app from ANUChem single-threaded on a Pentium D (3.0GHz), the first patch reduces the runtime by ~9% and the second by about ~20%, giving a total reduction of about 27%.