There are two ways to quit a trigger:
Both work, one is measurably better than the other.
A Real World Example
We deployed a bundle I wrote (SSL Expiration) and watched it work.
There are two code fragments in the bundle that caught my eye:
(SSL.certificate === null) & exit();
(subjectsOfInterest.test(subject)) || exit();
We tweaked those lines to use
return() and ended up with this:
if ( ! SSL.certificate ) return;
if ( ! subjectsOfInterest.test(subject)) return;
Here are the results:
That inflection point at 16:03 is when we change from
That’s a drop from about 130,000 trigger cycles to about 100,000 trigger cycles.
That’s a 23% drop.
When you are seeing 40Gbps and decrypting 64,000 SSL handshakes per second, improvements like this matter.