DEV Community

Joyce Wei
Joyce Wei

Posted on • Updated on

SPO600 Project Stage 1

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.

Image description

I will be using 500000000 samples to test the programs and the results in following screenshot are the time taken to scale the samples.

Image description

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

Image description

vol1.c

Image description

vol2.c

Image description

vol3.c

Image description

vol4.c

Image description

vol5.c

Image description

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?

Image description

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?

Image description

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?

Image description

This line is printing the result to the console.

Top comments (0)