To avoid misunderstandings because of the 500usecs.
Sorry for writing this like being measured exactly. I shouldn't have done that.
What I did during testing is to
Comment everything in shiftOut, ran the loop and measured whole time
Comment writing data in shiftOut only, ran the loop and measured whole time
did the same for digitalWrite
Tests have been done on ESP32 only, and duration has not been stable.
I had up to 2 msecs difference in whole loop, running the test multiple times.
All together a lot of time is used to check pins, set them to be output etc.
In my understanding bind optimizes interpreting source code.
Since args are always the same, bind stores the result of interpreting source.
So translating text to jsVars, is done once only, obviously this saves a lot time.
But it does not skip parts of the underlying function, in this case jswrap_io_shiftOut
I hope this is reasonably correct, and I'm not embarrassing myself ;-)
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.
To avoid misunderstandings because of the 500usecs.
Sorry for writing this like being measured exactly. I shouldn't have done that.
What I did during testing is to
Tests have been done on ESP32 only, and duration has not been stable.
I had up to 2 msecs difference in whole loop, running the test multiple times.
All together a lot of time is used to check pins, set them to be output etc.
In my understanding bind optimizes interpreting source code.
Since args are always the same, bind stores the result of interpreting source.
So translating text to jsVars, is done once only, obviously this saves a lot time.
But it does not skip parts of the underlying function, in this case jswrap_io_shiftOut
I hope this is reasonably correct, and I'm not embarrassing myself ;-)