Skip to content

Latest commit

 

History

History

2020

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Advent of Code 2020

This year I'm doing the solutions in Rust. I've started liking it a lot during the year and want to see what type of performance I can get.

Advent of Code 2020 Story

After saving Christmas five years in a row, you've decided to take a vacation at a nice resort on a tropical island. Surely, Christmas will go on without you.

The tropical island has its own currency and is entirely cash-only. The gold coins used there have a little picture of a starfish; the locals just call them stars. None of the currency exchanges seem to have heard of them, but somehow, you'll need to find fifty of these coins by the time you arrive so you can pay the deposit on your room.

To save your vacation, you need to get all fifty stars by December 25th.

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: Report Repair 🌟 898299 🌟 143933922
Day 2: Password Philosophy 🌟 524 🌟 485
Day 3: Toboggan Trajectory 🌟 259 🌟 2224913600
Day 4: Passport Processing 🌟 200 🌟 116
Day 5: Binary Boarding 🌟 866 🌟 583
Day 6: Custom Customs 🌟 6778 🌟 3406
Day 7: Handy Haversacks 🌟 226 🌟 9569
Day 8: Handheld Halting 🌟 1489 🌟 1539
Day 9: Encoding Error 🌟 21806024 🌟 2986195
Day 10: Adapter Array 🌟 2475 🌟 442136281481216
Day 11: Seating System 🌟 2183 🌟 1990
Day 12: Rain Risk 🌟 1294 🌟 20592
Day 13: Shuttle Search 🌟 3246 🌟 1010182346291467
Day 14: Docking Data 🌟 5055782549997
Day 15: Rambunctious Recitation 🌟 1696 🌟 37385
Day 16: Ticket Translation 🌟 26980
Day 17: Conway Cubes 🌟 242 🌟 2292
Day 18: Operation Order 🌟 29839238838303 🌟 201376568795521
Day 19: Monster Messages 🌟 122 🌟 287
Day 21: Allergen Assessment 🌟 2517 🌟 rhvbn,mmcpg,kjf,fvk,lbmt,jgtb,hcbdb,zrb
Day 22: Crab Combat 🌟 32472 🌟 36463

Performance

With the help of cargo-aoc I get automatic benchmarking using Criterion. Computer is a MacBook Pro 2,6 GHz 6-Core i7, 32 GB RAM, Radeon 5300M 4 GB.

Day #1 #2 Improvement*
1 1.21 µs 16.70 µs −92.46% / −99.61%
2 16.62 µs 39.57 µs −96.27% / -91.57%
3 2.04 µs 9.51 µs
4 528.92 ns 731.94 ns
5 103.69 µs 127.14 µs
6 477.60 µs 696.92 µs −23.83% / 0%
7 179.43 µs 1.70 µs
8 23.66 µs 49.398 ms
9 299.88 µs 363.98 µs −97.78% / −97.33%
10 646.78 ns 455.67 µs −75.95% / −30.25%
11 10.38 ms 15.29 ms
12 9.02 µs 12.72 µs −28.58% / 0%
13 479.50 ns 1.82 µs -99.99% / 0%
14 730.08 µs
15 134.16 µs 2.92 s** −46.89% / −72.30%
16 381.21 µs
17 8.52 ms 704.03 ms**
18 41.72 µs 779.27 µs
19 11.42 ms 74.00 ms
21 163.07 µs 901.73 ns
22 10.91 µs 974.42 ms

* compared to first solution

** slow, didn't run through criterion

Previous solutions

Day #1 #2 Improvement Link
1 16.06 µs 4.38 ms Baseline Link
2 446.02 µs 470.28 µs Baseline Link
2 446.02 µs 77.35 µs 0% / −83.55% Link
6 627.01 µs 696.92 µs Baseline Link
9 13.50 ms 13.66 ms Baseline Link
10 2.69 µs 653.28 µs Baseline Link
12 12.63 µs 12.72 µs Baseline Link
13 34.44 ms 1.82 µs Baseline Link
13 246.04 µs 1.82 µs Baseline Link
15 252.60 µs 10.54 s Baseline Link