Comment #5 on issue 2275 by [email protected]: Disappointingly bad switch performance on V8
http://code.google.com/p/v8/issues/detail?id=2275

Below change can improve about 150% switch kernel performace . But I'm not sure how the limitation is decided. There should be lots of tradeoff about memory consumption, compilation overhead and optimization benefit.

diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 7d0e228..b7aa144 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -3898,7 +3898,7 @@ void HGraphBuilder::VisitSwitchStatement(SwitchStatement* stmt) {
   ASSERT(current_block()->HasPredecessor());
   // We only optimize switch statements with smi-literal smi comparisons,
   // with a bounded number of clauses.
-  const int kCaseClauseLimit = 128;
+  const int kCaseClauseLimit = 512;
   ZoneList<CaseClause*>* clauses = stmt->cases();
   int clause_count = clauses->length();
   if (clause_count > kCaseClauseLimit) {


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to