I got the answer from the mapserver-users list in the end.
cmake3 -DINSTALL_LIB_DIR:PATH=/usr/lib64 \
The debug info can be forwarded into file that is defined with MS_ERRORFILE configuration option https://mapserver.org/mapfile/map.html
CONFIG "MS_ERRORFILE" "/path/to/errorfile.log"
Debug level 2 or higher is needed for including timings from msDrawMap().
Debug can be set at MAP level when it affects all the layers, of individually at LAYER level. Layer ...
If you want a downloaded file called result.gml from a WFS request for a GML output the following works:
MIMETYPE "text/xml; subtype=gml/2.1.2; driver=ogr"
and in your service WEB > ...
Hard to answer without more info.
Getting the data from the DB will be about the same in each case.
Converting it to an image (WMS) or GeoJSON will depend on the number and size of the features.
Transmitting the data to the client will again depend on the size and number of features, for small datasets GeoJSON will be faster but for larger or more ...