Introduction
In this project we are benchmarking digital sound programs on both x86_64 and AArch64 systems.
There will be six programs (vol0.c to vol5.c) in total to be testing and they are just different approach to the same problem. Two of them will be specific to x86_64 system only.
Prediction
I am predicting the vol4.c program will have better performance because it is using SIMD optimization through inline assembly.
Benchmarking
The following are the results from each program. We can see that the programs don't produce the same output and there is a significant difference in vol3.c program.
I will be using 500000000 samples to test the programs and the results in following screenshot are the time taken to scale the samples.
According to the result, it takes approximately 1.5 seconds to scaling 500000000 sound samples using a x86_64 system. But when the results from AArch64 is much better than x86_64 even without SIMD optimization.
Memory Usage
vol0.c
vol1.c
vol2.c
vol3.c
vol4.c
vol5.c
Compiler Option
To increase the performance of the program, we can add compiler option -O2, -O3, -Ox via the Makefile.
Questions
Q: What does this next block do? Why?
The code block is checking if the system architecture is AArch64. If the system is AArch64 then compile vol0 to vol5. Otherwise, only compile vol0 to vol3 because vol4 and vol5 are specific to AArch64 architecture.
Q: Why is this needed?
We are accumulating the total data are processed in SAMPLES array in each programs, so we can compare the result.
Q: Why is this needed?
This line is printing the result to the console.
Top comments (0)