Skip to content

Commit

Permalink
2024 day 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeni Gordeev committed Dec 3, 2024
1 parent 8e6e945 commit ad7ded0
Show file tree
Hide file tree
Showing 7 changed files with 1,125 additions and 11 deletions.
19 changes: 13 additions & 6 deletions 2024.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
## 2024

![](https://img.shields.io/badge/stars%20⭐-2-yellow)
![](https://img.shields.io/badge/days%20completed-1-red)
![](https://img.shields.io/badge/day%20📅-1-blue)
![](https://img.shields.io/badge/stars%20⭐-4-yellow)
![](https://img.shields.io/badge/days%20completed-2-red)
![](https://img.shields.io/badge/day%20📅-3-blue)
[![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/EvgeniGordeev/13c6cac3c39702cdcb9cc169b66c3210/raw/runtime-badge-2024-all-ci.json)](https://github.com/EvgeniGordeev/adventofcode/actions/workflows/ci2024.yaml)

* [https://adventofcode.com/2024](https://adventofcode.com/2024)

To profile with hyperfine - `brew install hyperfine`

* `hyperfine --warmup 3 -r 10 '2024/01.py'`
* ```find 2024 -type f -regex ".*/[0-9]*\.py" -exec hyperfine --warmup 3 -r 10 'python {}' \;```
* ```python -m cProfile 2024/01.py```
* ```time python 2024/01.py```
* `find 2024 -type f -regex ".*/[0-9]*\.py" -exec hyperfine --warmup 3 -r 10 'python {}' \;`
* `time python 2024/01.py`
* `python -m cProfile 2024/01.py`

To create a visualization of the profile (requires `brew install graphviz`):

```shell
export problem=2024/01 && python -m cProfile -o $problem.pstats $problem.py && gprof2dot -f pstats $problem.pstats | dot -Tpng -o $problem.png
```

## pre-commit

Expand All @@ -26,6 +32,7 @@ hyperfine --warmup 3 -r 10 'find 2024 -type f -regex ".*/[0-9]*\.py" | sort -n |
| Day | Name | Solution | CI Benchmark |
|-------------------------------------------|-----------------------------------|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [01](https://adventofcode.com/2024/day/1) | Historian Hysteria | [py](2024/01.py) | [![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/EvgeniGordeev/13c6cac3c39702cdcb9cc169b66c3210/raw/runtime-badge-2024-01-ci.json)](https://github.com/EvgeniGordeev/adventofcode/actions/workflows/ci2024.yaml) |
| [02](https://adventofcode.com/2024/day/2) | Red-Nosed Reports | [py](2024/02.py) | [![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/EvgeniGordeev/13c6cac3c39702cdcb9cc169b66c3210/raw/runtime-badge-2024-02-ci.json)](https://github.com/EvgeniGordeev/adventofcode/actions/workflows/ci2024.yaml) |
| ----------------------------------------- | --------------------------------- | ------------------------- | --- |
| [all](https://adventofcode.com/2024) | AoC 24 | [txt](2024/answers.txt) | [![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/EvgeniGordeev/13c6cac3c39702cdcb9cc169b66c3210/raw/runtime-badge-2024-all-ci.json)](https://github.com/EvgeniGordeev/adventofcode/actions/workflows/ci2024.yaml) |

Expand Down
Loading

0 comments on commit ad7ded0

Please sign in to comment.