[java] Byte code optimization
Hi guys,
I have a game done thats working on some platforms. On others it wont run because the bytecode is too large. So i need to re-work the code to reduce the bytecode.
I've been reading articles on it but still need more info.
Can any of you give me a few more tips?
Yes J2ME. I think it will take to take out vast chucks of code as my efforts so far havent yielded any joy on the phone.
Is it because there is too much code, or too much code+data ?
There are plenty of normal Java size optimisation methods - usually using some obfuscator such as Proguard, but also changing your source to make things more optimal.
Normally cutting size involves reducing the number of classes rather than just reducing the amount of code. Proguard I believe now inlines constants and removes unused classes, so you can put your constants in their own class, and that class will be removed entirely.
You should work out exactly why it doesn't work on specific platforms - does it load, does it run out of memory at runtime, or what?
Then try to address those specifically.
Mark
There are plenty of normal Java size optimisation methods - usually using some obfuscator such as Proguard, but also changing your source to make things more optimal.
Normally cutting size involves reducing the number of classes rather than just reducing the amount of code. Proguard I believe now inlines constants and removes unused classes, so you can put your constants in their own class, and that class will be removed entirely.
You should work out exactly why it doesn't work on specific platforms - does it load, does it run out of memory at runtime, or what?
Then try to address those specifically.
Mark
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement