I’ve been trying to figure this out as well.
I ended giving up and copied the data to a local SSD for the time being so I can process the data.
What “Not Nick” said is true. Sequential read or write of large files to the NAS is very fast. Random file access of small files, is incredibly slow because of both the network and slow seek and access time on the hard drives in the NAS.
Maybe a NAS made with only SSD would be faster?