-
-
Save slembcke/7569537 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
const NSUInteger testCount = 1000000; | |
{ | |
GLKMatrix4 m = M; // Initialized from a global to prevent constant folding when inlining. | |
CFAbsoluteTime t = CFAbsoluteTimeGetCurrent(); | |
for (NSUInteger i = 0; i < testCount; i++) { | |
m = GLKMatrix4Multiply(m, m); | |
} | |
NSLog(@"time GLKit: %f", CFAbsoluteTimeGetCurrent() - t); | |
M = m; // Need to save the value of m to avoid it being optimized away | |
} | |
{ | |
kmMat4 identity; | |
kmMat4Identity(&identity); | |
CFAbsoluteTime t = CFAbsoluteTimeGetCurrent(); | |
for (NSUInteger i = 0; i < testCount; i++) { | |
kmMat4Multiply(&identity, &identity, &identity); | |
} | |
NSLog(@"time kazmath: %f", CFAbsoluteTimeGetCurrent() - t); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment