Direct answer

In a piglin or zombified-piglin farm, distinguish aggression/targeting work from portal spawning, XP orb accumulation and item pickup; optimize the measured part first.

How to check it

  1. Profile while the farm is fully active, not during setup. Record mob counts, XP orbs, dropped items and whether nearby players continuously trigger aggro.
  2. On portal-based designs, compare portal activity and downstream item collection separately. On ordinary piglin designs, focus on targeting/navigation and how mobs reach the killing area.
  3. Use /spark profiler start --timeout 300 where Paper includes spark. Compare the same AFK location and game conditions.

What to change

  1. Prevent long-lived mobs from accumulating and keep the farm collection line moving. A clogged kill chamber can turn a high-output farm into sustained entity tick load.
  2. Review XP merge and item merge separately; XP and dropped item settings do not work identically.
  3. Do not disable aggression or AI just to improve a profiler number if those mechanics are how the farm functions.

Software and version notes

Version and mechanics warning

The farm type matters: a gold farm based on zombified piglins has different behavior from a piglin bartering setup. State which one you tested.

Verify the result

Compare gold/item output and peak entity counts with MSPT over the same time interval. A faster server that drops half the farm output is a gameplay trade-off, not a free optimization.

References