Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 392240

Summary: [TERMINALS] performance: Opening a new terminal is very slow due to RXTX even if not choosing Serial
Product: [Tools] TCF Reporter: Martin Oberhuber <mober.at+eclipse>
Component: TargetAssignee: Project Inbox <tcf.tm-inbox>
Status: VERIFIED FIXED QA Contact: Uwe Stieber <uwe.st>
Severity: major    
Priority: P2    
Version: 1.0   
Target Milestone: 1.1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
te-trace-log.txt none

Description Martin Oberhuber CLA 2012-10-17 17:51:54 EDT
Build ID: TCF 1.0.1 on Eclipse 4.2.1 SDK (also observed in 1.1 2012-10-17 nightly)

1. Launch Eclipse SDK 4.2.1
2. Install Target Explorer from Juno or 
   http://download.eclipse.org/tools/tcf/builds/development/nightly
3. Restart, open "Terminals" view
4. Click the "New Console" button in Terminals View
   --> It takes 2-3 sec for new terminal properties dlg to come up.

The TM Legacy Terminal View, on the contrary, opens the dlg instantaneous.
With Target Explorer, opening a 2nd terminal tab instance it's slow again.
Comment 1 Martin Oberhuber CLA 2012-10-17 18:48:31 EDT
Same issue on Eclipse 3.8.1 -- its actually worse than I thought, 
I see 7-8 sec delay when clicking the "New Terminal" button.
This is not acceptable IMO.
Comment 2 Uwe Stieber CLA 2012-10-29 04:24:33 EDT
Cannot reproduce that delay. If you open the dialog for the first time, it takes around 1.2 sec until it is there. Subsequent invocations takes around 500 ms. For me that sounds acceptable.

I've added some tracing to the command handler. Please fetch the changes and activate the "trace/launchTerminalCommandHandler" slot (org.eclipse.tcf.te.ui.terminals plug-in).
Comment 3 Martin Oberhuber CLA 2012-10-29 12:24:10 EDT
Created attachment 222941 [details]
te-trace-log.txt

Thanks Uwe - attached is your trace log.

After quit & restart eclipse, previous terminal SSH sessions were connected immediately. Opening the settings dialog took approx 15 sec on the first attempt and approx 8 sec on the second attempt.

That's too slow IMO ... watching the trace-log being created, it seemed to me as if RXTX were the culprit. It's possible that its port scanning is slow trying to access some bluetooth devices. That would be RXTX bug 
http://bugzilla.qbang.org/show_bug.cgi?id=103

Question for Target Explorer is, could the "new connection" dialog defer initialization of connectors that are not shown anyways ? I can't see why RXTX has to be initialized when I'm only interested in SSH connections. The current behavior also seems to violate lazy loading. 

I remember that in the TM version of Terminal we did some tricks to list "Serial" in the dropdown when its extension was there but we disabled it when after initial selection it turned out that RXTX was not installed or unusable.

I confirmed with the TM version of Terminal that the settings dlg is fast when I choose SSH, but as soon as I enable the "Serial" in the dropdown, it takes 14 sec for the Serial properties page to be shown.
Comment 5 Martin Oberhuber CLA 2012-10-30 07:42:54 EDT
The "lazy dialog init" works fine for me - thanks !