You are reading a single comment by @allObjects and its replies. Click here to read the full conversation.
  • Highlights the fact that Espruino interpreter lives of the source... the shorter the source, the faster the execution (even if it just spaces that have to be skipped) - and resolving variable names is obviously a heavy hit... and even heavier when global. Therefore, a comparison of a variable against undefined versus a local, short-named variable of value undefined is expected to be faster, is it? Wondered also about the this in the object-oriented use of javascript: does it qualify for 'short variable'?

    Interesting question: What executes faster ?

    • a) if with large then and else block
    • b) two function/method definitions and and an if invoking either one of those two functions.

    Since the code is in the RAM, some minimal JIT could be done... may be there is already something done...

About

Avatar for allObjects @allObjects started