Well but the team overall performed a lot better under Pirlo. 8 points more in the league is a big difference, Pirlo won the Mickey cup finals and his CL exit was a lot lot closer than Allegri's. Pirlo's Juve also scored a truckload more goals, which is smth I just enjoy seeing - Juventus scoring goals.
Max compared to Pirlo didnt have Ronaldo and Chiesa was injured for half a season, but he had a mostly fit Dybala, a Locatelli and Vlahovic for half a season. Id give the edge to Pirlo's squad, but its pretty close.