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

E

erica.ramsey

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,
 
L

Lew

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.
 
R

Roedy Green

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
 
M

Mike Schilling

Roedy Green said:
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.
 
L

Lew

(e-mail address removed) 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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top