Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   How to compare the speed between a Java program and its originalFortran version program? (http://www.velocityreviews.com/forums/t499577-how-to-compare-the-speed-between-a-java-program-and-its-originalfortran-version-program.html)

www 04-10-2007 02:41 PM

How to compare the speed between a Java program and its originalFortran version program?
 
Hi,

I have translated an old Fortran program into Java program, line by
line. The Java program produces the identical results as Fortran one
does. But Java program does I/O involved with xml parsing a lot.

Now, my customer needs information regarding how slow or fast the Java
program is, compared to its original Fortran program. Can you provide me
some idea on how to get such information?

To complicate my question, I hope to ignore the I/O code in Java
program, only compare the heavy duty computation part. Because Java
program does a lot of xml parsing, very time consuming. Fortran program
does not. So it is unfair to include I/O portion, when compare the two
programs. Can you also give me some idea on how to do that?

Previously, I have posted my question in different description and many
people say that I need profiling. I use Eclipse and I know a little
about TPTP. I don't know TPTP can provide me such information. I thought
it provides the relative execution time of each block of code., like
some method takes 98% time and is obviously a bottleneck.

Thank you very much.

Oliver Wong 04-10-2007 03:30 PM

Re: How to compare the speed between a Java program and its original Fortran version program?
 

"www" <www@nospam.com> wrote in message
news:evg7n7$lr0$1@news.nems.noaa.gov...
> Hi,
>
> I have translated an old Fortran program into Java program, line by
> line. The Java program produces the identical results as Fortran one
> does. But Java program does I/O involved with xml parsing a lot.
>
> Now, my customer needs information regarding how slow or fast the Java
> program is, compared to its original Fortran program. Can you provide me
> some idea on how to get such information?
>
> To complicate my question, I hope to ignore the I/O code in Java
> program, only compare the heavy duty computation part. Because Java
> program does a lot of xml parsing, very time consuming. Fortran program
> does not. So it is unfair to include I/O portion, when compare the two
> programs. Can you also give me some idea on how to do that?


Are you interested in giving your customer an accurate description of
the performance of your Java app (in which case, you should probably
include the XML parsing time), or are you interested in giving figures
which demonstrate that the Java app is faster than the Fortran app (in
which case, you should find out what part of the Fortran program is the
slowest, compare that to the Java one, and handwave the rest of the
programs as irrelevant)?

- Oliver



Lew 04-11-2007 06:37 AM

Re: How to compare the speed between a Java program and its originalFortran version program?
 
Oliver Wong wrote:
> "www" <www@nospam.com> wrote in message
> news:evg7n7$lr0$1@news.nems.noaa.gov...
>> Hi,
>>
>> I have translated an old Fortran program into Java program, line by
>> line. The Java program produces the identical results as Fortran one
>> does. But Java program does I/O involved with xml parsing a lot.


The line-by-line production may not make the best use of
a) object-oriented design principles,
b) other Java idioms.

That could negatively impact performance, especially if the "identical
results" included copying any bugs.

Java also has multiple optimization options relating to hotspot compilation
and garbage collection. Realistic benchmarking would require simulating the
typical data load between the two versions. What is typical? That is
non-trivial, as is the game of simulating it.

Also, Java's architecture favors long-running processes within an established
JVM; JVM startup is a significant time eater.

A third contender should be a Java rework of the original algorithm rather
than the original code, or possibly a substitution of a better algorithm.

The problem here is to give the customer information that will actually
benefit them, and products that actually serve them. Coughing up a meager
translation of a FORTRAN program to Java, then running meaningless benchmarks
to try to figure out if you did anything useful is a huge disservice to your
customer.

Make sure the benchmarks measure something that has actual importance, and
make sure the work has real benefits to the customer.

--
Lew


All times are GMT. The time now is 12:43 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.