Scanning slow on MacOS

There is actually another command which can show the process itself and what happens with the read/write etc.

sudo fs_usage syncthing

which in my case has an output like:

16:32:36.098645  write             F=32   B=0x1000                                                                                                                                                                            0.000008   syncthing.1030685
16:32:36.098658  write             F=32   B=0xc97                                                                                                                                                                             0.000007   syncthing.1030685
16:32:36.098667  read              F=32 [ 35]                                                                                                                                                                                 0.000001   syncthing.1030685
16:32:36.138932    THROTTLED                                                                                                                                                                                                  0.715509   syncthing.1030732
16:32:36.138933  read              F=25   B=0x8000                                                                                                                                                                            0.872152   syncthing.1030732
16:32:36.224242    THROTTLED                                                                                                                                                                                                  0.794747   syncthing.1030714

Any THROTTLED as far as I know means that the MacOS is throttling resource heavy processes for idle applications. Why the Syncthing is considered as an idle application I have no clue, the developers can probably answer and fix this.

How to temporary fix it?

Prior folder scan you can run:

sudo sysctl debug.lowpri_throttle_enabled=0

To enable the throttling again you run:

sudo sysctl debug.lowpri_throttle_enabled=1

You can as well run

sudo sh -c 'echo debug.lowpri_throttle-enabled=0 >> /etc/sysctl.conf'

to disable the throttling on your system completely (no clue what will be the long term impact).

With disabled throttling the scanning performance is in my case ~270MiB/s (the value 8 for Hashers seems to be good for my storage).

Thank you very much everyone for your help!