Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-, Z10 (STL100-3)-, Z30 (STA100-5)-, Passport (SQW100-1)-, PlayBook (16GB)-
My Carrier: Verizon

Re: Here is my small optimization guide.

Yes the compiler replaces compile time constants. The thing to remember is that the actual compiler is javac, rapc rearranges code and replaces bytecodes (especially if it is floating point as, I believe, LMcRae mentioned in an earlier topic). So stuff like variables not being removed or difference between a variable in a loop vs. outside the loop is javac, not rapc.


I would say to simply benchmark the individual functions with the different optimization techniques to see if you gain any actual speed in a real world app. I would also agree that Fixed32 is better then float, especially because of the (what seems like) constant floating point checks(?).


Just found his original post on bytecode:


---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.