[Perf] fix slow scenario for x in y

dramatically speed up generating several thousand entries

before:
![screenshot 2014-09-22 21 07 27](https://cloud.githubusercontent.com/assets/1377/4366410/46e472da-42be-11e4-8c29-1fe2effec63e.png)

after:
![screenshot 2014-09-22 21 06 41](https://cloud.githubusercontent.com/assets/1377/4366413/4c7249c0-42be-11e4-9cd8-728839391e51.png)


(i don't think i trolled myself, but its possible, so someone else taking a look would be good)
@akre54 im unsure. It wouldn't be hard to carry a bitfield for each array that tracked if it was sparse or not, and put the correct guards in-place. Doesn't seem much different then other optimizations.

But lets see what they do.