Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Using enum in eclipse
Using enum in eclipse [message #981857] Mon, 12 November 2012 18:59 Go to next message
lan zhang is currently offline lan zhangFriend
Messages: 3
Registered: November 2012
Junior Member
Hi, I have a big enum class(classA) which has more than 2000 constants. And
this been used in a big switch statement.

The project took 40 seconds to run on my eclipse, but it only took 10 second on netbeans. If I change the enum to integer, the problem will gone.

I would like to understand why switch enum on eclipse take this long time.


Any thoughts? Thanks a lot.
Re: Using enum in eclipse [message #982061 is a reply to message #981857] Mon, 12 November 2012 22:53 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
Is this by chance the same application as in https://bugs.eclipse.org/393934 ?

You could perhaps help by adding useful details to the bug. Statements like "eclipse is slow" don't help us identify the problem. We need an example and a description what exactly you measured.

cheers,
Stephan
Re: Using enum in eclipse [message #982258 is a reply to message #982061] Tue, 13 November 2012 02:35 Go to previous messageGo to next message
lan zhang is currently offline lan zhangFriend
Messages: 3
Registered: November 2012
Junior Member
Yes, she is one of my colleague.

Is there a method in Eclipse that I can specify the compiler to use? like javac?

The code is very big, but I can give you an example:

public Enum TempType(){
IDA,IDB,IDC...
}

TempType include more than 2300 enum items defined.

And in other class, there is the switch like:

public class TempTypeB(OtherType outerSwitch, TempType ttName){
switch(oterSwitch):
case aaa:
{
switch (ttName):
case IDA:
//do something;
break;
case IDB:
// do something
break;
...
}
...
}
}

The code is very straight forward, it is a double switch, the out side is other type, the inside is enum type. We try to understand why eclipse is much slower than netbeans.

Thanks.
Re: Using enum in eclipse [message #982767 is a reply to message #982258] Tue, 13 November 2012 12:03 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
For details please see bugzilla.

lan zhang wrote on Tue, 13 November 2012 03:35

Is there a method in Eclipse that I can specify the compiler to use? like javac?


In normal operation Eclipse uses its own compiler (ECJ).
In order to use javac you'd need to provide an ant build file and replace the Java Builder with a properly configured Ant Builder [1]

Quote:

We try to understand why eclipse is much slower than netbeans.


I don't think you mean what you wrote.

Most likely you want to say: code compiled by ECJ is slower than code compiled by javac, right??

However, the measurements I reported in the bug show the opposite: code compiled by ECJ is *faster* than code compiled by javac. As long as we don't see a problem we can't fix anything.

cheers,
Stephan

[1] http://help.eclipse.org/topic/org.eclipse.platform.doc.user/gettingStarted/qs-92_project_builders.htm&cp=0_1_2_1
Re: Using enum in eclipse [message #983603 is a reply to message #982767] Wed, 14 November 2012 02:48 Go to previous messageGo to next message
lan zhang is currently offline lan zhangFriend
Messages: 3
Registered: November 2012
Junior Member
I am not sure I should keep post here or may go to that bug report https://bugs.eclipse.org/bugs/show_bug.cgi?id=393934.

But thanks a lot to Stephan, it is really helped.

Now, I try to run javac to build the jar file. I attached my ant build xml file. I think the compiler runs, but it didn't build the jar file. I am new to this whole stuff, any help with the ant build?

Thanks.


Re: Using enum in eclipse [message #984061 is a reply to message #983603] Wed, 14 November 2012 11:14 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 14.11.2012 03:48, lan zhang wrote:
> I am not sure I should keep post here or may go to that bug report https://bugs.eclipse.org/bugs/show_bug.cgi?id=393934.
Please use bugzilla to discuss a bug.

Dani
>
> But thanks a lot to Stephan, it is really helped.
>
> Now, I try to run javac to build the jar file. I attached my ant build xml file. I think the compiler runs, but it didn't build the jar file. I am new to this whole stuff, any help with the ant build?
>
> Thanks.
>
>
>
Previous Topic:How to add text hovers for generic eclipse editor- generic text hover for all text editors
Next Topic:Common Navigator Framework pop up menu
Goto Forum:
  


Current Time: Thu Apr 25 12:20:34 GMT 2024

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

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

Back to the top