Skip to main content

Posts

Showing posts from December, 2017

Final Project Part 01 - Final Summary

To end part 1 I will summarize what information I have gathered for part 2: I am optimizing clib, a package manager. After benchmarking, it is clear there is a significant time delay in some advanced calls of the SHA1 function, such as ones that call update many times. To optimize, I am going to add the -O3 flag and remove a loop condition (currently). Some other observations: This project is relatively small with no ./configure for other platforms. The Sha1 code is unique and does not conform to the simple sha1 algorithm such as on    Wikipedia . The documentation (i.e. README) is relatively vague at describing the dependancies. It suggests only syntax that implies installation and isn't clear at documenting development vs. published code.   I have learned alot getting to this point in part 1. Firstly, I learned that library files can only be linked by using sudo ldconfig and the files must be in usr/lib. Secondly, I learned how to alter an advanced Makefile's fla

Final Project Part 01 - Benchmarking and how to Optimize the Sha1 Function in clib

To benchmark the sha1test file I copied the flags from the standard make file of clib and placed it in the local dev makefile of sha1. It yielded the following results after I used clock to time the functions in each test: The revised timing code can be found here for personal testing. Now we can see the majority of the time is spent in Test 6, so we are going to apply our optimization and hopefully see a change in the speed of that test. The current cflags of the standard clib Makefile are as follows: -DCURL_STATICLIB -std=c99 -Ideps -Wall -Wno-unused-function -U__STRICT_ANSI__ $(shell deps/curl/bin/curl-config --cflags) I plan on adding the -O3 optimization here. The challenge will be to either ensure that this does not affect any other dependancy or I will have to make a special case in the Makefile for only the SHA1 function. I also plan to take out the if condition below in the sha1.c file and putting the if case in another loop.    This appears to be the only optimi

Final Project Part 01 - Making and Installing Dependancies for clib

To preface making clib I will first explain what it is. clib is a package manger, with the one major difference being it contains it's own dependancies and cannot be used to install anything else. The default clib repository is on git here . If you notice by default it has no hash or checksum function. To do this you must import it through clib. To make clib I used these steps: mkdir test cd test git clone https://github.com/clibs/clib.git make clib-install sha1 clib is now succesfully made and I have the sha1 function available to test. Inside the sha1 development repository here I notice it already had an extensive test file for function. I presumed getting this to work would be much easier than it actually was. The first thing to note, is the sha1 folder that gets pulled into the deps (dependancies folder) is much different than the development version. The published version has 3 files: package.json, sha1.c, and sha1.h. The development version has 7: .travis.yml, Makef

Final Project Part 01 - Finding an Open Source Package

The final project of this course has been split into 2 major parts, the first part is as follows: Find an open source software package with a hash or checksum function that compiles to machine code. Benchmark the performance on an AArch64 system. Identify how you plan to optimize the function.  It turns out that finding the open soure software package took much longer than expected. Typing in google some combination of "open source software with hash function" clearly produces nothing. These were the strategies I employed below to find my package:  Reverse search using Wikipedia. Start here at the list of hash functions. Pick one, look at the External links and References sections for an implementation that is open source.       2.  Install open source packages from the Free Software Directory here . Pick a package and use wget on our AArch64 system if applicable. grep -Ri for hash/checksum and see if it returned anything useful.       3.  Google search