It's not an allocation but the fact that calling x.isEmpty is slower than x eq null, I think. One is a virtual method call, the other is just a pointer comparison. Also if you use null for empty you have one less class to deal with and reduce the potential for call sites to become megamorphic.