prime generator thousandfold performance increase