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

Bug 343132

Summary: Perf: Server module initialization consumes too much cpu resources
Product: [WebTools] WTP Java EE Tools Reporter: Patric Rufflar <patric>
Component: jst.j2eeAssignee: Dimitar Giormov <dimitar.giormov>
Status: ASSIGNED --- QA Contact: Chuck Bridgham <cbridgha>
Severity: major    
Priority: P3 CC: ccc, stryker
Version: 3.2.3   
Target Milestone: Future   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
profiling results none

Description Patric Rufflar CLA 2011-04-18 06:57:25 EDT
Build Identifier: 3.2.3

Sometimes, a startup of the Eclipse which uses WTP takes more than 5 minutes.
When profiling the eclipse, one of the problems seems to be the server initialization subcode.

Please have a look at the profiling results (which contains the information of one Worker thread) to get more details.

As you can see,

org.eclipse.jst.j2ee.internal.archive.JavaEEArchiveUtilities.isEJBArchive
Is consuming a huge amount of cpu resources (we do not use any EJBs in our project)

Reproducible: Sometimes

Steps to Reproduce:
1. Use a fairly large jsp dynamic web project (jsps, tag libs, tag files, jsp fragments, many java classes)
2. restart eclipse
Comment 1 Patric Rufflar CLA 2011-04-18 06:58:37 EDT
Created attachment 193478 [details]
profiling results
Comment 2 Carl Anderson CLA 2011-04-18 18:22:19 EDT
Patric, I am not sure what we can do to improve here- the delay is simple- due to the fact that EJB 3.x modules do not need a deployment descriptor, we must check for annotated beans within the .jar file.  You can state that you do not have EJBs, but we have little choice but to check for any of those annotations.  (Although 6 minutes is quite a while... do you have a workspace with binary jar files with a lot of classes?)
Comment 3 Patric Rufflar CLA 2011-04-18 18:43:45 EDT
Carl,

thanks for commenting this.
If the amount of work of the EJB detection cannot be reduced - what about introducing some kind of project preference of disabling the scan?

BTW:
When/How often will the project be scanned for EJB beans?

Our project depends on several jar files with a total file size of about 45 MB.
Comment 4 Rob Stryker CLA 2011-05-12 00:53:46 EDT
Carl,

  What benefit does a user actually see from having their jar recognized as an EJB jar? I realize it is then treated as an EJB module, and published via its own call (publish takes IModule[], such as IModule[]{ear}, or IModule[]{ear, childEJB}),  but what other benefits does the user get from scanning for all the ejbs in a project? 

During publishing, if a jar is not recognized as a child module, it still gets published (assuming it's mapped in properly via assembly configuration) as a regular resource. 

Just trying to get a handle on what we would lose in this case if an option for a user to not scan for EJBs were added.
Comment 5 Carl Anderson CLA 2011-08-30 12:08:17 EDT
Assigning to Kaloyan for initial investigation - his team are the ones that are responsible for the EJB scanning.
Comment 6 Kaloyan Raev CLA 2011-09-13 10:33:13 EDT
Dimitar, could you take a look and tell us how much effort is to switch-off the EJB scanning and what functionality will be lost because of this?
Comment 7 Dimitar Giormov CLA 2012-08-31 11:02:52 EDT
re-target to 3.4.2
Comment 8 Chuck Bridgham CLA 2014-02-13 13:37:26 EST
Moving to future - please re-target as appropriate