Skip to main content

Posts

Showing posts with the label Week 9

Going Faster

Photo by  Anders JildĂ©n  on  Unsplash Today’s topic is compiler optimizations. Besides translating our source code into machine binary executable, the compiler, based on optimization parameters, can also produce faster executables. Just by adding some parameters to the compiler, we can get a better performance or a smaller executable, for example. There are hundreds of those parameters which we can turn on or off using the prefix -f and -fno. However, instead of doing one by one, we can use the features mode using the -O param. It ranges from 0 (no optimization – the default) to 3 (the highest). Using those parameters has a cost —usually, the faster, the larger executable. How does the compiler make it faster if my code is perfect? I’m going to put some methods here, but if you want, here is more detail . Also, bear in mind that most of the optimizations are done in the intermediate representation of the program. So, the examples below are rewritten just to...

Benchmarking

Photo by  Alex manlyx  on  Unsplash Time to get the hands dirty and do some benchmarking. The goal of Lab6 is to run the different sound volume algorithms described in my last post in the five different machines and compare them. I talked about the algorithm in the last post, so now it’s time to talk about the machines. Here they are: AARCHIE BBETTY CCHARLIE ISRAEL XERXES OS Fedora 28 Fedora 31 Fedora 30 Ubuntu 19.04 Fedora 30 Architecture aarch64 aarch64 aarch64 aarch64 x86_64 CPU(s) 24 8 8 16 8 Thread(s) per core 1 1 1 1 2 Model name Cortex-A53 Cortex-A57 X-Gene Cortex-A72 Intel(R) Xeon(R) CPU E5-1630 v4 @ 3.70GHz L1d cache 32K - unknown 32K 32K L1i cache 32K - unknown 48K 32K L2 cache 256K - unknown 1024K 256K L3 cache 4096K - - - 10240K Before running anything, we need to make sure to get the time consumed by the algorithm o...