Bug 146536 - Web Inspector: Aggregate profile call information on the backend to drastically reduce profile sizes
Summary: Web Inspector: Aggregate profile call information on the backend to drastical...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-07-01 17:19 PDT by Joseph Pecoraro
Modified: 2015-07-01 23:55 PDT (History)
10 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (16.68 KB, patch)
2015-07-01 17:30 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff
[PATCH] Proposed Fix (16.65 KB, patch)
2015-07-01 17:35 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2015-07-01 17:19:21 PDT
* SUMMARY
Aggregate profile call information on the backend to drastically reduce profile sizes.

* STEPS TO REPRODUCE
1. Open <https://www.apple.com/procurement/>
2. Open Inspector
3. On page, click "Responsible Supplier Management" link to navigate
  => WebKit crashes

* NOTES
- The backend builds a 500+MB string for profile data
- Namely because one function calls (1) trim 1.7 million times, (2) substring 1.7 million times, and (3) indexOf 0.8 million times
- The profile data includes a serialization for each of those individual calls, which is almost entirely unnecessary for the UI
Comment 1 Joseph Pecoraro 2015-07-01 17:19:28 PDT
<rdar://problem/20440953>
Comment 2 Joseph Pecoraro 2015-07-01 17:30:55 PDT
Created attachment 255976 [details]
[PATCH] Proposed Fix
Comment 3 WebKit Commit Bot 2015-07-01 17:32:06 PDT
Attachment 255976 [details] did not pass style-queue:


ERROR: Source/WebCore/ChangeLog:8:  You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
Total errors found: 1 in 9 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Joseph Pecoraro 2015-07-01 17:35:36 PDT
Created attachment 255977 [details]
[PATCH] Proposed Fix
Comment 5 Timothy Hatcher 2015-07-01 20:57:30 PDT
Comment on attachment 255977 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=255977&action=review

> Source/WebInspectorUI/UserInterface/Models/ProfileNode.js:173
> +        // COMPATIBILITY (iOS8): Profiles included per-call information and can be finely partitioned.

Might just want to synthesize callInfo in the future on the front end to avoid complexity.
Comment 6 WebKit Commit Bot 2015-07-01 21:47:42 PDT
Comment on attachment 255977 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 255977

Committed r186218: <http://trac.webkit.org/changeset/186218>
Comment 7 WebKit Commit Bot 2015-07-01 21:47:45 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Csaba Osztrogonác 2015-07-01 22:29:34 PDT
(In reply to comment #6)
> Comment on attachment 255977 [details]
> [PATCH] Proposed Fix
> 
> Clearing flags on attachment: 255977
> 
> Committed r186218: <http://trac.webkit.org/changeset/186218>

It broke the Apple Windows build.
Comment 9 Joseph Pecoraro 2015-07-01 23:50:10 PDT
(In reply to comment #8)
> (In reply to comment #6)
> > Comment on attachment 255977 [details]
> > [PATCH] Proposed Fix
> > 
> > Clearing flags on attachment: 255977
> > 
> > Committed r186218: <http://trac.webkit.org/changeset/186218>
> 
> It broke the Apple Windows build.

Thanks for the heads up. The bots show:

> c:\cygwin\home\buildbot\slave\win-debug\build\source\webcore\inspector\TimelineRecordFactory.cpp(212): error C2039: 'CPUProfileNodeAggregateCallInfo' : is not a member of 'Inspector::Protocol::Timeline' [C:\cygwin\home\buildbot\slave\win-debug\build\Source\WebCore\WebCore.vcxproj\WebCore.vcxproj]
> c:\cygwin\home\buildbot\slave\win-debug\build\source\webcore\inspector\TimelineRecordFactory.cpp(212): error C2065: 'CPUProfileNodeAggregateCallInfo' : undeclared identifier [C:\cygwin\home\buildbot\slave\win-debug\build\Source\WebCore\WebCore.vcxproj\WebCore.vcxproj]

Seems like Windows didn't update regenerate some files even though Timeline.json was modified? I'm going to try forcing a clean build on these bots.
Comment 10 Joseph Pecoraro 2015-07-01 23:52:32 PDT
And the other bot:

>   python: can't open file '/home/buildbot/slave/win-release/build/WebKitBuild/Release/include/private/JavaScriptCore/cssmin.py': [Errno 2] No such file or directory
>   make: *** No rule to make target '/home/buildbot/slave/win-release/build/WebKitBuild/Release/include/private/JavaScriptCore/JSInputs.json', needed by 'WebReplayInputs.h'.  Stop.
>   make: *** Waiting for unfinished jobs....
>   make: *** [XMLViewerCSS.h] Error 2
>   /home/buildbot/slave/win-release/build/Source/WebCore/DerivedSources.make:893: recipe for target 'XMLViewerCSS.h' failed
>   python /home/buildbot/slave/win-release/build/WebKitBuild/Release/include/private/JavaScriptCore/jsmin.py </home/buildbot/slave/win-release/build/Source/WebCore/inspector/CommandLineAPIModuleSource.js >> ./CommandLineAPIModuleSource.min.js
>   python: can't open file '/home/buildbot/slave/win-release/build/WebKitBuild/Release/include/private/JavaScriptCore/jsmin.py': [Errno 2] No such file or directory
>   /home/buildbot/slave/win-release/build/Source/WebCore/DerivedSources.make:904: recipe for target 'XMLViewerJS.h' failed


Seems like more issues with file generation. Not sure what is up there.
Comment 11 Joseph Pecoraro 2015-07-01 23:55:58 PDT
One of the bots recovered on their own:
https://build.webkit.org/builders/Apple%20Win%20Debug%20%28Build%29/builds/89286 Failed
https://build.webkit.org/builders/Apple%20Win%20Debug%20%28Build%29/builds/89287 Success

I still forced a clean build on the other bot (Win Release) to try and fix it up.