Onto the final chapter! (Project Stage 1)

In SPO600, the first project milestone typically requires you to optimize a particular piece of real world open-source code. However, Chris changed this milestone to be Lab 6.

In this lab, the idea is to gather benchmarks on 6 different volume scaling algorithms: vol0, vol1, vol2, vol3, vol4, vol5.

Each program uses a different technique to scale volume, so the results are meant to differ.

In order to notice a substantial difference, the sample size must first be increased from the default, 16. I raised this to 536,870,912, which is exactly 1.0 GB of samples (each sample is 2 bytes). The volume scaling factor is also set to 50%.

So let's dive right into the algorithms, developed by Chris (licensed under GPLv3).

Each algorithm has the following functions in common:

This sample sum acts as a check-sum that will be used to compare precision with other algorithms.

This line prints out that check-sum so the user may test with ease.


The reason why x needs to be cased to unint16_t is because the value can be negative, while index values of an array can't.

vol0

This is the simplest algorithm. It simply multiplies by the factor, which is quite slow but accurate.

This simple algorithm guarantees full precision.

 

vol1

This algorithm uses fixed-point volume scaling.

vol2

vol2 uses a volume scaling look-up table to precalculate values.

I expected this one to be faster than it actually turned out to be.

 

vol3

vol3 is actually a dummy function, used to determine time taken for all the overhead processes.

 

The point of this function is to gather true runtime data for all of the other algorithms, by subtracting vol3's time from others.

vol4

vol5

 

Run-time

Finally, we must subtract the real-time values from vol3's real-time values to get the actual runtime of each algorithm.

The data is shown below.

Comments

Popular posts from this blog

The Difference of SVE2 (Project Stage 3)

So I examined another open-source project... (Project Stage 2)

The World of Open Source! (Week 1 Lab)