Just to add, I had a quick look at this, and I replaced the spiFlashReadWrite with a spiFlashRead which also avoided a memset as well - it reduces the exceution time from 8.79 to 8.58. Might not seem like much but there's a lot of other overhead for those calculations!
You can turn on GCC's -O3 for single functions, so I gave that a try, and it actually unrolls the loop anyway. It actually stopped Bangle.js being able to read from flash - so it turns out you can go too fast!
Using GCC's -O2 for the functions instead of the standard (-Os for size) actually made things slower!
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.
Just to add, I had a quick look at this, and I replaced the
spiFlashReadWrite
with aspiFlashRead
which also avoided a memset as well - it reduces the exceution time from 8.79 to 8.58. Might not seem like much but there's a lot of other overhead for those calculations!-O3
for single functions, so I gave that a try, and it actually unrolls the loop anyway. It actually stopped Bangle.js being able to read from flash - so it turns out you can go too fast!-O2
for the functions instead of the standard (-Os
for size) actually made things slower!