• 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

    1. Comment everything in shiftOut, ran the loop and measured whole time
    2. Comment writing data in shiftOut only, ran the loop and measured whole time
    3. 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 ;-)

About

Avatar for JumJum @JumJum started