aspose file tools*
The moose likes Performance and the fly likes Class path matters? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "Class path matters?" Watch "Class path matters?" New topic
Author

Class path matters?

Manjunath Hampanur
Greenhorn

Joined: Apr 05, 2006
Posts: 2
if there are some paths which are invalid or it contains some jar files which are never used, will the performance during compilation and run time execution matters?

I have two similar Systems with different CLASSPATHs. They are taking different execution times for executing same program. This is consistently observed.

Is there any other factor which affects like this?

Thanks
Manjunath


Manjunath H S<br />ASE-T
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
It seems reasonable that the number and order of items on the classpath could affect compiler execution time and application execution time, during the early stages where lots of classes are being loaded. How big that effect would be, I don't know and do not have time to experiment. Once most classes are loaded, its effect would be greatly reduced, tending towards zero.


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Ashwath Rangan
Greenhorn

Joined: Jan 30, 2007
Posts: 6
Say there is a class A which is imported into B each time you compile B it would automatically compile A. And if we do not use A anywhere then its a waste of execution cycles.
But i am not sure abt the part of adding jars to class path. I guess it would not make a difference. May be i am wrong.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8713
    
    6

Originally posted by Fire Bird:
Say there is a class A which is imported into B each time you compile B it would automatically compile A. And if we do not use A anywhere then its a waste of execution cycles.


Have a look at the javac documentation:

A successful type search may produce a class file, a source file, or both. Here is how javac handles each situation:

* Search produces a class file but no source file: javac uses the class file.

* Search produces a source file but no class file: javac compiles the source file and uses the resulting class file.

* Search produces both a source file and a class file: javac determines whether the class file is out of date. If the class file is out of date, javac recompiles the source file and uses the updated class file. Otherwise, javac just uses the class file.

javac considers a class file out of date only if it is older than the source file.


so A only gets compiled if it is out of date.
By the way Fire Bird, we have a naming policy you must have missed. In short, your displayed name must be a real-sounding first and last name. You can change your displayed name here.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Class path matters?
 
Similar Threads
Duplicate Method Compiler Error
Command Line Argument - Mode Flag
Better Faster Lighter Java by Bruce A. Tate, Justin Gehtland
Which Query is faster
And, has any one every had a no compete