Trying to send a 16KB file from the Espruino to a HTTP client. I've hooked up an SDcard reader to the Espruino and configured it, can successfully read and write data to/from it.
The first, reading the file in its entirety to RAM and then sending to the client, is relatively fast , 4.52 seconds to send 16.1KB.
The second, piping the file directly from the SD card is massively slower. I could understand it being a second or two slower, but 16.1KB takes 21.24 seconds.
I don't believe the SD card interface is the bottleneck, because reading the file to RAM first happens on a page request, so if the SD card took 16.72 seconds to read the file and the remaining 4.52 seconds was just sending the data over http, then the first request would take the same amount of time as the piping request.
Have I found another bug, am I doing something wrong, or am I misunderstanding the limitations of the platform?
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.
Trying to send a 16KB file from the Espruino to a HTTP client. I've hooked up an SDcard reader to the Espruino and configured it, can successfully read and write data to/from it.
I've tried both the methods mentioned here: http://www.espruino.com/Internet to send data to a HTTP client.
The first, reading the file in its entirety to RAM and then sending to the client, is relatively fast , 4.52 seconds to send 16.1KB.
The second, piping the file directly from the SD card is massively slower. I could understand it being a second or two slower, but 16.1KB takes 21.24 seconds.
I don't believe the SD card interface is the bottleneck, because reading the file to RAM first happens on a page request, so if the SD card took 16.72 seconds to read the file and the remaining 4.52 seconds was just sending the data over http, then the first request would take the same amount of time as the piping request.
Have I found another bug, am I doing something wrong, or am I misunderstanding the limitations of the platform?