In the past I’ve coded in a lot of different programming languages, like C, C++, Java, Assembler, etc. But a view years ago I got in contact with Python. First I disliked it to have no brackets at the block boundaries. This was because it was so uncommon to me and I made the typical beginner mistakes: Mixing spaces and tabs. But with time I’ve learned to avoid the common mistakes and I’ve learned to love Python. The more I’ve coded in Python the more I’ve learned how powerful this programming language is and the more I fell in love with it ;-)
Although Python is extremely powerful it has besides the (in-)famous GIL a drawback: Python is relatively slow compared to other programming languages. But fortunately you are not lost in space. There are several more or less easy and powerful ways to make the Python code (really) fast.
In this blog I want to provide some tips and present some modules and code snippets for writing fast programs in Python.
I hope you enjoy it :-)
Latest Posts
-
A socketserver with threads vs uvloop
The
uvloop
project is great with an amazing performance, and a good replacement for the default asyncio module, if Linux is used. Unfortunatelyuvloop
is not... -
scandir-rs
Because speed matters…
-
Python and Lua
Python is great, but pure Python code sometimes has one problem: It’s slow.
-
fastlogging
When I was working on a bigger project which does lot’s of logging I determined that the standard logging module in Python is pretty slow. So I decided to write...
-
fastthreadpool
Existing implementations of thread pools have a relatively high overhead in certain situations. Especially
apply_async
inmultiprocessing.pool.ThreadPool
andsubmit
inconcurrent.futures
.