In my cases I found that shielding map iterator with a simple length check gave me a huge bump in performance on c++ target:
//manually track this - not ideal but better than slower code
if(items_length > 0) {
for(thing in items) ..
}
It seems it could do this implicitly - and potentially not allocate an iterator at all (if possible) if it's empty;
At the time (while testing hxscout) I noticed that the only GC activity that I can see in my framework came from maps iterating over nothing.
I hadn't checked it after that, as Hugh was busy working on maps on git already for performance,
But I hope there's something we can do about that for subsequent updates, let me know what to do to help.