So I wanted to benchmark some basic java functionality to add some imformation to this question: What is the gain from declaring a method as static.
I know writing b
Just one additional Note. I can only observe this strange behavior if I use long for r and is. If I convert them to int then I get these timings:
Static: 352 ms
Dynamic: 353 ms
Static: 348 ms
Dynamic: 349 ms
Static: 349 ms
Dynamic: 348 ms
Static: 349 ms
Dynamic: 344 ms
So one possible conclusion is to avoid long in those situations. At least with Linux/Amd64 Java7 where perfomance matters.