Skip to content

Instantly share code, notes, and snippets.

@matzew
Created July 18, 2012 21:04
Show Gist options
  • Select an option

  • Save matzew/3138888 to your computer and use it in GitHub Desktop.

Select an option

Save matzew/3138888 to your computer and use it in GitHub Desktop.
NSMutableArray
NSMutableArray* ma = [[NSMutableArray alloc] init];
// about 0.015 seconds
for (int i = 0; i<10000; i++) {
[ma addObject:[NSString stringWithFormat:@"%@ %d", @"ABC", i]];
}
// really slow: takes more than 7 seconds.....
for (int i = 0; i<10000; i++) {
[ma removeObject:[NSString stringWithFormat:@"%@ %d", @"ABC", i]];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment