aspose file tools*
The moose likes Performance and the fly likes Number of java files Vs Performance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "Number of java files Vs Performance" Watch "Number of java files Vs Performance" New topic
Author

Number of java files Vs Performance

thejaswini ramesh
Ranch Hand

Joined: Oct 19, 2005
Posts: 74
Hi All,

I am working with a Swing Application with around 5000 java files(already). There may be more with any new support we provide. I have been asked to try and reduce the number(like clubbling of wrapper classes or creating swing components directly on the renderer class rather than call a view panel from there).

My question is would that really help, because there would be some rework plus the classes would become less cohesive & tightly coupled. Isn't that against OO practice? Will reducing the number of files actually improve the performance in some way?

Thanks in advance!
Thejaswini.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16250
    
  21

Well, actually, the question seems to be about reducing the number of classes to be maintained, rather than just files in general, but here's my $.02 worth (or Rs0.85, if you prefer).

Reducing classes for the simple sake of reducing classes can be an issue. On the other hand, if there are lots of large, specialized classes, that's an issue too. My experience with the Amiga Exec taught me that if you do a really good job of architectural design, you can not only do more with less, you can do it more efficiently - only about 5 distinct classes comprised the core of the entire Amiga ROM Kernel. In fact, it's the only OS I've ever seen where doubly-linked lists were a fundamental OS service.

This isn't a job that can be done just by getting in and hacking around. You'll need to spend a lot of time mapping out functionality at a high and abstract level. Find commonalities and determine what their core capabilities are. Shift the system components from 1-off implementations to producers and consumers of common services, but walk the fine line between a bloated does-all-things-for-all-people and a minimalistic service that can't do the job. Subclass when necessary, but not gratuitously. Look long and hard at any class whose (generously-commented!) source code comes to more than about 1000 lines.

And, of course, we have one additional trick these days. There's a wealth of third-party classes available to Java programmers. Things like Jakarta Commons. Consider replacing custom system components with library components. While the total app class count may go up, someone else has gone to the trouble of designing them for maximum flexibility and performance, someone else has debugged them and taken responsibility for maintaining them, and someone else has written documentation. In other words, they're someone else's problem. And, since they're industry standards, new people coming in may have a shorter learning curve, since they may either already know them or at least there's more documentation on using them.


Customer surveys are for companies who didn't pay proper attention to begin with.
thejaswini ramesh
Ranch Hand

Joined: Oct 19, 2005
Posts: 74
Thanks Tim!
Your reply puts things in perspective
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Number of java files Vs Performance