<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Web Inspector: Make WebInspector.ConsoleMessageView faster"
   href="https://bugs.webkit.org/show_bug.cgi?id=152418#c4">Comment # 4</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Web Inspector: Make WebInspector.ConsoleMessageView faster"
   href="https://bugs.webkit.org/show_bug.cgi?id=152418">bug 152418</a>
              from <span class="vcard"><a class="email" href="mailto:nvasilyev&#64;apple.com" title="Nikita Vasilyev &lt;nvasilyev&#64;apple.com&gt;"> <span class="fn">Nikita Vasilyev</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=152418#c1">comment #1</a>)
<span class="quote">&gt; (In reply to <a href="show_bug.cgi?id=152418#c0">comment #0</a>)
&gt; &gt; Created <span class=""><a href="attachment.cgi?id=267609" name="attach_267609" title="[Image] Stacktrace in Timelines">attachment 267609</a> <a href="attachment.cgi?id=267609&amp;action=edit" title="[Image] Stacktrace in Timelines">[details]</a></span>
&gt; &gt; [Image] Stacktrace in Timelines
&gt; 
&gt; This timeline recording shows that _appendLocationLink takes 23.13ms
&gt; out of 23.43ms of ConsoleMessageView execution time. That's 98.7%!
&gt; 98.7% of ConsoleMessageView execution time spent on adding the source link.
&gt; 
&gt; I don't understand what happens in addEventListener selected on the image.
&gt; Timelines doesn't tell me why *adding* an event listener takes so long.</span >

Our addEventListener is O(n).

        for (var i = 0; i &lt; listeners.length; ++i) {
            if (listeners[i].listener === listener &amp;&amp; listeners[i].thisObject === thisObject)
                return;
        }

Put it in a loop and it's O(n^2)!</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>