Skip to content

Latest commit

 

History

History

2022

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Advent of Code 2022

Continuing with Rust this year.

Advent of Code 2022 Story

Santa's reindeer typically eat regular reindeer food, but they need a lot of magical energy to deliver presents on Christmas. For that, their favorite snack is a special type of star fruit that only grows deep in the jungle. The Elves have brought you on their annual expedition to the grove where the fruit grows.

To supply enough magical energy, the expedition needs to retrieve a minimum of fifty stars by December 25th. Although the Elves assure you that the grove has plenty of fruit, you decide to grab any fruit you see along the way, just in case.

Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star. Good luck!

Days

Day #1 #1 Answer #2 #2 Answer
Day 1: Calorie Counting 🌟 69528 🌟 206152
Day 2: Rock Paper Scissors 🌟 13809 🌟 12316
Day 3: Rucksack Reorganization 🌟 7831 🌟 2683
Day 4: Camp Cleanup 🌟 550 🌟 931
Day 5: Supply Stacks 🌟 PSNRGBTFT 🌟 BNTZFPMMW
Day 6: Tuning Trouble 🌟 1300 🌟 3986
Day 7: No Space Left On Device 🌟 1444896 🌟 404395
Day 8: Treetop Tree House 🌟 1684 🌟 486540
Day 9: Rope Bridge 🌟 5735 🌟 2478
Day 10: Cathode-Ray Tube 🌟 16880 🌟 RKAZAJBR
Day 11: Monkey in the Middle 🌟 66124 🌟 19309892877
Day 12: Hill Climbing Algorithm 🌟 420 🌟 414
Day 13: Distress Signal 🌟 5390 🌟 19261
Day 14: Regolith Reservoir 🌟 737 🌟 28145
Day 15: Beacon Exclusion Zone 🌟 5083287 🌟 13134039205729
Day 16: Proboscidea Volcanium
Day 17: Pyroclastic Flow 🌟 3109
Day 18: Boiling Boulders 🌟 4244 🌟 2460
Day 19: Not Enough Minerals
Day 20: Grove Positioning System
Day 21: Monkey Math 🌟 170237589447588 🌟 3712643961892

Performance

With the help of cargo-aoc I get automatic benchmarking using Criterion. Computer is a MacBook Pro M1 Pro, 32 GB RAM.

Day #1 #2 Improvement* Generator
1 1.56 ns 2.18 ns -99.82% / -99.96% 49.82 µs
2 8.08 µs 7.71 µs 183.30 µs
3 321.94 µs 325.65 µs +70.24% / 0% 12.39 µs
4 1.63 µs 1.00 µs 137.52 µs
5 20.21 µs 34.96 µs -91.86% / -73.69% 65.86 µs
6 78.93 µs 844.10 µs 2.61 µs
7 415.02 ns 3.88 µs 7.27 ms
8 293.44 µs 275.96 µs 192.56 µs
9 451.31 µs 667.39 µs -2.51% / -23.81% 57.74 µs
10 230.74 ns 806.73 ns -73.19% / -45.25% 2.28 µs
11 8.18 µs 2.79 ms -83.77% / -89.64% 59.21 ns
12 1.94 ms 457.26 ms 18.22 µs
13 2.38 µs 68.69 µs 0% / 72.92% 286.29 µs
14 6.94 ms 384.08 ms 336.12 µs
15 91.81 ms 137.01 ms 2.58 µs
17 16.94 ms -42.31% 84.22 µs
18 428.92 µs 3.30 ms -97.58% / -95.04% 165.10 µs
21 473.31 µs 453.43 µs -92.93% 402.59 µs

* compared to first solution

Previous solutions

Day #1 #2 Improvement Link
1 865.43 ns 5.51 µs Baseline Link
1 --- 3.47 µs 0% / -37.84% Link
2 189.11 µs --- Link
5 248.21 µs 132.88 µs Link
9 467.96 µs 878.56 µs Link
10 861.13 ns 1.47 µs Link
11 50.04 µs 26.88 ms Link
13 2.38 µs 254.72 µs Link
17 29.37 ms Link
18 14.25 ms 66.66 ms Link
21 6.69 ms Link