Efficiency gains from Tops Holding Corp.'s acquisition of bankrupt fellow US retailer Penn Traffic has helped the company book a second-quarter profit and narrow half-year losses.