Why is list.size()>0 slower than list.isEmpty() in Java? On other words why isEmpty() is preferable over size()>0?<
list.size()>0
list.isEmpty()
isEmpty()
size()>0
I'm sorry, but your benchmark is flawed. Take a look at Java theory and practice: Anatomy of a flawed microbenchmark for a general description on how to approach benchmarks.
Update: for a proper benchmark you should look into Japex.