Advent of Code 2025
README.md

Advent of Code 2025 #

GitHub last commit (branch)

GitHub Pages Docker

You can view my solution online!

What is Advent of Code? 🎄 #

Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. Each day there will be a new problem that is split into 2 parts. The second parts is a more difficult variation of the first part. This repository contains my solutions to the Advent of Code 2025 puzzles

How did i solve the puzzles? #

This Year i decided try out WebAssembly. I wrote a frontend website in Angular, where you can more easily run the code and get the solutions. But all the actual algorithms and logic are implemented in Rust and compiled. This allows me to write high-performance code in Rust, while still being able to use the powerful features of Angular for the user interface.

Is it fast? #

Here are the benchmark results on my machine (AMD Ryzen 7 7700X 8-Core @ 16x 5.6Ghz). Both running natively and running as WebAssembly in Chrome:

Day Stars Code Native WebAssembly
Day 01: Secret Entrance ⭐ ⭐ Code 0.077 ms 0.129 ms
Day 02: Gift Shop ⭐ ⭐ Code 0.152 ms 0.802 ms
Day 03: Lobby ⭐ ⭐ Code 0.448 ms 0.516 ms
Day 04: Printing Department ⭐ ⭐ Code 2.610 ms 4.854 ms
Day 05: Cafeteria ⭐ ⭐ Code 0.103 ms 0.214 ms
Day 06: Trash Compactor ⭐ ⭐ Code 0.065 ms 0.154 ms
Day 07: Laboratories ⭐ ⭐ Code 0.025 ms 0.028 ms
Day 08: Playground ⭐ ⭐ Code 39.355 ms 62.698 ms
Day 09: Movie Theater ⭐ ⭐ Code 6.492 ms 36.047 ms
Day 10: Factory ⭐ ⭐ Code 2.437 ms 12.832 ms
Day 11: Reactor ⭐ ⭐ Code 0.364 ms 0.450 ms
Day 12: Christmas Tree Farm ⭐ ⭐ Code 0.118 ms 0.207 ms

How to run the code? #

Angular + Rust WebAssembly #

You can start the Angular frontend and run the solutions in WebAssembly. For this its easiest to use the build in angular server. But we also need to compile the Rust code to produce the WebAssembly modules. To do this you'll need to have pnpm and Rust installed on your system. (npm will probably also work)

cd frontend
# Install dependencies
pnpm install
# Allow build scripts to run
pnpm approve-builds
# Build the Rust code to WebAssembly
pnpm build
# Start the angular server
pnpm start

This will start a local web server, usually at http://localhost:4200, where you can access the frontend and run the solutions. You will need to obtain the puzzle inputs from the Advent of Code website.

Rust standalone #

You can run the Rust code standalone without the Angular frontend. This produces a binary that runs the solutions in the terminal. To run the code, you'll first need to obtain the puzzle inputs from the Advent of Code website and place them in the input folder. Or save your session cookie in the environment variable AOC_SESSION.

You'll also need to have Rust installed on your system. If you haven't installed it yet, you can download it from here. Once you have Rust installed and the inputs in place, you can run all the puzzles using the following command:

cd rust-wasm
# Run all the days
cargo run --release
# Run a specific days
cargo run --release -- day01

For Day 10 there is an alternative solver implemented. Its based on the Z3 Theorem Prover and not available for WebAssembly. You can use it by enabling the z3 feature flag:

cd rust-wasm
# Run day 10 with the z3 solver
cargo run --release --features z3 -- day10

How to benchmark the code? #

You can benchmark the performance of the code using the following commands:

cd rust-wasm
# Benchmark all the days
cargo bench
# See all available benchmarks
cargo bench -- --list
# Benchmark a specific day
cargo bench day01
# Run each part seperately
cargo bench day01_seperate

# You can also run the wasm benchmarks
cargo install wasm-bindgen-cli
export CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER=wasm-bindgen-test-runner
cargo bench --target wasm32-unknown-unknown