Paul, what is the advantage of gybing before? Without spi it is generally a good idea to be quite close to the other boat if you are attacking as you get a header from the winds deviated by the defender. If you tack before there is more space between the boats.
million dollar question....
If you gybe before someone they have to sail past you by either going higher and faster or lower and (maybe) faster. Neither is easy.
BUT
most people will sail off on STBD after the windward mark and so when you gybe, you are gybing back into thier dirty air. But gybe too late and people will have gybed on top of you, again dirty air.
The trick is to spot a gap and gybe into free air.
In an ideal world, you round windward mark 200 yards ahead, sail on for 200 yds (so next boat is at the windward mark) and then gybe, hopefully at this point, you have enough time to drive downhill and have fairly clean air.
Down hill pressure and clean wind are the winners. Yes, a header also helps, but depending on the boat you sail, a couple more kts of wind is better than 5 degrees of header down wind.