LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-16-2006, 03:25 PM   #1
axelfc
Member
 
Registered: Jan 2006
Distribution: ArchLinux
Posts: 175

Rep: Reputation: 34
Java speed - Windows vs Linux


I wrote a simple program in Java in order to test the speed of java in Windows and Linux. All that my program does is to run some loops some times. I used windows xp sp2 and fedora core 3 64bit with 64bit java. None of the systems had any other load while executing the program.

In windows the program finished in 1:36.73 and in Linux in 2:12.96. I didn't expect to see so big difference (36 seconds) especially because Linux was a 64bit system.

Does anyone know if execution of java is slower in Linux or this was just a coincidence for my program?

Here is the source code for anyone who has a dual boot system and would like to test it. Please let me know what the results were on your system. I have an amd 64bit 3400+ with512MB of RAM.

http://egnatia.ee.auth.gr/~adns/benchmark.java
 
Old 04-16-2006, 07:30 PM   #2
Penguin of Wonder
Senior Member
 
Registered: Sep 2005
Location: West Virginia
Distribution: Gentoo
Posts: 1,249

Rep: Reputation: 45
Are you running a 64 bit version of Windows?
Are you running a version of Java that takes advantage of your 64bit processor?
Have you tried running this on any other distro besides Fedora? Its not exactly known for its speed.

Those might explain the difference.
 
Old 04-16-2006, 07:36 PM   #3
axelfc
Member
 
Registered: Jan 2006
Distribution: ArchLinux
Posts: 175

Original Poster
Rep: Reputation: 34
I run 32bit Windows with 32bit jsdk and 64bit fc3 with 64bit jsdk. I wanted to test the speed in those two since i have to do some 'big runs' of java programs and therefore the fastest the best. I don't have any other distro installed to make a check. That's why i asked if someone else has a dual boot system with any distro to test it.

Last edited by axelfc; 04-16-2006 at 07:38 PM.
 
Old 04-16-2006, 07:41 PM   #4
Penguin of Wonder
Senior Member
 
Registered: Sep 2005
Location: West Virginia
Distribution: Gentoo
Posts: 1,249

Rep: Reputation: 45
It might just be the different compilers then. They don't all work alike.
 
Old 04-16-2006, 07:49 PM   #5
axelfc
Member
 
Registered: Jan 2006
Distribution: ArchLinux
Posts: 175

Original Poster
Rep: Reputation: 34
I didn't mention that i have downloaded from sun's site jsdk 1.5.0 for windows and 1.5.0_04 amd64 for Linux. I supposed that the one for Linux should be faster. I don't know if it has only to do with the difference in Linux-Windows system or if there is a problem with the 64bit version also.
 
Old 04-16-2006, 08:06 PM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Your benchmark source code is quite buggy, all the loops are reusing the same i variable so in fact only the innermost for loop is fully executed, all other are useless.
Even corrected, this program doesn't represent a real life Java application so any numbers you got will not really represent the JVMs performance.
 
Old 04-17-2006, 04:28 AM   #7
axelfc
Member
 
Registered: Jan 2006
Distribution: ArchLinux
Posts: 175

Original Poster
Rep: Reputation: 34
Oups you are right... The new code is here http://egnatia.ee.auth.gr/~adns/benchmark.java but i haven't tested it yet.

I know that this program doesn't represent a real life Java application. I just wanted a way to measure how fast the compiled code runs so i assumed that this was a simple way.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux Showing Low Processor Speed than windows vijay_sastry Linux - Hardware 2 03-21-2006 11:20 AM
Huge speed disparity between windows/linux (bad for linux) Errsta_Fonzarelli Linux - Networking 13 03-05-2006 03:42 PM
Using windows high speed to download linux update files? dadof5 Linux - General 3 01-30-2006 04:35 PM
Modem Speed - linux vs. windows, and how to optimise furryspider Linux - Networking 7 04-07-2005 02:43 PM
encoding speed difference linux and windows shanenin Linux - Software 6 08-09-2004 07:40 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration