Optimization of the calculation of the map's size