Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » How to improve the performance of code generation using JDT
How to improve the performance of code generation using JDT [message #830318] Tue, 27 March 2012 13:24 Go to next message
hongyu liu is currently offline hongyu liuFriend
Messages: 6
Registered: March 2012
Junior Member
Hello Everyone,

Currently I am using JDT to generate Java Code from some neutral model. The performance is however very unconsiderable. I've found that during the generation, the GUI of eclipse pop-up frequently a progress window "User Operation is waiting". I thought it is because a potential "auto-build" is in the background, but after I turned off the feature, this phenomenon persists...

Anyone has some idea ?

Thanks in advance.
Re: How to improve the performance of code generation using JDT [message #830814 is a reply to message #830318] Wed, 28 March 2012 04:49 Go to previous messageGo to next message
Satyam Kandula is currently offline Satyam KandulaFriend
Messages: 444
Registered: July 2009
Senior Member
We will need more information in what you are doing and what exactly is taking lot of time before commenting. With limited understanding, I think you want to look at http://www.eclipse.org/articles/Article-Concurrency/jobs-api.html
Re: How to improve the performance of code generation using JDT [message #830944 is a reply to message #830814] Wed, 28 March 2012 08:56 Go to previous messageGo to next message
hongyu liu is currently offline hongyu liuFriend
Messages: 6
Registered: March 2012
Junior Member
Thanks for your concern.

In fact, the current approach is simply using UML to generate Java Code, according to some profiles and stereotypes. In order to guarantee the quality of code generated, and to simplify some complex syntax synthesis in some scenarios, JDT seems a nice API set.

The logic of code is simple:

1. create an ICompliationUnit with a given .java filename
2. create the correspondent IType using ICompliationUnit.createType()
2. for all properties in the given uml class, generate its Java field, using IType.createField()


According to my test, each time I use the createXXX() API in JDT, Eclipse will temporarily pop-up a window saying "user operation is waiting for the background...". I guess that some expensive operation unwanted like "refresh the workspace" or "reparse the AST" is being executed implicitly...

Any ideas ?
Re: How to improve the performance of code generation using JDT [message #831173 is a reply to message #830944] Wed, 28 March 2012 15:10 Go to previous message
Satyam Kandula is currently offline Satyam KandulaFriend
Messages: 444
Registered: July 2009
Senior Member
If there are many changes, ASTRewrite could be the right way. I don't know what could be slowing down in your case. You may want to profile to find out the slowdown causes.
Previous Topic:Move Java Resource API eclipse refactoring
Next Topic:n00b: prob building project for selenium in eclipse
Goto Forum:
  


Current Time: Sun Nov 23 18:58:09 GMT 2014

Powered by FUDForum. Page generated in 0.02415 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software