Instead of checking all rotations in known IDs for each new cube, first add all rotations of a new cube to a side list of known cubes. Then checking all new cubes that happen to be rotated is faster. Overall improvement is 25-30% for n={7,8,9,10}
whilst this is faster, for large n the process is actually memory limited, and this dramatically increases the amount of memory used, if you can make it a command line option however I will happily merge.
Instead of checking all rotations in known IDs for each new cube, first add all rotations of a new cube to a side list of known cubes. Then checking all new cubes that happen to be rotated is faster. Overall improvement is 25-30% for n={7,8,9,10}