wri / gfw_forest_loss_geotrellis

Global Tree Cover Loss Analysis using Geotrellis and SPARK
MIT License
10 stars 8 forks source link

Eliminate extra call to RasterExtent by reusing it to calculate cellSize #213

Closed danscales closed 8 months ago

danscales commented 8 months ago

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%