either a for loop with type checking verses a for loop without type check
//example 1a
for(var/i = 1 to turf.contents.len)
var/atom/a = turf.contents[i]
//since a turf can only contain atoms, we don't have to check type in this case
world << "[a.name] density value is [a.density]"
//example 2a
for(var/atom/a in turf)
//type checking goes here to insure we get an /atom
world << "[a.name] density value is [a.density]"
//and here's one more set of examples, in case
//that example was a bad example (if optimized anyways)
//example 1b
for(var/i = 1 to chest.contents.len)
var/obj/item/o = chest.contents[i]
//we know only /obj/items can be in a /chest
world << "[o.name] has [o.quantity] units in stack"
//example 2b
for(var/obj/item/o in chest)
//slower? because it has to type check every reference to make sure we get an /obj/item
world << "[o.name] has [o.quantity] units in stack"
So do we know which is faster? It seems to me anytime there are safe assumptions to be made, you can always do something a tiny bit quicker.