Currently $.for has some performance issues when handling primitives, especially if they could be found in the array multiple times. That should probably be addressed by adding a normalization step that maps primitives to wrapper objects, to get a non-primitive reference for caching purposes.