Permalink
Browse files

add v8.perf.md

  • Loading branch information...
1 parent dd3c59e commit b65597d40fea79d1445b9c64e78036afbfd6bea3 @tj committed Jul 5, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 v8.perf.md
View
@@ -0,0 +1,15 @@
+
+# V8 Performance Tips
+
+ A collection of V8 performance tips from Lars Bak
+
+ - members used should be initialized in the constructor - in a consistent order
+ - avoid monkey-patching which changes the hidden class tree, thus cannot use the same optimized code
+ - 31 bit signed integers (SMIs) when possible for calculations
+ - 0-N contiguous element arrays
+ - pre-alloc small arrays
+ - dont pre-alloc large arrays, switches to hash-mode
+ - arrays of doubles can be unboxed
+ - intiialize arrays using array literals to avoid conversions, re-allocations etc
+ - use --trace-opt, --trace-bailout, --trace-deopt, --prof etc
+ - Google\ Chrome --js-flags "--trace-opt ..."

0 comments on commit b65597d

Please sign in to comment.