A ported gun has the cuts in the barrel before the muzzle. Since gas is vented through the ports before the bullet exits the barrel, the muzzle velocity of the bullet is reduced.
A compensated gun has the cuts in the compensator, after the muzzle. Since the bullet has already left the barrel, muzzle velocity is not affected.
In both cases the effect is most noticeable in guns with lots of oomph. Although a .45ACP will benefit modestly from porting or a compensator, a cartridge like 38 Super can be compensated or ported most effectively.