• Ok, then it didn't help and is still slow. You can verify the JIT is enabled by typing just the name of function sig and see the output.
    See the difference here.

    >function f(x){ return 0 ;}
    =function (x) { ... }
    >f
    =function (x) { ... }
    >function f(x){ "jit";return 0 ;}
    =function (x) { [JIT] }
    >f
    =function (x) { [JIT] }
    > 
    

    From c change it can be seen it is >thousand calls per second so the JIT is probably working and the debounce as Gordon suggested might further help.

    BTW if you would remove "jit" then maybe the c would be much smaller as with "jit" it runs in about 1 milisecond (if it handles about 4000 calls in 3 seconds) which is not that bad.

    EDIT: and BTW no need to put "jit" in startListening, that one is not called in tight loop and JIT eats extra RAM for generated native code. Doesn't hurt in this case, just mentioning it because overall marking everything with "jit" is not a good idea.

About

Avatar for fanoush @fanoush started