Performance Comparison

Here are the timings of solving the 12x12 NQueens problem on an Opteron 150 (2.4GHz, RedHat Enterprise Linux 3 in 32 bit mode, Sun JDK 1.5.0). This test simply does simple logic operations. It primarily tests the speed of node creation and BDD garbage collection. The command line I used to test was:

java -mx512m -Dbdd=package -jar javabdd-1.0b2.jar 12

Package Time Peak Memory Usage
buddy 41s 152mb
cudd 46s 171mb
cal 68s 251mb
java (-server) 53s 171mb
java (-client) 54s 152mb
jdd (-server) 50s 188mb
jdd (-client) 49s 169mb

As you can see, buddy seems to be the fastest of the native libraries. However, the Java version is not far behind in performance and the memory usage is comparable. jdd looks promising here but it currently has poor performance on other operations like relprod, which the simple NQueens benchmark doesn't test.

Don't make any assumptions from these results about the relative efficiency of C and Java. The Java source code is a direct translation of the C source code, and therefore there are many, many inefficiencies that would not be present if it had been implemented from scratch in Java. At best, you could use this information as an example of the type of performance you would see if you directly translate a performance library written in C into Java.