Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2007

Tip: Looking for answers? Try searching our database.

Optimizations - pruning [J2ME; but I think a java programmer can answer this question too]

Thread view: 
erica.ramsey@gmail.com - 10 Sep 2007 17:25 GMT
Hello, programmers.

I read an article about optimizations and the article stated that one
should NOT put source into a package well that was easy enough to do.
However, it also went on to suggest that one should remove third party
libraries from their packages rather than just dump it into the
project. How do I do this? I am using "kXml2" parser and I can't see
how to unjar it and remove it from it's package unless I get the
source code and do it manually. I did notice that when my source was
in a package Proguard automatically removed everything, but the midlet
class, from package but according to the article all elements of the
package need to be eliminated.

The reasoning behind this is that java generates a lot of overhead
when handling classes that are part of a package.

Any suggests on how to remove 3rd party libraries from their packages?

Thanks,
-------
JavaME (J2ME), Java, C & C# Developer
CV: http://docs.google.com/Doc?id=dt6fqcn_51dn8gds
Lew - 11 Sep 2007 01:11 GMT
> Hello, programmers.
>
> I read an article about optimizations and the article stated that one
> should NOT put source into a package well that was easy enough to do.

That is crazy talk.  J2ME is package-oriented just like the rest of Java.

> However, it also went on to suggest that one should remove third party
> libraries from their packages rather than just dump it into the

Now that's /really/ crazy talk.  Crazy, crazy, crazy.

> project. How do I do this?

Don't.

> I am using "kXml2" parser and I can't see
 > how to unjar it and remove it from it's [sic] package unless I get the
> source code and do it manually. I did notice that when my source was
> in a package Proguard automatically removed everything, but the midlet
> class, from package but according to the article all elements of the
> package need to be eliminated.

What is this article?  It sounds like bovine fecal matter.

> The reasoning behind this is that java generates a lot of overhead
> when handling classes that are part of a package.

That doesn't sound reasonable either.  AFAIK packages introduce no run-time
overhead.

> Any suggests on how to remove 3rd party libraries from their packages?

Don't.

Warning: I am not a J2ME guy.  However, even the briefest walk through Sun's
Tech Tips on J2ME, or any other explanatory material I've googled, shows the
use of packages.  Packages are fundamental to Java, and eliminating them would
break much.

You really need to let us know what this article is and who wrote it so we
know never to trust this author.

Signature

Lew

Roedy Green - 13 Sep 2007 01:58 GMT
>The reasoning behind this is that java generates a lot of overhead
>when handling classes that are part of a package.
>
>Any suggests on how to remove 3rd party libraries from their packages?

This makes no sense.  The name of a package has nothing to do with
efficiency.  Repackaging a zillion tiny jars into a smaller number
might help though, but everything still retains its original package
names.

To repackage you take the jar apart with jar.exe and rebuild with ant,
genjar and jar.exe, just as you would build from freshly compiled
code.

see http://mindprod.com/jgloss/ant.html
http://mindprod.com/jgloss/genjar.html
http://mindprod.com/jgloss/jarexe.html
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Mike Schilling - 13 Sep 2007 03:19 GMT
>>The reasoning behind this is that java generates a lot of overhead
>>when handling classes that are part of a package.
[quoted text clipped - 3 lines]
> This makes no sense.  The name of a package has nothing to do with
> efficiency.

I do know a group of developers who were considering shortening all of their
package and class names in order to reduce class file sizes and thereby
improve performance.  They were morons, of course.
Lew - 13 Sep 2007 03:43 GMT
erica.ramsey@gmail.com wrote,
> I read an article about optimizations and the article stated that one
> should NOT put source into a package well that was easy enough to do.

What article was that, and who wrote it?

Signature

Lew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.