• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

does packaging impact on performance?

 
Ranch Hand
Posts: 102
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Just a basic question about package, except modularity(making beautiful code) and security is there any impact of packaging on performace?
I mean in terms loading class etc whatever way is there any impact on performance interms of cpu consumtion,memory / byte code size(i mean number of instruction statements of class),total execution time of code?


Reagrds,
Alim
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Packaging?

I assume you aren't asking about whether it makes a difference whether you put shrink-wrap plastic around the CD which the product is distributed on. But what are you asking about?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Code should be placed in packages for ease of maintenance and documentation.

For fun, do a google search for "premature optimization is the root of all evil"

Bill
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Considering that a typical java app these days may end up referencing resources from a thousand different classes in dozens of different packages and that the entire core packageset is organized by function, not by frequency of use, it really wouldn't make sense for most classloaders to parse out package names and look up classes on that basis. More so when you realize that entries in a ZIP (JAR) file aren't actually physically organized by "directory", just stored with the item's pathname + attributes + contents.

So in short, I think you'll find most classloaders simple use the fully-qualfied classname (package+class) as a hash key, making the actual package name completely immaterial as far as retrieval speed goes.

But, in any event, listen to what Bill says. It can be a real bugger to macro-optimize a system that has been prematurely micro-optimized.
 
Alim Atar
Ranch Hand
Posts: 102
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks lot for your answers, i aggree with you Tim.
I know it was littile bit silly question but i asked more over curiosity point of view.
In fact i verfied it with javap utility and found that it uses fully-qualfied classname and number of instruction statements are same with and without package.



Tim Holloway wrote:Considering that a typical java app these days may end up referencing resources from a thousand different classes in dozens of different packages and that the entire core packageset is organized by function, not by frequency of use, it really wouldn't make sense for most classloaders to parse out package names and look up classes on that basis. More so when you realize that entries in a ZIP (JAR) file aren't actually physically organized by "directory", just stored with the item's pathname + attributes + contents.

So in short, I think you'll find most classloaders simple use the fully-qualfied classname (package+class) as a hash key, making the actual package name completely immaterial as far as retrieval speed goes.

But, in any event, listen to what Bill says. It can be a real bugger to macro-optimize a system that has been prematurely micro-optimized.

 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good work checking the actual operation AND reporting it back to the forum. Now this thread will be useful in the future (if and only if the user thinks to do a search first)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic