title: Basic Scala/JVM/Akka optimizations for performance on toy SAT solver
body: <p>I am working on a SAT solver using Akka and Scala, and right now it solves a problem that MiniSAT solves in 30 seconds in 6 minutes. So I guess there must be a lot of room for optimization.</p>
  
  <p>But I'm new to Scala, Akka and the JVM, and I bet there are simple and trivial optimizations that I can do -- tuning the JVM heap size, for example. Or maybe there are classes in Scala that I should just avoid.</p>
  
  <p>I would also like to know what tools can be used to profile Scala code line-by-line, or at least method-by-method so I can identify hotspots in the code besides just running hprof.</p>
  
  <p>Akka profiling tools would also be interesting to see as well.</p>
  
  <p>(Sorry for the open-endedness, but it is also useful and very easily searchable using search engines. It should show up on many searches for optimizing Akka on the JVM using Scala.)</p>
  
  <p>The code can be found at <a href="http://github.com/roehst/akka-sat" rel="nofollow">http://github.com/roehst/akka-sat</a>.</p>
  
  <p>Some quick implementation details &amp; notes:</p>
  
  <ul>
  <li>A big problem (SAT) is broken down into 1000 sub-problems</li>
  <li>Each problem is boolean formula represented in CNF as List[List[Int]]</li>
  <li>I use 10 workers with round-robin routing</li>
  <li>Operations on formulas are done with maps and filters over lists with some inlining</li>
  <li>Operations on formulas are defined on an Object, but can be called on formulas using an implicit class</li>
  </ul>