Changes between Version 3 and Version 4 of JavaScript performance improvement ideas
- Timestamp:
- Oct 19, 2007, 9:39:39 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
JavaScript performance improvement ideas
v3 v4 21 21 * 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 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.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 24 25 * Micro-optimize double --> JSImmediate and JSImmmediate --> int conversions.25 * Micro-optimize double --> JSImmediate and JSImmmediate --> int conversions. 26 26 27 * Where possible, combine toPrimitive() conversion with later toString() / toNumber() call.27 * Where possible, combine toPrimitive() conversion with later toString() / toNumber() call.