Posts

Introduction

Hello to anyone reading this, My name is Dennis Yick Ming Lam and I am a student of the Seneca College in the CPA program, currently running through the SPO600 class which stands for Software Portability and Optimization. Even though my choices of courses for this semester was limited, none the less I am still very excited to see what I can learn from this class. This class uses Blogging as the main source of submission, and since I have never Blog before this class, this is a very new and exciting way to begin. For those who would comment on my future posts, thank you for spending time reading mine and please go easy on me.

Course Project stage 3 part 2: Last post

Image
Well, as the end of the course and semester approaches, so does my last blog for SPO600. Last post I dive into the method, "bt_find_func" and identified "cmp" that take most resources. "cmp w22, #0x0" is used to check for zero in register. I originally wanted to find a way to improve "cmp", dead end there. Then I change my approach and look into the line before "cmp" which is the "if" statement "(depth-- == 0 || delta >= cyclic_size)", also dead end there. At this point I know I lack the knowledge to successfully optimize "xz Utils", but I must continue research. (After 1 day...) I try to understand some of the professor's lectures about stage 3, also I read some of previous student's post in hoping those can help me understand but I am stuck........ Unfortunately, what I have so far is my limit. Maybe in the future I'll learn how to successfully optimize xz Utils, but for

Course Project stage 3: introduction

Image
Finally entering the last stage of course project. Previously in my last blog, I have collected profiling data from xz utils using gprof and perf in linux on both Aarchie and Xerxes. For this last stage I will be using the perf data, because perf comes with the function of annotating an identified function that uses the most resource. From my understanding, stage 3 requires to dive into resource heavy function/method, identify which line(s) take the most resource, and plan a way to optimize it. Using "perf" on xz Utils. From the results, "bt_find_func" seems to be the resource heavy method. Then as I dive deeper into the function. It seems the "cmp" line is the command that uses the most resource in the application. My goal is to find a way to improve the "cmp" in "bt_find_func" function, to achieve my goal of optimizing xz Utils.

Course Project Stage 2 part 3: Profiling

Image
Over the weekend, my professor manage to hit campus and manually fixed the class servers, thus I no longer need to continue debugging on my own computer for profiling. After a series of "gprof ./xz"s and "perf record ./xz"s, I was able to compile enough profiling data on both Aarchie(Aarch64) and Xerxes(x86_64) server for my chosen software xz-Utils. Stage 2 profiling I have save the data in both txt and png format for gprof on both compression and decompression for both smaller and bigger size mkv. As well as save the data in txt format for perf on both compression and decompression for both sizes files. Since putting them all on the blog would take more space than I wanted to, I am just going to insert the compression png in here.  Figure 1.0a: Aarchie 1.5Gb compression  Figure 2.0a: Aarchie 500Mb compression  Figure 1.0x: 1.5Gb compression  Figure 2.0x: 500Mb compression

Course Project Stage 2 part 2: Profiling

Image
After a series of installing different stuff under my own machine, i was finally able to rebuild stage 1 under my laptop. Stage 1 Rebuild Since I am continuing under a different machine, I rebuild stage 1. Home laptop Aarch64 483,546 kb mkv file compress 1st test 2nd test real 8m13.718s 8m13.024s user 8m11.359s 8m10.813s sys 0m2.344s 0m2.141s decompress real 0m31.880s 0m31.827s user 0m30.813s 0m30.906s sys 0m1.031s 0m0.955s 1,412,966 kb mkv file compress 1st test 2nd test real 23m54.487s 23m47.785s user 23m48.141s 23m41.016s sys 0m5.984s 0m6.609s decompress real 0m24.068s 0m24.030s user 0m21.188s 0m20.828s sys 0m2.859s 0m3.172s And from here, begins the profiling Stage 2 profiling Gprof After having to install many many MANY

Course Project Stage 2 Introduction

Issue has arrived!! Since I pushed my work for SPO600 till today because of my other focuses in other school works (my own fault), an issue has arrived. Today unexpectedly all the school remote machine rejected all my attempt for connection. A few days ago, there was an email send from the professor talking about all the machines are going through mass restarts on Friday. We were told to expect Aarchie and Israel might continue to be unavailable even after restart because the restart is done remotely. But today I wasn't able to connection to Bbetty and Xerxes as well which are the only other machines I have access to. Now, I have no choice but resort to one of my last resorts. I'll have to enable the windows subsystem for Linux on my laptop and work from there. Since I don't use my laptop for anything other than school work, this will keep my bench marking and profiling errors to minimum. My laptop system type is 64-bit OS, this would cover at least the Aarch64 part of

Course Project Stage 1 part 2: building and timing

So after many hours of reading, help from current and past classmates, as well as help from professor, I am finally able to test xz utils on each of the machines I was given access to. Build and Install - Take the newest source code by either downloading the archive (https://tukaani.org/xz/xz-5.3.1alpha.tar.xz) or through git clone ( git clone https://git.tukaani.org/xz.git) . Both can be found in their website  https://tukaani.org/xz/ . - From within the source code folder, execute "./autogen.sh" - Outside of the source code, create another folder for the program. - From within the source code foler, use "./configure --prefix=( location for the program )" to configure the desire location for the program - Use "make install" to execute the installation Execute and Test - Since the machines should already have another "xz" installed, I would want to make sure if I am using the correct one. The machine installed version is older (5.2.4) t

Course Project Stage 1: deciding which software

Introduction I have finally entering the final stages of SPO600. At this point we (students) are to decide on a software to study upon as the final project of this course. To my understanding, this project consist of three stages: -Fine an open source software (ie. codec) and benchmark its performance on both Aarch64 and x86_64 -Identify the area of poor performance on the software and methods for improvement on both Aarch64 and x86_64 -Dive into the identified area and identify what approaches we have for improvement. Demonstrate on both Aarch64 and x86_64 Deciding on the software After many days of reading..... to be honest I still haven't fully grasp on the detailed procedures of what I have to do. I believe I lack the knowledge to execute all the task required. Since I don't feel confidence in my ability to completing the project, I believe its best to pick a software which I believe I understands. In this case, I decided on one of the file compression software.