9x speedup in generating basis