I have a process that is taking longer than I think it should. When I run Instruments, it shows that the method I use to create a key for an NSDictionary
lookup is taking about 25% of the overall time. The end result is, if I can optimize this key generation, I could save several seconds. The string gets generated as follows:
[NSString stringWithFormat:@"%ld_%.0f_%.0f_%d%@", (long)zoomLevel, mapPoint.x, mapPoint.y, dataType, suffix];
I feel that parsing the format string is the pain point here, but I'm not sure how else to smash these variables together to create a key.
EDIT
I need to generate the exact same key when given the exact same inputs. So no UUID, timestamp, etc.