PDA

View Full Version : java being slow on linux?



safemode
11-11-2003, 01:09 PM
I'm not sure if this is indicitive of the linux client or not, but i'm noticing like 3 times slower performance on my linux machine compared to my windows one and the windows machine is only using a P4 1.7Ghz where as my linux box is an athlon tbird 1.13Ghz. I'd expect some lead but 3 times as fast is a bit much. I was wondering if perhaps gcc's java compiler could be tested on the source in order to see if it helps at all with the speed. The whole DHE server setup seems to be online in source, but not the client. Did i miss it in the description? Seems to be the genetic algorithm code, the classes to enable breaking up of pools and distributing and then the server that uses those classes and implements a dhe server.

safemode
11-11-2003, 06:35 PM
My bad. I didn't enable -server in the command line. This should be in the shell files distributed with the client. Increases speed 250% easily.

safemode
11-12-2003, 06:07 PM
ok, since moving to the server virtual machine, and picking and choosing which version of java was the fastest on both of my boxes. I have jumped to like second place for fastest team and really close if not the fastest island. Either nobody is doing DHE anymore or it's all being done on really slow boxes. My team has two members (both me) and it's second to sussex which has like hundreds and beats many with half a dozen or more. I personaly dont see how this is possible unless people aren't really running the client anymore or they're all still using the client java virtual machine.

Run your client with the -server parameter. If you use windows 9x, i've found the latest 1.3.x version of java to be the fastest, get the sdk so you can use the server jvm. In linux the latest 1.4.x is fastest, and you only need the jre, in linux it comes with the server jvm. Always, -server is fastest.

spaetz
11-13-2003, 02:59 AM
Thanks for the hint. I had never tried the server setting (on Linux this is), gave me a good speed boost. You are right this should probably be on by default.

Stephen_B
11-13-2003, 07:56 AM
This is news. I've been running all along in linux, mostly using java 1.4 but without the server option.

Right now I'm using the script:

cd /home/stephen/bin/distributed_ga
while [ t = t ]
do
nice -n 19 /opt/sun-jdk-1.4.2.02/bin/java -Djava.security.policy=java.policy -jar ITClient.jar 139.184.166.27 KingKong stephen_boulet -i 30 -c 60 <my email>
done

How are you modifying the script?

Stephen_B
11-13-2003, 08:13 AM
Wow! What a difference that made. Like watching the minute hand versus the second hand. I just whipped through 13 generations in one minute.

And I was #18 on the "most powerful" list before ...

Now I have to fight the temptation to watch the generations scroll by.

By the way, I'm running an Athlon 2700+.

Here's my startIsland script:

cd /home/stephen/bin/distributed_ga
while [ t = t ]
do
nice -n 19 /opt/sun-jdk-1.4.2.02/bin/java -Djava.security.policy=java.policy -server -jar ITClient.jar 139.184.166.27 KingKong stephen_boulet -i 30 -c 60 <my email>
done

By the way, I had to change "nice -19" to "nice -n 19". I wonder if it's because I'm using a very recent version of coreutils (sys-apps/coreutils-5.0.91).

safemode
11-13-2003, 08:51 AM
depending on the kernel, the nice level may be necessary to make things fair or not or depending on if you use that computer for something else, you may want to maket it run on a lower priority.. In the latest 2.6 pre kernels, running at no altered nice level, just at priority 0 like everything is else is perfectly fine and you should see very little if any performance loss in the rest of your programs.


hrm.. It's a shame that eventually i'll probably lose my spot among the fastest islands and fastest team ... but it's for the good of the project.

Stephen_B
11-13-2003, 09:55 AM
Originally posted by safemode
hrm.. It's a shame that eventually i'll probably lose my spot among the fastest islands and fastest team ... but it's for the good of the project.

Well I'm running bleeding edge but I haven't yet tried the 2.6 kernel series.

I'm not a member of a team at the moment; if you'd like I can join your team.

michaelgarvie
11-13-2003, 10:58 AM
For the last couple of days I've been trying out different GA parameters which would've made generations a lot easier to crunch.

Does the -server option make things faster now as well?

Stephen_B
11-13-2003, 11:22 AM
Yes. Using the server option I can see the generations increment. I counted 13 generations per minute on an Athlon 2700+ and java 1.4.2.

michaelgarvie
11-13-2003, 12:22 PM
With my Athlon/Linux 1.4.2 -server runs at 120% the speed of 1.3.

Are you getting a more dramatic difference?

michaelgarvie
11-13-2003, 12:40 PM
WOW:
http://java.sun.com/products/hotspot/docs/general/hs2.html

