|
-
June 30th, 2011, 08:59 AM
#5
 Originally Posted by SirDice
It might be because of the overhead though. The library needs to be loaded and initialized before it's used. The built-in function obviously doesn't.
See what happens if you execute both functions multiple times. I'm sure the times will converge more as the overhead of loading the library only happens once.
I actually tried this several times against strcasecmp thinking the same thing, but I didn't get the same results with the standard library as you'll see in the example I provided. I know the standard library is optimized in assembly, but the load time should still be a factor with the standard library as with my test library.
I repeated the tests several hundred times with and without debugging turned on as well as a myriad of different compiler options and even on a different linux platform seeing if I had a broken linker trying to trace this. The timing of my test library actually behaves as if debugging is turned on even though it isn't. I also did an strace and gprof to see if anything unusual showed up. Everything went as one would expect.
The timing difference is relatively small, usually on the order of 0.01 to 0.05 ms... I do need to post the code over as I noticed a few typos, but those have no baring on the load and run times of the library.
Thanks.
Similar Threads
-
By gore in forum Operating Systems
Replies: 83
Last Post: June 1st, 2017, 01:33 PM
-
By rider_royal in forum Newbie Security Questions
Replies: 25
Last Post: July 3rd, 2005, 10:43 AM
-
By pwaring in forum Other Tutorials Forum
Replies: 60
Last Post: October 22nd, 2004, 09:15 PM
-
By gore in forum Other Tutorials Forum
Replies: 6
Last Post: October 5th, 2004, 08:26 AM
-
By gore in forum Operating Systems
Replies: 3
Last Post: March 7th, 2004, 08:02 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|