Group 10 S14
A simple program that tests the execution time between C and Assembly through implementations of the SAXPY function
Members:
Franciz Emmanuelle Angelo L. Esperanza
Charles Joseph V. Hinolan
- In Visual Studios, click on LBYARCH_MP2.sln
- If you want run to a preferred mode (Debug/Release x64)
- Select solution config and platform
- Build solution
- Start running
See testing_results.xlsx for the results of the 30 tries
2^20
C: 0.00473s
x86_64: 0.00227s
2^24
C: 0.04793s
x86_64: 0.02003s
2^28
C: 0.75133s
x86_64: 0.32147s
2^20
C: 0.00177s
x86_64: 0.0021s
2^24
C: 0.02187s
x86_64: 0.01993s
2^28
C: 0.3464s
x86_64: 0.2957s
In Debug Mode, the x86_64 kernel performs noticeably faster than the C kernel. This is because the assembly code operates closer to the hardware components, unlike high-level languages such as C which need to be compiled to turn the code into machine code. However, in Release Mode, the tests of vector size 2^20 show that the C kernel performed faster than the x86_64 kernel. This may be because Release Mode optimizes the C code and improves its run efficiency. The other test versions in Release Mode still show that the x86_64 kernel performed faster than the C kernel. Although, the gap between the average execution time of the two was noticeably smaller compared to the Debug Mode tests.