2.2 KiB
Advent of Code 2025
Building
Everything is handled by cmake which most ide's can handle. Make sure you have a compiler (MSVC or GCC), CMake, and make/ninja installed.
If you're using make to build the project, run the following commands:
mkdir buildcd buildcmake .. -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles"make -j <number of threads>
If you're using ninja to build the project, run the following commands:
mkdir buildcd buildcmake .. -DCMAKE_BUILD_TYPE=Release -G Ninjaninja
Directory structure
src: Contains the source code for each day.src/common: Contains some generalized headers that are used by multiple days.src/dayX: Contains the source code for dayXsrc/dayx/pY: Contains the source code for partYof dayXinput: Contains the input for each day.
Types
During this challenge, I plan to have multiple different types of solutions.
- Normal: A more "normal" solution, opting for more readable code without doing anything fancy.
- Faf: The fastest solution I can think of.
Each solution has its own executable following the following naming convention: dXpY-type. Where X is the day number, pY is the part number, and type is the type of solution (Normal omits the type all together Ex: a normal day1 part1 executable would be d1p1).
Benchmarks
All benchmarks are running using the timer class defined in src/common/timer.h.
"Normal" solutions are only run once, as they aren't designed to be as fast as possible.
"Faf" solutions are run multiple times to get a more accurate average.
All benchmarks include file IO, mostly because everything calculates within single digit microseconds or less.
All benchmarks are run on a system with the following specs:
- CPU: AMD Ryzen 9 8945HS
- RAM: 32GB DDR5 6000MHz
- SSD: Samsung 990 Pro
- OS: Windows 11 24H2
- Compiler: gcc version 13.2.0 (x86_64-posix-seh-rev0, Built by MinGW-Builds project)
| Day | Part | Type | Time (us) | Iterations |
|---|---|---|---|---|
| 1 | 1 | faf | 43 | 100000 |
| 1 | 1 | Normal | 483 | 1 |
| 1 | 2 | Normal | 472 | 1 |