Performance issue: jar vs. bin/classes

7

77Scorpio

I was wondering whether there is a performance difference between java
appications packed into jar files and java applications which are
spread as .class files
 
B

Brzezi

pon, 17 kwi 2006 o 10:56 GMT, 77Scorpio napisa³(a):
I was wondering whether there is a performance difference between java
appications packed into jar files and java applications which are
spread as .class files

what do u mean by "performance"?

starting program of course will be a little bit slower, coz jar it`s zip,
but files can be storede without compression, IMHO you can pass over this
problem

during runnig of program, there is no difference...

Pozdrawiam
Brzezi
 
M

Martin Gregorie

77Scorpio said:
I was wondering whether there is a performance difference between java
appications packed into jar files and java applications which are
spread as .class files

Compressed or uncompressed JAR files?

JAR files will reduce i/o overheads (only one file to open, less to read
if compressed).

A compressed JAR file will add to CPU loading (cycles used to decompress
classes)

Whether using a JAR file increases performance or not depends on both
i/o performance and CPU speed. If the application loaded over the 'net
(i.e. is an applet) then using a JAR file is usually recommended.
 
B

Brzezi

pon, 17 kwi 2006 o 13:49 GMT, Martin Gregorie napisa³(a):
JAR files will reduce i/o overheads (only one file to open, less to read
if compressed).

but even loading not compressed jar makes overheads, because loader must
interpret jar(zip) file, but that overheads are so small, so it can be omitted

Pozdrawiam
Brzezi
 
M

Martin Gregorie

Brzezi said:
pon, 17 kwi 2006 o 13:49 GMT, Martin Gregorie napisa³(a):


but even loading not compressed jar makes overheads, because loader must
interpret jar(zip) file, but that overheads are so small, so it can be omitted
Depends on your hardware and software. Both must be considered:

- If your CPU is fast but you're using an OS with slow i/o
(e.g. Windows 9x) the JAR file most likely be faster.

- If your CPU is slow (<300 MHz) but your OS has fast, multi-threaded
i/o (e.g Linux) the chances are that using a JAR file is slower.

- If you're reading the classes over a comms line then the JAR file
will almost always be faster.
 
R

Roedy Green

I was wondering whether there is a performance difference between java
appications packed into jar files and java applications which are
spread as .class files
jars are more compact for transmission. Class files don't need to be
decompressed.

Usually the jars are the way to go. Class files are just too messy and
hard to control. With a jar you know exactly what classes are being
used.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top