Skip to content

Instantly share code, notes, and snippets.

@SiarheiFedartsou
Created November 20, 2013 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save SiarheiFedartsou/7568295 to your computer and use it in GitHub Desktop.
Save SiarheiFedartsou/7568295 to your computer and use it in GitHub Desktop.
const NSUInteger testCount = 1000000;
{
CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
GLKMatrixStackRef stack = GLKMatrixStackCreate(NULL);
GLKMatrixStackLoadMatrix4(stack, GLKMatrix4Identity);
for (NSUInteger i = 0; i < testCount; i++) {
GLKMatrixStackPush(stack);
GLKMatrixStackMultiplyMatrix4(stack, GLKMatrix4Identity);
GLKMatrixStackPop(stack);
}
NSLog(@"time GLKit: %f", CFAbsoluteTimeGetCurrent() - t);
}
{
kmMat4 identity;
kmMat4Identity(&identity);
CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
kmGLLoadIdentity();
for (NSUInteger i = 0; i < testCount; i++) {
kmGLPushMatrix();
kmGLMultMatrix(&identity);
kmGLPopMatrix();
}
NSLog(@"time kazmath: %f", CFAbsoluteTimeGetCurrent() - t);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment