[Webkit-unassigned] [Bug 152418] Web Inspector: Make WebInspector.ConsoleMessageView faster

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 17 23:56:18 PST 2015


--- Comment #4 from Nikita Vasilyev <nvasilyev at apple.com> ---
(In reply to comment #1)
> (In reply to comment #0)
> > Created attachment 267609 [details]
> > [Image] Stacktrace in Timelines
> This timeline recording shows that _appendLocationLink takes 23.13ms
> out of 23.43ms of ConsoleMessageView execution time. That's 98.7%!
> 98.7% of ConsoleMessageView execution time spent on adding the source link.
> I don't understand what happens in addEventListener selected on the image.
> Timelines doesn't tell me why *adding* an event listener takes so long.

Our addEventListener is O(n).

        for (var i = 0; i < listeners.length; ++i) {
            if (listeners[i].listener === listener && listeners[i].thisObject === thisObject)

Put it in a loop and it's O(n^2)!

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20151218/6f838fbe/attachment.html>

More information about the webkit-unassigned mailing list