Speed improvement of amp_test