The interesting thing is that .data() doesn't actually write to the DOM, it just stamps a uniq id on the element on first access, then stores all data in a hash. However ++@has_many_index does in fact read & write to the dom every time