• 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

Excessive use of import wildcards

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello folks,

currently I am involved in a complex Java project. For me this mean, fighting through a huge bunch of classes written by several programmers. The software itself lacks performance heavily.

Beside architectural problems I see excessive use of import wildcards like
instead of .

I know that this is far away from beeing good coding style but does it lead to reduced performance at runtime, too? Any ideas?

H.-Gerd
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All it does is potentially cause the compilation of the source to be a bit slower and/or take a bit more memory.
It doesn't affect runtime performance in the least.

And remember: whether it's good or bad coding style depends on personal preference.
I've seen conclusive arguments for using only wildcard imports, only specific class level imports, or any type of mix of the two according to whichever seemingly arbitrary rule.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jeroen is right. In fact, imports are just a convenience for the developer - they don't have any effect on the generated byte code at all. The byte code always only contains fully qualified class names.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic