Bug 287967 - [navigation] Poor performance navigating java.util.regex.Pattern source code
Summary: [navigation] Poor performance navigating java.util.regex.Pattern source code
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7 M1   Edit
Assignee: Satyam Kandula CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo, performance
Depends on:
Blocks:
 
Reported: 2009-08-28 08:45 EDT by James Shaw CLA
Modified: 2010-08-04 07:20 EDT (History)
4 users (show)

See Also:


Attachments
Thread dump when opening editor (28.09 KB, text/plain)
2009-09-03 09:23 EDT, James Shaw CLA
no flags Details
Another thread dump opening editor (52.89 KB, text/plain)
2009-09-03 09:25 EDT, James Shaw CLA
no flags Details
Thread dump when opening outline popup (76.90 KB, text/plain)
2009-09-03 09:26 EDT, James Shaw CLA
no flags Details
Thread dump when filtering outline view (22.96 KB, text/plain)
2009-09-03 09:26 EDT, James Shaw CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description James Shaw CLA 2009-08-28 08:45:22 EDT
Build ID: I20090611-1540

Steps To Reproduce:
1. Open java.util.regex.Pattern in the Java editor, with JRE source attached
2. Use Ctrl-O and try to search for any class member


More information:
Opening the Outline view and using the search filter takes several seconds on every single keypress.  Admittedly this file is over 5000 lines long (in my JRE at least), but perhaps it would be a good one for eclipse's performance test suite?
Comment 1 Dani Megert CLA 2009-08-28 09:01:18 EDT
I just tried it on R3.5 and 3.6 M1 and I can't see any delay. Can you please try again using a plain Eclipse SDK and fresh workspace?
Comment 2 James Shaw CLA 2009-08-28 11:05:02 EDT
Just tried 3.6M1 (I20090806-1400), clean eclipse install and clean workspace.  It's about 6 seconds to open the Outline popup, and about 2 seconds on each keypress to filter

I'm running Sun jdk1.5.0_15, and the java source is attached from src.zip.  The machine has an Intel E6750 with 2GB RAM.
Comment 3 Dani Megert CLA 2009-08-31 08:21:22 EDT
>Just tried 3.6M1 (I20090806-1400)
Is this the plain SDK or some J2EE package?

Please create several stack dumps (see: http://wiki.eclipse.org/index.php/How_to_report_a_deadlock#Getting_a_stack_trace_on_Windows) while waiting and attach them here.
Comment 4 James Shaw CLA 2009-09-03 09:23:02 EDT
Created attachment 146385 [details]
Thread dump when opening editor
Comment 5 James Shaw CLA 2009-09-03 09:24:29 EDT
(In reply to comment #3)
> >Just tried 3.6M1 (I20090806-1400)
> Is this the plain SDK or some J2EE package?
It's the standard Java build that I downloaded from http://download.eclipse.org/eclipse/downloads/

> 
> Please create several stack dumps (see:
> http://wiki.eclipse.org/index.php/How_to_report_a_deadlock#Getting_a_stack_trace_on_Windows)
> while waiting and attach them here.
I've attached four files with a selection of thread dumps.  Hope that gives you the info you need.
Comment 6 James Shaw CLA 2009-09-03 09:25:03 EDT
Created attachment 146386 [details]
Another thread dump opening editor
Comment 7 James Shaw CLA 2009-09-03 09:26:24 EDT
Created attachment 146387 [details]
Thread dump when opening outline popup
Comment 8 James Shaw CLA 2009-09-03 09:26:45 EDT
Created attachment 146388 [details]
Thread dump when filtering outline view
Comment 9 Dani Megert CLA 2009-09-14 06:53:49 EDT
It looks like mapping the source, especially Util.getInputStreamAsCharArray is slow in your setup. Moving to JDT Core for further comments.
Comment 10 Olivier Thomann CLA 2010-01-05 09:34:33 EST
Are you using a network drive ?
Comment 11 James Shaw CLA 2010-01-05 13:21:54 EST
No, it's a local disk.
Comment 12 Olivier Thomann CLA 2010-01-19 20:45:03 EST
Satyam, could you please see what could be done there?
Comment 13 Satyam Kandula CLA 2010-03-05 01:26:19 EST
Shaw, 
I could not reproduce the slowness on my machine and I don't understand the slowdown either. The source is generally read and cached so that at  least the subsequent actions are at least fast. As, I understand from your comments, even subsequent actions also cause the slowdown. 

1. Hence if you could try running eclipse with debug options could help.
Here are the instructions to get the debug options: Create a file called .options in the eclipse folder with the following lines in it. 
######
org.eclipse.jdt.core/debug=true
org.eclipse.jdt.core/debug/buffermanager=true
org.eclipse.jdt.core/debug/javamodel/cache = true
org.eclipse.jdt.core/debug/javamodel = true
######
Then run eclipse as 
%eclipsec.exe -debug
Please give the output of the command. Please also attach the file .metadata/.log located in your workspace. 

2. There seems to be some improvements done by Sun in SingleByteDecoder http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6746334. This could potentially improve the performance. Could you try using any other JVM above 1.6 u12? 

3. BTW, What is the encoding of your project?
Comment 14 Satyam Kandula CLA 2010-07-13 04:09:30 EDT
Can you please respond to any of the questions in comment 13?
Comment 15 Satyam Kandula CLA 2010-07-26 07:52:30 EDT
If the problem is still there, please reopen this bug with the additional information requested in comment 13.
Comment 16 Jay Arthanareeswaran CLA 2010-08-04 07:20:45 EDT
Verified for 3.7M1 using build I20100802-1800.