This is amazing. It downloads bytecode off the server. Runs it for a while. Works out that it spends 75% of its time in one loop (the gate refresh method) and dynamically compiles this to whatever platform its on!! Not only this, it works out which methods are actually final so it can inline them...

Thanks safemode for pointing this out. Has it been stable over there? I'll test it a few days here and then put it on the website.

spaetz
11-13-2003, 01:16 PM
I've been running it all day and AFAIK it is stable. I would estimate a 200% speed increase from rough clock wall timing.

TeraCap
11-13-2003, 05:17 PM
Thanks for the hint, too. :thumbs: :drums:

Before the -server options, i got a generation in 10 to 20 min.
Now in 2 min. It depends on how big the task is.

I use this om my xp and jave 1.4.2

start /low /b /wait java -Djava.security.policy=java.policy -server -jar ITClient.jar.zip 139.184.166.27 KingKong Echo -i 30 -c 60 <my email>

Then i can run chesbrain in below normal priority.

safemode
11-13-2003, 07:20 PM
Stephen ..sure if you want you can join. it's teamsafe if you cant find it.


-server is always _ALWAYS_ going to be faster for cpu bound tasks in java. On any version. 1.3 i've found to be the fastest in windows. In linux it's the latest 1.4. You can verify and mabye come up with different results but from my trials, 1.3 was faster in windows than 1.4.2 All with the -server option .. I also tested client too and it was always slower.


I haven't tried the dynamic recompile thing. Anyone who has tried it i'd like to hear how it performs. I haven't added any other arguments besides -server to my batch files. I should also note that my windows box runs a P4, so that may be a reason why 1.3 is faster for it or not. *shrugs* My linux box is an athlon 1.13Ghz. And with the server option it's currently second only to my friend who is running an Athlon 2700. Generations take anywhere from 10 seconds to complete to 3 minutes depending on the size and i guess the complexity.


-server is a safe option though. It's only available in the sdk in windows since for some reason their jre package isn't shipped with the server jvm. In linux it is, so no sdk is required.

safemode
11-13-2003, 07:27 PM
nevermind, i'm stupid. that dynamic compilation is a feature of the server jvm. Which is enabled by -server. I thought it was a separate thing altogether.

michaelgarvie
11-14-2003, 05:11 AM
A speed improvement of 200% is most likely because you're comparing it with last weeks run which was slower. A lot has changed since then. Please compare both JVMs with current runs.

prokaryote
11-14-2003, 06:35 AM
Well, I tried this for W2K SP5, AMD T-Bird 1.248 GHz and it seems to be about a 200% increase as well (went from 3min 50sec per generation to 1min 55sec per generation on the same circuit)!

What I did was the following:

Ran the uninstallisland.bat file (Since I had this set up as a service orginally).

Went to the control panel and removed the old versions of Java (JRE and SDK and Web Start).

Then I downloaded and installed JRE 1.4.2_01 and SDK1.4.2_01 from the sun site.

Then I copied the c:\j2sdk1.4.2_02\jre\bin\server folder to c:\program files\java\j2re1.4.2_02\bin.

Ran the islandNT.bat file without adding the "-server" edit for about 5-6 generations

Then I edited the islandNT.bat file to the following format:

:begin
start /low /b /wait java -Djava.security.policy=java.policy -server -jar ITClient.jar 139.184.166.27 KingKong Tick -i 30 -c 60 your@e-mail Free-DC
goto begin

Ran this edited batch file and saw about a 200% improvement in generation completion times.

Tried this as well on a W2K SP5, AMD T-bred 2.187 GHz machine and saw a similar resulting improvement.

I don't know how this compares to the service times, but we'll see in the overall numbers increases per machine.

prok

safemode
11-14-2003, 06:36 AM
that was against packets at the same time. I'm not saying now it's 200% faster. I'm saying then it was, and still is. What took 10 minutes takes 3-4 minutes. What took 3-4 minutes takes less than a minute ... etc. I'll get numbers this afternoon. unfortunately i have friday classes to goto.

prokaryote
11-16-2003, 06:05 PM
Over the last two days, my production rate has about doubled using the "-server" option within the islandNT.bat file.

Thanks for the tip safemode!

Are other people seeing this as well?

safemode
11-16-2003, 06:50 PM
no problem. I'd like to see the project move forward... perhaps look at circuits complex enough to be immediately useful instead of "too generic for direct use" like clock circuits for instance. That's why instead of hoarding my secret for as long as possible just to get a high score i shared it as soon as I verified it on two of my computers. Hopefully if teams like team-dc and sussex all use the server jvm we will have enough cpu power to start making these generic small circuits very easy, and larger circuits wont seem so impossible.