Mitch Robertson

Greenhorn
+ Follow
since Mar 19, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mitch Robertson

Static methods do significantly increase performance on repetitive methods done millions of times.

For example in my application I'm writing, I use a static method on a helper class to warp a Bezier curve. It is a small method (3 lines), but if it weren't static (or final) i couldn't inline it with the -0 option on the javac compiler. If it weren't inlined, it is an extra byte-code instruction to go to the location in memory where that method exists. I think private methods are only inlined if using the -0 option on the javac compiler.

One thing I might add is that if a performance isn't the requirement then nice coding style is ALWAYS the best option. There is nothing worse than awful ugly code that has no need to be optimized to that level but was - just because some guy is trying to show off his overly complicated coding style.

I am trying to transform potentially millions of these curves a second for a rendering engine I'm writing so every little spec counts!

Mitch
[ March 19, 2008: Message edited by: Mitch Robertson ]
16 years ago