Snappy - So slowly to calculate NDVI with Mask


I try to use the snappy to calculate NDVI with mask, but the programme is very slow. But when I used the SNAP Desktop it’s quickly.
The Product is S2A -level, 10980*10980,
my code: (2.2 KB)

You don’t provide much detail (platform, Java version, python version, contents of ~/.snap/snap-python/snappy/snappy.ini. I can only guess that java_max_mem: is too small for your large image.

Hi Friend ,

I am a newbie in sentinel 2 data processing. Could you please help me understand the flow of your code ?
Also, which tutorials did you refer to prepare this code?

Your response will be of really great help to me !