Eliminate extra call to RasterExtent by reusing same value to calculate cellSize
The rasterExtent, cellSize, and pixelArea calls all show up in profiles of gfwpro_dashboard and forest_change_diagnostic. It totals up to >20% in gfwpro_dashboard for a large area, because there are not a lot of other calculations going on. Eliminating the extra call to rasterExtent inside the cellSize call eliminates at least 5%
Eliminate extra call to RasterExtent by reusing same value to calculate cellSize
The rasterExtent, cellSize, and pixelArea calls all show up in profiles of gfwpro_dashboard and forest_change_diagnostic. It totals up to >20% in gfwpro_dashboard for a large area, because there are not a lot of other calculations going on. Eliminating the extra call to rasterExtent inside the cellSize call eliminates at least 5%