Please can you try with ...pipe(res, {chunkSize:512});
The issue will probably be due to the much smaller default chunk size (64 bytes IIRC) when piping data. While it shouldn't be that much slower, it can mean that the WiFi connection chooses to send many small packets rather than just a few large packets - and it can also be less efficient loading smaller amounts of data from the filesystem as well.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Please can you try with
...pipe(res, {chunkSize:512});
The issue will probably be due to the much smaller default chunk size (64 bytes IIRC) when piping data. While it shouldn't be that much slower, it can mean that the WiFi connection chooses to send many small packets rather than just a few large packets - and it can also be less efficient loading smaller amounts of data from the filesystem as well.