Changes between Version 2 and Version 3 of JavaScript performance improvement ideas


Ignore:
Timestamp:
Oct 19, 2007, 9:35:58 PM (17 years ago)
Author:
mjs@apple.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • JavaScript performance improvement ideas

    v2 v3  
    99 * Generational mostly-copying garbage collector. This one is likely to be pretty hard.
    1010
    11  * use bytecode or something similar to make the interpreter non-recursive so it doesn't use so much stack. But the inner loop has to be coded carefully because obvious ways of doing will regress performance instead of speeding it up.
     11 * Use bytecode or something similar to make the interpreter non-recursive so it doesn't use so much stack. But the inner loop has to be coded carefully because obvious ways of doing will regress performance instead of speeding it up. (direct threading, subroutine threading, context threading)
    1212
    1313 * Constant folding. This could be done purely by the parser, for strings, numbers, even regexps.
     
    2020
    2121 * Scalable Array implementation so that JS arrays don't just "fall off the cliff" when they get over the size threshold. One possible idea is that you expand the storage if items are added close to the current end of the storage. Another possibility is using a more general sparse array implementation.
     22
     23* Lightweight type inference. A lot of operators take needless virtual calls and branches because they behave differently depending on whether the operands are strings or numbers, etc. A lot of this can be eliminated based on even the most basic knowledge of operand types, which can be inferred based on constants in the code and output types of operators.
     24
     25* Micro-optimize double --> JSImmediate and JSImmmediate --> int conversions.
     26
     27* Where possible, combine toPrimitive() conversion with later toString() / toNumber() call.