New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 784678 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

Address pathological code completion performance in devtools console

Project Member Reported by ruththompson@google.com, Nov 14 2017

Issue description

Chrome Version       : 62.0.3202.75
OS Version: 
URLs (if applicable) :
Other browsers tested:
  Add OK or FAIL after other browsers where you have tested this issue:
     Safari 5:
  Firefox 4.x:
     IE 7/8/9:

What steps will reproduce the problem?
1. Run a web app with a large number (240000+) of global variables.
2. Use the javascript console to place a debugger in any method.
3. Attempt to type in the console.

What is the expected result?
Typing works


What happens instead of that?
The code completion tool attempts to match against all of the global variables and causes typing to hang for tens of seconds or minutes.


I know it sounds unreasonable to have so many global variables, but my team runs a very large app that is compiled in a way that results in this many global variables.  It is not always an option for us to run with uncompiled code.

If we could simply have an option to turn off code completion it would solve our issue.  


UserAgentString: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36



 

Comment 1 by woxxom@gmail.com, Nov 14 2017

While waiting for a permanent solution, you can disable it yourself:

1. undock devtools
2. invoke devtools-for-devtools by pressing Ctrl-Shift-I
3. run the following code:
   ObjectUI.JavaScriptAutocomplete.completionsForTextInCurrentContext = () => Promise.resolve([]);
4. close devtools-for-devtools

Notes:
* By default this will limit autocomplete to your own typed commands
  (may be also disabled via devtools -> settings -> console -> autocomplete from history).
* Naturally, this will work only until the main devtools is closed.
  You can patch resources.pak in the browser installation directory, though.
* after undocking was selected once you can quickly perform everything via keyboard:
  Ctrl-Shift-I, Ctrl-Shift-D, Ctrl ~ and other keys would helpful.
Cc: divya.pa...@techmahindra.com
Components: Platform>DevTools
Labels: Needs-Triage-M62 Needs-Feedback Triaged-ET
Thanks woxxom@ for the workaround.

ruththompson@: Could you please attach any sample app to test and confirm this also, please confirm if the workaround suggested above works for you.


@woxxom Thank you so much for that workaround, yes it works!

@divyapadigela, I'll see if I can throw an example together soon. I don't have time to do it this week.

Project Member

Comment 4 by sheriffbot@chromium.org, Nov 14 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "divya.padigela@techmahindra.com" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Owner: kozyatinskiy@chromium.org
Status: Assigned (was: Unconfirmed)
Cc: einbinder@chromium.org
Do we need to fetch only the viewport rows to support this use case?

Comment 7 by kozy@chromium.org, Nov 14 2017

Cc: -einbinder@chromium.org kozyatinskiy@chromium.org
Owner: einbinder@chromium.org

Comment 8 by woxxom@gmail.com, Nov 14 2017

FWIW, a simple repro:
1. open a new tab page
2. open devtools (Ctrl-Shift-I key)
3. paste and run the following code:
   for (var i = 0; i < 200e3; i++) window['var' + i] = true
4. type the following:
   var123

Expected: able to type without delays
Observed: several second delay after typing each letter depending on CPU speed
Just kidding, here is an example:

DebuggerExampleApp.html
911 bytes View Download
oh.  Yes, same as woxxom's repro.
Project Member

Comment 11 by bugdroid1@chromium.org, Dec 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d5ed67e13e9939c00aed1876e8701cb47101cf6f

commit d5ed67e13e9939c00aed1876e8701cb47101cf6f
Author: Joel Einbinder <einbinder@chromium.org>
Date: Tue Dec 19 01:53:13 2017

DevTools: Make console autocomplete faster

This introduces caching of autocompletions, small tweaks to increase
performance, and converts JavaScriptAutocomplete into a singleton
instead of a set of functions.

Bug:  784678 
Change-Id: Iacdcd9d3a884f0377266663cdeb3d8cce48d72d1
Reviewed-on: https://chromium-review.googlesource.com/770254
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524902}
[modify] https://crrev.com/d5ed67e13e9939c00aed1876e8701cb47101cf6f/third_party/WebKit/LayoutTests/http/tests/devtools/console-cd-completions.js
[modify] https://crrev.com/d5ed67e13e9939c00aed1876e8701cb47101cf6f/third_party/WebKit/LayoutTests/http/tests/devtools/console-completions.js
[modify] https://crrev.com/d5ed67e13e9939c00aed1876e8701cb47101cf6f/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger/debugger-completions-on-call-frame.js
[modify] https://crrev.com/d5ed67e13e9939c00aed1876e8701cb47101cf6f/third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js
[modify] https://crrev.com/d5ed67e13e9939c00aed1876e8701cb47101cf6f/third_party/WebKit/Source/devtools/front_end/object_ui/JavaScriptAutocomplete.js
[modify] https://crrev.com/d5ed67e13e9939c00aed1876e8701cb47101cf6f/third_party/WebKit/Source/devtools/front_end/object_ui/ObjectPropertiesSection.js

Comment 12 by alph@chromium.org, Feb 5 2018

Cc: kirish@google.com
Project Member

Comment 13 by bugdroid1@chromium.org, Feb 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e0c6ec427c2d94c785d1b4e6ac16bd4dbd1d6ad1

commit e0c6ec427c2d94c785d1b4e6ac16bd4dbd1d6ad1
Author: Joel Einbinder <einbinder@chromium.org>
Date: Mon Feb 12 22:42:10 2018

DevTools: Limit autocomplete items to 10000 per prototype

Bug:  784678 
Change-Id: If8d0eb1a6eb9488133917f3c275f64cd2405bd73
Reviewed-on: https://chromium-review.googlesource.com/914806
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536220}
[modify] https://crrev.com/e0c6ec427c2d94c785d1b4e6ac16bd4dbd1d6ad1/third_party/WebKit/Source/devtools/front_end/object_ui/JavaScriptAutocomplete.js

Labels: TE-Verified-66.0.3346.0 TE-Verified-M66
Verified this issue on Debian Rodete with chrome #66.0.3346.0 and observed fix is working as expected, didn't observe any lags with provided code in comment #8,#9. hence adding TE-Verified labels.

Attaching the screen-cast for reference.


784678.mp4
785 KB View Download
Labels: allpublic
There's nothing Google-specific here, so trying to make the bug public (since I see access is causing some confusion).
Status: Started (was: Assigned)
It looks like there's been some significant improvements here in Chrome 66.   ruththompson@ can you try Chrome beta and tell us what you think?
Sorry, scratch that - I've done what I should have done first and try the demo above myself, and it's still extremely laggy on a fast machine despite the 10,000 limit (which I assume was likely to make things a lot better).

einbinder@ any other ideas?  Is the 10,000 item limit actually working?  Does it need to be even lower?
I'm leaving this open until the patches hit stable, because we will only really know if things are fixed once developers are using the new autocomplete daily. But everything should be working in 66 (beta). 
Labels: M-66 Hotlist-Partner-GSuite
Summary: Address pathological code completion performance in devtools console (was: Request for option to turn off code completion in the javascript debugger)
This has been in stable for awhile now, should we call this bug fixed?  I've pinged GMail folks to ask again, but feel free to resolve Fixed regardless as long as we're not aware of remaining issues here.
Status: Fixed (was: Started)
GMail team says that they "verified that autocomplete is now working very well".  Let's call this fixed.

Sign in to add a comment