Posts

Showing posts from December, 2018

Project Stage 3 - Optimization

     Finally the time has come for me to implement my plan for optimization and see if my theories hold true. As detailed in my plan I first looked at compiler flags to see if there could be any significant gains while still maintaining full functionality. My first step was to read through the Makefile to understand where I need to make my changes and test the timings. This proved to be somewhat of a challenge as the Makefile for ssdeep is very extensive with a variety of conditional checks and error handling. Having read through the first chunk of code I quickly realized that I was not equipped to fully understand what the Makefile was doing. I decided to then less the Makefile and search for "flags" which led me to a section of the Makefile that looked promising: CFLAGS = -g -O2 CPP = gcc -E CPPFLAGS = -I/usr/local/include CXX = g++ CXXCPP = g++ -E CXXDEPMODE = depmode=gcc3 CXXFLAGS = -g -O2      My first test is simply to kick the optimization up to -O3 to see if

Lab 5: Algorithm Selection

     For this lab I was tasked with comparing the performance of three different volume scaling algorithms under various conditions. Instead of true volume scaling this lab will create an array of 10 million integers which will then be scaled by 0.75 and stored in a new array. The three approaches for this are: - Multiply each value by a float of 0.75 - Pre-Calculate all possible values multiplied by the scaling factor (0.75) and run a look-up for each      value - Convert the scaling factor into an integer by multiplying it  binary number representing a fixed-point value 1 To isolate the scaling loop I will run each method once without scaling and then once again with the scaling loop included and take the difference as a representation of time spent on that algorithm. Method 1: Method 1 is the naive implementation that was provided to us initially in the lab. It simply runs through each value and multiplies it storing the new value in the output array. The slowdown he

Lab 4: Assembler

     When first starting this lab I was excited to dive in to assembler as it gives a granular understanding of all steps involved in processes that are taken for granted in higher level languages. So after reading through the basic instructions used in assembler I began on the task of writing a program that loops from 0 - 30 printing "Loop: X" with X being the current loop count.      I immediately realized the significant difference between assembler and every other language I have coded with before. Instead of simply declaring variables and doing calculations however I want and dumping the results to the screen, its important to line all of the data I want up before executing any command and this lab really highlights this process. So we know the end result is a printed string 30 times, step 1 of which is getting a string to print. I created a .data section to hold both my string and the length of that string. This is important because unlike in C I can't replace X w