views:

72

answers:

2

My program uses around 20 jars (for a total size of about 30mb). For now, they are all added to the classpath for the released version, and all jars are deployed with the rest.

Would there be a performance impact if I was unpacking them and repacking them into one jar?

+3  A: 

No, but there would not be any advantages either.

Personally I think you should deploy the very same jars that you develop on, unless you have a good reason not to. Repackaging can lead to subtle issues, if the original jars were sealed, but for an experienced team who likes an occasional challenge these are easily handled.

Thorbjørn Ravn Andersen
+2  A: 

The most obvious impact is the number of file handles open which is sometimes an issue on linux. Though if running out of file handles is an issue, the number of jars is unlikely to the problem point.

As I understand the index file keeps things pretty close to constant time to find anything in the jar.

Unpacking them all into directories (or a single directory) might give you a little boost. It would be short lived, though, as once the class is in the perm gen space that's all that is needed. It would have a long lived benefit on any non-class files you may read from the classpath via getResource() calls.

David Blevins