Difference between revisions of "CSC231 Homework 10 Solution 2010"
Line 16: | Line 16: | ||
; * reorder instructions in order to avoid jumps | ; * reorder instructions in order to avoid jumps | ||
; * use in-line functions instead of real functions and save on stack use | ; * use in-line functions instead of real functions and save on stack use | ||
+ | ; | ||
+ | ; time ./findPrime (that's the original version) | ||
+ | ; 148933 | ||
+ | ; | ||
+ | ; real 0m4.203s | ||
+ | ; user 0m4.198s | ||
+ | ; sys 0m0.001s | ||
+ | ; | ||
+ | ; time ./findPrime2 (that's this version) | ||
+ | ; 148933 | ||
+ | ; | ||
+ | ; real 0m3.902s | ||
+ | ; user 0m3.899s | ||
+ | ; sys 0m0.002s | ||
+ | ; | ||
+ | ; We see roughly 0.3 seconds of improvement. | ||
; | ; | ||
; to assemble and run: | ; to assemble and run: |
Latest revision as of 10:56, 15 December 2010
--D. Thiebaut 05:29, 8 December 2010 (UTC)