Parallelising Python with Threading and Multiprocessing

“In this article we are going to look at the different models of parallelism that can be introduced into our Python programs. These models work particularly well for simulations that do not need to share state. Monte Carlo simulations used for options pricing and backtesting simulations of various parameters for algorithmic trading fall into this category…”

Easy Web Scraping with Python

“A little over a year ago I wrote an article on web scraping using Node.js. Today I’m revisiting the topic, but this time I’m going to use Python, so that the techniques offered by these two languages can be compared and contrasted…”

The mmap pattern

“I want to bring up an underused architectural choice: the defined memory layout persisted to disk by the operating system via mmap. All malloc memory on modern UN*X systems is mmap’d. But explicitly choosing a file and mapping that into the memory space of the program means it can persist across crashes. And it doesn’t just persist in terms of storage on a backing device, but the OS is aware the pages are mapped into memory, so on start-up there will be no disk read, no serialization delay and everything is ready. In many systems the effort of reading in data, whatever trivial transformation is being performed, can be extremely costly in terms of CPU time (instructions and dcache thrashing). With a mmap’d file, this time can be reduced to nothing…”