The new way is really a new syntax around the old
[myNumber isEqualToNumber:[NSNumber numberWithInt:5]]
which requires an extra call of numberWithInt:
; essentially, we're comparing a solution with a single dispatch and zero allocations to a solution with two dispatches, and possibly an allocation/deallocation.
If you do this comparison outside a tight loop, it wouldn't matter. But if you do it in a really tight loop, perhaps while drawing something, you may see a slowndown. That's why I'd stay with the old method of
[myNumber integerValue] == 5