Performance optimization in subcircuit mining