On Monday, 24 November 2025 at 14:37:22 UTC, Jabba Laci wrote:
I implemented [Advent of Code 2015, Day 6, Part 1](https://adventofcode.com/2015/day/6) in D. The code is here: https://github.com/jabbalaci/AdventOfCode2015/tree/main/day06/d/part1 . It runs for 3 seconds. I found it a bit much, so I also wrote it in Python. To my surprise, the Python program also ran for 3 seconds. I expected that the D program should be much faster.
Often times, this is a sign that your algorithm requires this time to complete. Algorithmic complexity often will trump optimizations and interpretation speed.
I don't have time to look through your solution, I just wanted to point this out. I would not start out expecting python to always be slower than D or C++ or rust or anything.
I remember from my days doing competitive programming that algorithm selection is always the key. People who wrote solutions in Java often beat ones in C++ because of the better algorithm selection. Generally these types of problems are *designed* to be solvable in any language, and so the individual speed of the language isn't a factor.
-Steve
