2 ms·
The problem with map/reduce/etc in ObjC is twofold: - Objective-C doesn't support generic value types for function arguments - Objective-C can't optimize away
by KerrAvon 3y ago
The problem with map/reduce/etc in ObjC is twofold:
- Objective-C doesn't support generic value types for function arguments
- Objective-C can't optimize away method calls and therefore value boxing
What that means in practice is that you can't write a generic version of map/reduce/etc without it being very slow even for things that should be very fast. If you want one that works efficiently for value types like integers, you must write a specialized version for each type.
(I have written and sometimes use for convenience ObjC map/reduce/etc implementations.)