Created
July 16, 2013 14:20
-
-
Save andrei512/6009166 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [APUtils benchmark:^{ | |
| for (int i = 0; i < 1000000; ++i) { | |
| self.testing = @(i); | |
| } | |
| } name:@"self.testing = @(i);"]; | |
| [APUtils benchmark:^{ | |
| for (int i = 0; i < 1000000; ++i) { | |
| [self setValue:@(i) forKey:@"testing"]; | |
| } | |
| } name:@"[self setValue:@(i) forKey:@\"testing\"];"]; | |
| [APUtils benchmark:^{ | |
| for (int i = 0; i < 1000000; ++i) { | |
| [self performSelector:@selector(setTesting:) withObject:@(i)]; | |
| } | |
| } name:@"[self performSelector:@selector(setTesting:) withObject:@(i)];"]; | |
| [APUtils benchmark:^{ | |
| for (int i = 0; i < 1000000; ++i) { | |
| [self performSelector:NSSelectorFromString(@"setTesting:") withObject:@(i)]; | |
| } | |
| } name:@"[self performSelector:NSSelectorFromString(@\"setTesting:\") withObject:@(i)];"]; | |
| [APUtils benchmark:^{ | |
| SEL selector = NSSelectorFromString(@"setTesting:"); | |
| for (int i = 0; i < 1000000; ++i) { | |
| [self performSelector:selector withObject:@(i)]; | |
| } | |
| } name:@"[self performSelector:selector withObject:@(i)];"]; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment