They all calculate the number of elements. But,
if you already load all entries, sayUser.all
, then you should uselength
to avoid another db query
if you haven't anything loaded, use count
to make a count query on your db
if you don't want to bother with these considerations, use size
which will adapt
Rule of thumb is “always use
size
.”