RESOLVED FIXED 140550
Web Inspector: Disable *Annotators on minified files that aren't pretty printed
https://bugs.webkit.org/show_bug.cgi?id=140550
Summary Web Inspector: Disable *Annotators on minified files that aren't pretty printed
Saam Barati
Reported 2015-01-16 11:34:13 PST
The performance of the BasicBlockAnnotator and the TypeTokenAnnotator on files with really long lines is awful. It's also not of much use viewing this profiling information when a minified file isn't pretty printed, so we should just disable the profilers when this happens.
Attachments
patch (11.09 KB, patch)
2015-01-22 13:53 PST, Saam Barati
timothy: review+
Archive of layout-test-results from ews102 for mac-mavericks (519.10 KB, application/zip)
2015-01-22 14:41 PST, Build Bot
no flags
Radar WebKit Bug Importer
Comment 1 2015-01-16 11:34:29 PST
Saam Barati
Comment 2 2015-01-22 13:53:00 PST
Build Bot
Comment 3 2015-01-22 14:41:16 PST
Comment on attachment 245160 [details] patch Attachment 245160 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/5927189312700416 New failing tests: http/tests/appcache/404-resource-with-slow-main-resource.php
Build Bot
Comment 4 2015-01-22 14:41:19 PST
Created attachment 245165 [details] Archive of layout-test-results from ews102 for mac-mavericks The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-mavericks Platform: Mac OS X 10.9.5
Timothy Hatcher
Comment 5 2015-01-23 07:07:59 PST
Comment on attachment 245160 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=245160&action=review > Source/WebInspectorUI/ChangeLog:20 > + When SourceCodeTextEditor speculates that a file is minified it > + sets a flag on itself that the Annotators will notice when pretty > + printing is disabled. If we think a file is minified, we will > + disable the Annotators when turning off pretty printing because > + the Annotators have bad performance while viewing truly minified > + files. > + > + Sometimes, though, a file won't be minified even though we speculate > + that it is. Even though we may speculate incorrectly, if Type > + Profiling is enabled while viewing a file that we speculate as > + minified in its minified form, we first require pretty printing > + the file before displaying the Annotators to prevent truly > + bad performance. Will the navigation bar item for type profiling be disabled when pretty printing is required? Or should clicking the type profiling item force pretty printing to be enabled as well?
Saam Barati
Comment 6 2015-01-23 11:08:37 PST
(In reply to comment #5) > Comment on attachment 245160 [details] > patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=245160&action=review > > > Source/WebInspectorUI/ChangeLog:20 > > + When SourceCodeTextEditor speculates that a file is minified it > > + sets a flag on itself that the Annotators will notice when pretty > > + printing is disabled. If we think a file is minified, we will > > + disable the Annotators when turning off pretty printing because > > + the Annotators have bad performance while viewing truly minified > > + files. > > + > > + Sometimes, though, a file won't be minified even though we speculate > > + that it is. Even though we may speculate incorrectly, if Type > > + Profiling is enabled while viewing a file that we speculate as > > + minified in its minified form, we first require pretty printing > > + the file before displaying the Annotators to prevent truly > > + bad performance. > > Will the navigation bar item for type profiling be disabled when pretty > printing is required? Or should clicking the type profiling item force > pretty printing to be enabled as well? Sorry, this ChangeLog entry isn't clear. I'll fix it up in the patch I commit. This patch enforces these two behaviors: 1. Always enforce a file to be pretty printed if we think it's minified while viewing type annotations. So, while viewing a minified file, if you press the type profiling button, the pretty printer will first reformat the file, then the type profiler will insert type annotations. 2. If the type profiler is enabled and we're viewing a pretty printed file that we think originally was minified, and the pretty printer is disabled via pressing the button, then the type profiler will also be disabled. Originally, I had just behavior 2 and not behavior 1, and allowed type annotations to be inserted on a minified file while viewing it in its minified form. This provided a bad user experience for both performance and visual reasons, which is the reason for creating behavior 1.
Saam Barati
Comment 7 2015-01-23 11:57:48 PST
Timothy Hatcher
Comment 8 2015-01-23 12:27:30 PST
Comment on attachment 245160 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=245160&action=review >>> Source/WebInspectorUI/ChangeLog:20 >>> + bad performance. >> >> Will the navigation bar item for type profiling be disabled when pretty printing is required? Or should clicking the type profiling item force pretty printing to be enabled as well? > > Sorry, this ChangeLog entry isn't clear. I'll fix it up in the patch I commit. > > This patch enforces these two behaviors: > 1. Always enforce a file to be pretty printed if we think it's minified while viewing type annotations. So, while viewing a minified file, if you press the type profiling button, the pretty printer will first reformat the file, then the type profiler will insert type annotations. > > 2. If the type profiler is enabled and we're viewing a pretty printed file that we think originally was minified, and the pretty printer is disabled via pressing the button, then the type profiler will also be disabled. > > Originally, I had just behavior 2 and not behavior 1, and allowed type annotations to be inserted on a minified file while viewing it in its minified form. This provided a bad user experience for both performance and visual reasons, which is the reason for creating behavior 1. Makes sense. Just wanted to make sure. That is exactly what I expect.
Note You need to log in before you can comment on or make changes to this bug.