3

I have a program that is about 300 times slower on a Java ME phone than on Java SE. Simple benchmarks show that manually inlining a method roughly doubles the phone's performance, and manually eliminating a common expression roughly doubles performance yet again. Clearly the Java ME implementation doesn't do any optimization.

Is there any compiler that takes Java source code and produces optimized Java bytecode (with method inlining, constant value propagation, common expression elimination, and other general optimizations)? Is there any other tools that optimize class files this way after compilation?

1 Answer 1

4

Bytecode obfuscators often provide that kind of feature.

The reason for this is that obfuscators are often used in limted environments like Java ME. This is not primarily for making the code harder to de-compile, but to reduce the size of the compiled class files and possibly speed up their execution.

Try ProGuard, which is free software and supports some optimizations.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.