SPO lab 5 (Algorithm Selection in C)

This lab required us to implement two different methods to do the same process, to allow us to adjust the volume of a sequence of samples. This program would be implemented in C, and use the time.h library through the entire system.

 

 

Implementation One –

This implementation uses the time.h library.  This implementation does all the calculations and assignments in a for loop which would loop the defined “size” amount of times.

http://pastebin.com/f15LC456

Implementation Two –

The other method we use to do this process does the calculations outside of the for loop (data hosting) to improve the efficiency of the code. This way we reduce the number of multiplication calls. We also removed the implementation which prevented the complied from optimizing the loop & ensured that our second implementation would have better performance overall

http://pastebin.com/rYCFC6qL

Final Thought –

From further investigation, we discovered the AArch64 server was the one which benefited the most from the optimization. We discovered the -O3 GCC argument creates the most optimized executable. However on the X86_64 server default optimization   made only minor improvements      to the runtime of the program

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s