seniorObjective-C
What is the cost of excessive NSNumber boxing in performance-critical code?
Updated May 17, 2026
Short answer
NSNumber boxing introduces heap allocations and ARC overhead in tight loops.
Deep explanation
Each NSNumber creation allocates heap memory and triggers retain/release operations. In high-frequency loops, this leads to memory pressure and CPU overhead compared to primitive types.
Unlock with a Pro subscription to view this section.
View pricingReal-world example
No real-world example available yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProCommon mistakes
No common mistakes listed yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProFollow-up questions
No follow-up questions available yet.
Unlock with a Pro subscription to view this section.
Upgrade to Pro