| Summary: | [tern] Provide progress when activating Tern content assist and improve worker load time | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Michael Rennie <Michael_Rennie> | ||||||
| Component: | JS Tools | Assignee: | Michael Rennie <Michael_Rennie> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | major | ||||||||
| Priority: | P1 | CC: | emoffatt, libingw, Silenio_Quarti | ||||||
| Version: | 8.0 | ||||||||
| Target Milestone: | 9.0 | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Michael Rennie
Created attachment 254485 [details]
Work in progress
Work in progress, displays a message while the promise is being resolved. Problem is that it seems the promise never completes, need further debugging. Also sets an error message when no proposals are returned (same look and feel as when no find results are found in editor).
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=511a1d6af8ffa42ff78009b285f968cd739b247d Fixed in master. Bumping the severity on this one, as something fishy is happening with worker communication. Steps: 1. open a js and immediately hit Ctrl+space 2. nothing happens (we now see progress, but it never resolves 3. have a breakpoint in ternWorkerCore#onmessage and repeat steps - notice the worker is not even getting the message asking for proposals. It seems that the request (postMessage) for proposals is not even making it to the worker / tern server, so we get a huge lag until you mash on Ctrl+space again. If, however, you wait a few seconds after the file opens and then hit Ctrl+space, assist is instantaneous. (In reply to Michael Rennie from comment #3) > It seems that the request (postMessage) for proposals is not even making it > to the worker / tern server, so we get a huge lag until you mash on > Ctrl+space again. If, however, you wait a few seconds after the file opens > and then hit Ctrl+space, assist is instantaneous. Took some tracings of the messages when the page first loads (without doing anything after load), and got: javascriptPlugin.js:120 start_server postmessage sent javascriptPlugin.js:142 js plugin main got: "server_ready" javascriptPlugin.js:219 js plugin prefs got: "server_ready" ternAssist.js:367 tern assist got: "server_ready" javascriptPlugin.js:142 js plugin main got: "installed_plugins" javascriptPlugin.js:219 js plugin prefs got: "installed_plugins" ternAssist.js:367 tern assist got: "installed_plugins" Reloading the page and immediately hitting Ctrl+space yields: javascriptPlugin.js:120 start_server postmessage sent javascriptPlugin.js:142 js plugin main got: "server_ready" javascriptPlugin.js:219 js plugin prefs got: "server_ready" ternAssist.js:367 tern assist got: "server_ready" javascriptPlugin.js:200 js plugin envs got: "server_ready" javascriptPlugin.js:142 js plugin main got: "installed_plugins" javascriptPlugin.js:219 js plugin prefs got: "installed_plugins" ternAssist.js:367 tern assist got: "installed_plugins" javascriptPlugin.js:200 js plugin envs got: "installed_plugins" So as we can see the assist request is not done at all (there is tracing in ternAssist to log 'assist post message sent'). Investigating. Created attachment 254524 [details] potential fix for worker loading Here is a patch that: 1. cuts down the worker loading time 2. ensures the progress completes (and dismisses) 3. allows content assist to be presented in the 1-3 second range in the 'first operation" scenario. As it turns out, the problem could be that requirejs is causing the delay, more details about it can be found: https://groups.google.com/forum/#!topic/requirejs/rHUlpdaSAXU https://github.com/jrburke/requirejs/issues/1220 https://groups.google.com/forum/#!topic/requirejs/YYu7DerPNOA where the underlying problem is that each dependency that the worker loads using requirejs results in a separate importScripts call - which all happen serially, and as one of the comments in a link above points out can actually be much slower in a worker than in a 'normal' page. +1 for 9.0 (In reply to Michael Rennie from comment #5) > where the underlying problem is that each dependency that the worker loads > using requirejs results in a separate importScripts call - which all happen > serially, and as one of the comments in a link above points out can actually > be much slower in a worker than in a 'normal' page. This is a problem at dev time since we load many separate js files, but it should not be an issue in the built code. Fixed in: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=cf2cc4d0e87a072497dfc2bae8b22fb52ae3a889 I opened bug 470500 to investigate speeding up loading (mentioned in comment #5) |