M
Mike Cox
Hi. I recently ran a benchmark against two simple programs, one written in
Java and the other in C++. The both accomplish the same thing, outputting
"Hello World" on my screen. The C++ program took .5 seconds to complete on
my 400 Mhz PC while the Java program took 6.5 seconds.
I am running the SUSE 8.2 Linux distribution.
Why is Java that much slower than the C++ program? I read on Slashdot that
Java was almost as fast as C++. Here are my programs:
test.cpp
#include <iostream>
using namespace std;
int main()
{
cout<<"Hello World";
}
test.java
public class test
{
public static void main(String[] args)
{
System.out.println("Hello world");
}
}
The reason I ask is because I'm thinking of using Apache and Jakarta to do
some development. If Java cannot be speeded up, I will be forced to find
another alternative.
Java and the other in C++. The both accomplish the same thing, outputting
"Hello World" on my screen. The C++ program took .5 seconds to complete on
my 400 Mhz PC while the Java program took 6.5 seconds.
I am running the SUSE 8.2 Linux distribution.
Why is Java that much slower than the C++ program? I read on Slashdot that
Java was almost as fast as C++. Here are my programs:
test.cpp
#include <iostream>
using namespace std;
int main()
{
cout<<"Hello World";
}
test.java
public class test
{
public static void main(String[] args)
{
System.out.println("Hello world");
}
}
The reason I ask is because I'm thinking of using Apache and Jakarta to do
some development. If Java cannot be speeded up, I will be forced to find
another alternative.