J&J Snack Foods has booked a 24% jump in second-quarter earnings, boosted by a robust performance from both its retail and foodservice divisions.