title: JQuery trigger event performance on document
body: <p>I'm building a publish/subscribe framework in jQuery and I'm wondering if there are performance penalties to triggering and listening to events on the document root?</p>
  
  <p>All articles I can find describe the penalty you obviously get for listening to events on the document level, but triggering them from a more specific element - listening for a "click" for example.</p>
  
  <p>My pseudo code:</p>
  
  <pre><code>$(document).on("myCustomEvent", function() {
      alert("Event triggered");
  });
  $(document).trigger("myCustomEvent");
  </code></pre>
  
  <p>My event does not have a fitting home in the DOM but I could always add a dummy element to trigger from/listen to if it's better, but would rather not. What do you think?</p>