Some timings, for fixed-sized hashtable No storage reclamation in robdd gcc 4.0.1 MacBook Pro 2.33GHz Intel Core 2 Duo, Memory: 2GB 667 MHz Mac OS X 10.5.8 Collected Nov 13, 2010 #define BDD_LIMIT (1<<20) #define BDD_HASHTABLE_SIZE (1<<18) #define APPLY_HASHTABLE_SIZE (1<<16) Order: 1. each col has a queen 2. col, row, up-diag, down-diag Size = 402480 -O0 2.412u 0.466s -O2 2.174u 0.464s -O2 4.206u 0.505s with manual memory management (free)! Order: 1. col, row, up-diag, down-diag 2. each col has a queen Size = 969470 -O2 10.512u 1.259s % valgrind ./nqueens ==3970== Memcheck, a memory error detector ==3970== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. ==3970== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info ==3970== Command: ./nqueens ==3970== Final bdd size: 402480 nodes 92 solutions ==3970== ==3970== HEAP SUMMARY: ==3970== in use at exit: 4,460 bytes in 9 blocks ==3970== total heap usage: 14,342,942 allocs, 14,342,933 frees, 672,995,784 bytes allocated ==3970== ==3970== LEAK SUMMARY: ==3970== definitely lost: 0 bytes in 0 blocks ==3970== indirectly lost: 0 bytes in 0 blocks ==3970== possibly lost: 0 bytes in 0 blocks ==3970== still reachable: 4,160 bytes in 2 blocks ==3970== suppressed: 300 bytes in 7 blocks ==3970== Rerun with --leak-check=full to see details of leaked memory ==3970== ==3970== For counts of detected and suppressed errors, rerun with: -v ==3970== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)