Re: Hex to NSString or NSData
Re: Hex to NSString or NSData
- Subject: Re: Hex to NSString or NSData
- From: Greg Guerin <email@hidden>
- Date: Sun, 10 May 2009 10:44:44 -0700
Gwynne Raskind wrote:
Can you suggest a means to account for the overhead?
The classic way is to measure the same loop calling a trivial
function. Report this as t(overhead) and subtract.
A trivial function has the same args and return type as the code-
under-test but does nothing. For aggressively optimizing compilers,
this may not work, as the compiler may recognize the triviality and
optimize away the entire function and calling loop. A simple way
around that, if it happens, is for the trivial function to return one
its args +1, or sum of two args.
This can all turn into a bit of a tail-chasing game, as you add
things so the compiler won't remove the code as non-essential, but
you then have to account for it as non-overhead in the reported
times. Things like this are one reason why benchmarking isn't as
simple as it may seem.
-- GG
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden