For this lab, we are designing two different approaches to simulate the process of adjusting the volume of a sequence of sound samples in the C language.
Two primary approaches that I used were basic multiplication and bit shifting.
On Betty, with -O3
optimization option, we achieve a faster time on both approaches. Bit shifting has a faster time than multiplication, I even tried division and it is very close to the time of bit shifting surprisingly. Without any optimization, the time is the same as having -O0
.
On Xerxes, both approaches had very similar time, although bit shifting still has a slightly faster time. Division was no different than multiplication.
Overall, Betty still requires the user to optimize the code in order to have fast runtime as any optimization I added always makes a different. Xerxes is smart enough to optimize anything that is simple enough to figure it out on its own, since simple optimizations didn’t produce any different.