Original Post
I'm in the process of practicing for a competition by writing several complicated algorithms in java. Part of the goal is to minimize the total number of bytecode instructions that the JVM executes (and each round I'm allowed to use up to a limit between 1,000 and 10,000 bytecodes). My main focus is on writing the algorithms cleverly, but since at some points in my application I'm looping, I figure that even small unnecessary things will eat up lots of bytecodes if I'm not weary. Also it intrigues me. :) One thing I have kept in mind is that even if my algorithm when compiled into java bytecode might take up 50,000 bytecode instructions, but if a lot of it is branching etc, then I can still get away with not executing most of them. Any tips and pointers? I've never really thought about optimizing at bytecode level in Java (since the emphasis in Java seems to be that you DON"T want to be doing this level of optimization, but it's the nature of competition).