site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Thursday, November 18, 2004, at 03:46 PM, Matt Watson wrote: static const char _lowerhexstr[] = "0123456789abcdef0x"; int main(void) { struct timeval mytimeval; char *result; int i; gettimeofday(&mytimeval, NULL); result = ctime((const time_t *)&mytimeval.tv_sec); printf("%s", result); { char buffer[64]; for (i = 0; i < (1<<27); i++) { gettimeofday(&mytimeval, NULL); result = ctime((const time_t *)&mytimeval.tv_sec); printf("%s", result); return 0; } Test 400Mhz G3 vs 400Mhz G4 with GCC 3.3 XCode and indexed run identical but value assign runs slower on G4 than indexing and value assign runs faster on G3 than indexing _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Even better would be a "recipe" to reproduce. Something like: char *strBuf = buffer, *strPtr; unsigned long val_ul; strPtr = &strBuf[64]; val_ul = -999999; // do *--strPtr = _lowerhexstr[(val_ul & 7)]; while ((val_ul >>= 3)); do *--strPtr = ((val_ul & 7) + 48); while ((val_ul >>= 3)); } } This email sent to site_archiver@lists.apple.com