Roland's homepage

My random knot in the Web

Articles about programming

  1. Writing C in 2024

    To learn how it works and because I don’t use Java, I decided to port professor Michael Pound’s implementation of the Enigma machine and the fitness and analysis code.

    The initial port was done to Python. Unfortunately, this is one instance where Python was rather slow because of the large amount of settings that need to be tried.

    So I decided to port it to C instead.

  2. Profiling with pyinstrument

    After having used the built-in tracing profiler cProfile for a while now, I came across the statistical (sampling) profiler pyinstrument.

    A statistical profiler does not influence the runtime of the program as much as a tracing profiler as cProfile does. Additionally, pyinstrument shows the result in a different way from cProfile.

    So in this article, I will be profiling my repotool program. This program helps me maintain a mirror of FreeBSD packages that I use.

  3. On Python speed

    As an engineer, I write a lot of small python programs as tools for specific tasks. Generally, these are not large programs. Most of them are below 100 lines of code (“LOC”, as measured by cloc), although there are a few in the 300−400 LOC range.

    In this article, I will present some observations about these, and draw some conclusion from them.

  4. Python 3.11 speed comparison with 3.9

    Since Python 3.11.0 came out recently, I wanted to compare its speed with 3.9.15 on some of my own “benchmark” programs.

    Both versions are in the default configuration as built by the FreeBSD ports system.

    TL;DR Python 3.11 yielded speed improvements in the order of 25% in my tests.


Page 1 / 4 Page 2 →