<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>150065</bug_id>
          
          <creation_ts>2015-10-12 17:20:39 -0700</creation_ts>
          <short_desc>REGRESSION: Web Inspector hangs for many seconds when trying to reload page</short_desc>
          <delta_ts>2015-10-14 20:54:29 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joseph Pecoraro">joepeck</reporter>
          <assigned_to name="Joseph Pecoraro">joepeck</assigned_to>
          <cc>bburg</cc>
    
    <cc>commit-queue</cc>
    
    <cc>ggaren</cc>
    
    <cc>graouts</cc>
    
    <cc>joepeck</cc>
    
    <cc>mark.lam</cc>
    
    <cc>mattbaker</cc>
    
    <cc>nvasilyev</cc>
    
    <cc>saam</cc>
    
    <cc>timothy</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1132593</commentid>
    <comment_count>0</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-10-12 17:20:39 -0700</bug_when>
    <thetext>* SUMMARY
Inspector hangs for many seconds when trying to reload page.

* STEPS TO REPRODUCE
1. Inspect cnn.com
2. Show Timeline tab
3. Reload
  =&gt; hangs for quite a while, may never show data

* NOTES
- Samples show lots of time spent under Inspector::ScriptDebugServer::sourceParsed (ContentSearchUtilities)
- Seems like this may have been exposed by these recent changes:
  - &lt;https://webkit.org/b/148347&gt; REGRESSION(r188792): broke lots of tests, ggaren is going to investigate and reland (Requested by thorton on #webkit).
  - &lt;https://webkit.org/b/148280&gt; Unify code paths for manually deleting all code

* RELATED:
- We could eliminate the inspector&apos;s regex searching by having the JS Parser parse SourceURL / SourceURLMapping comments. This information would also be beneficial for expiation messages in the engine itself (e.g. exceptions in eval code).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1132594</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-10-12 17:21:53 -0700</bug_when>
    <thetext>&lt;rdar://problem/23081124&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1132597</commentid>
    <comment_count>2</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-10-12 17:26:12 -0700</bug_when>
    <thetext>It sounds like each time a Debugger is attached to a JSGlobalObject it will send sourceParsed for each source provider. Seems like we could be getting duplicate messages then. Since on a Web Page the same Debugger is shared across all Frames / Isolated Worlds.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1132682</commentid>
    <comment_count>3</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-10-12 20:04:03 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; It sounds like each time a Debugger is attached to a JSGlobalObject it will
&gt; send sourceParsed for each source provider. Seems like we could be getting
&gt; duplicate messages then. Since on a Web Page the same Debugger is shared
&gt; across all Frames / Isolated Worlds.

Yes, in the case of Safari on OS X as many as 6 or more isolated worlds get debuggers attached when loading a page (Inspector, Reader, Autofill, Extensions). In the case of the debugger being attached to each of these the inspector was re-pushing all scripts seen so far each time. In general I think there are improvements to be made here, but reducing this to just once (the first time a Debugger is attached) brings this back to what looks like original performance.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1132684</commentid>
    <comment_count>4</comment_count>
      <attachid>262969</attachid>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-10-12 20:23:40 -0700</bug_when>
    <thetext>Created attachment 262969
[PATCH] Proposed Fix</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1132869</commentid>
    <comment_count>5</comment_count>
      <attachid>262969</attachid>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2015-10-13 12:37:27 -0700</bug_when>
    <thetext>Comment on attachment 262969
[PATCH] Proposed Fix

I suppose we can&apos;t test this because of the reloadPage issues in inspector tests?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1132951</commentid>
    <comment_count>6</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-10-13 16:10:05 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; Comment on attachment 262969 [details]
&gt; [PATCH] Proposed Fix
&gt; 
&gt; I suppose we can&apos;t test this because of the reloadPage issues in inspector
&gt; tests?

I treated this as a performance issue, so I didn&apos;t write a test for that.

But now that you mention it, I would be weary of testing for the reload page issues. It would be worth writing tests to ensure the frontend gets a list of all scripts when the inspector _opens_.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1133353</commentid>
    <comment_count>7</comment_count>
      <attachid>262969</attachid>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2015-10-14 19:45:08 -0700</bug_when>
    <thetext>Comment on attachment 262969
[PATCH] Proposed Fix

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1133366</commentid>
    <comment_count>8</comment_count>
      <attachid>262969</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2015-10-14 20:54:25 -0700</bug_when>
    <thetext>Comment on attachment 262969
[PATCH] Proposed Fix

Clearing flags on attachment: 262969

Committed r191081: &lt;http://trac.webkit.org/changeset/191081&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1133367</commentid>
    <comment_count>9</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2015-10-14 20:54:29 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>262969</attachid>
            <date>2015-10-12 20:23:40 -0700</date>
            <delta_ts>2015-10-14 20:54:25 -0700</delta_ts>
            <desc>[PATCH] Proposed Fix</desc>
            <filename>scripts.patch</filename>
            <type>text/plain</type>
            <size>2847</size>
            <attacher name="Joseph Pecoraro">joepeck</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cgYi9Tb3VyY2UvSmF2
YVNjcmlwdENvcmUvQ2hhbmdlTG9nCmluZGV4IDU5ZjgwZmQuLmIxYTc2OWUgMTAwNjQ0Ci0tLSBh
L1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL0phdmFTY3JpcHRD
b3JlL0NoYW5nZUxvZwpAQCAtMSw1ICsxLDIyIEBACiAyMDE1LTEwLTEyICBKb3NlcGggUGVjb3Jh
cm8gIDxwZWNvcmFyb0BhcHBsZS5jb20+CiAKKyAgICAgICAgUkVHUkVTU0lPTjogV2ViIEluc3Bl
Y3RvciBoYW5ncyBmb3IgbWFueSBzZWNvbmRzIHdoZW4gdHJ5aW5nIHRvIHJlbG9hZCBwYWdlCisg
ICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xNTAwNjUKKwor
ICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBXaGVuIGRlYnVn
Z2luZyBXZWIgUGFnZXMsIHRoZSBzYW1lIERlYnVnZ2VyIChQYWdlU2NyaXB0RGVidWdTZXJ2ZXIp
IGlzCisgICAgICAgIGF0dGFj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