Welcome!

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

Reply
Highlighted
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
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:

http://supportforums.blackberry.com/t5/Java-Development/VM-Byte-code-optimizations/m-p/450888

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