Skip to main content

Posts

Showing posts from 2020

What happens from Keyboard to Kernel ?

Brief introduction to Linux kernel and shell Users new to Linux will want to familiarise themselves with the following: terminal  is a program that opens a window and lets you interact with the shell shell  is a program that takes commands from the keyboard and gives them to the operating system to perform. Bourne-Again shell, usually referred to as bash, which is the default shell for most Linux distributions. When you first login to a server, you will be dropped into the command prompt, or shell prompt, which is where you can issue commands to the server. The shell will forward its input (usually, from your own key presses) to the running program’s stdin, and it will forward the program’s output (stdout and stderr) to its own output (usually displayed on your screen). The shell is an interface that translates commands into some low-level calls to the kernel. kernel  is the essential center of a computer operating system, the core that provides basic services for all other p

Making Python Programs Blazingly Fast

Let’s look at the performance of our Python programs and see how to make them up to 30% faster! Python  haters always say, that one of the reasons they don’t want to use it, is that it’s  slow . Well, whether specific program — regardless of the programming language used — is fast or slow is very much dependent on the developer who wrote it and their skill and ability to write  optimized  and  fast  programs. So, let’s prove some people wrong and let’s see how we can improve performance of our  Python  programs and make them really fast! Timing and Profiling Before we start optimizing anything, we first need to find out which parts of our code actually slow down the whole program. Sometimes the bottleneck of the program might be obvious, but in case you don’t know where it is, then here are options you have for finding out: Note: This is the program I will be using for demonstration purposes, it computes  e  to power of  X  (taken from Python docs): # slow