Skip to content

Commit

Permalink
Benchmark and update readme (#1)
Browse files Browse the repository at this point in the history
* Create readmeStats.yml

* Update go.mod go version

* Apply automatic changes

* Update readmeStats.yml

* Update readme statistics

* Add disclaimer about benchmarks to readme

* Update readme statistics

* Update workflow and module reference

* Update readmeStats.yml

* Update readme statistics

---------

Co-authored-by: scottmckendry <scottmckendry@users.noreply.github.com>
  • Loading branch information
scottmckendry and scottmckendry authored Nov 17, 2023
1 parent 03cb122 commit 04a8dc9
Show file tree
Hide file tree
Showing 22 changed files with 47 additions and 27 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/readmeStats.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Generate Statistics Tables for Readme
on: push

jobs:
statistics:
name: Benchmark and Update Readme
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- run: cd 2022 && go build .
- run: cd 2022 && ./aoc2022
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update readme statistics
2 changes: 1 addition & 1 deletion 2022/01p1.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strconv"

"aoc/utils"
"aoc2022/utils"
)

func D01P1() {
Expand Down
2 changes: 1 addition & 1 deletion 2022/01p2.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"sort"
"strconv"

"aoc/utils"
"aoc2022/utils"
)

func D01P2() {
Expand Down
2 changes: 1 addition & 1 deletion 2022/02p1.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"fmt"
"aoc/utils"
"aoc2022/utils"
)

func D02P1() {
Expand Down
2 changes: 1 addition & 1 deletion 2022/02p2.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"aoc/utils"
"aoc2022/utils"
)

func D02P2() {
Expand Down
2 changes: 1 addition & 1 deletion 2022/03p1.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"aoc/utils"
"aoc2022/utils"
)

func D03P1() {
Expand Down
2 changes: 1 addition & 1 deletion 2022/03p2.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"aoc/utils"
"aoc2022/utils"
)

func D03P2() {
Expand Down
2 changes: 1 addition & 1 deletion 2022/04p1.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"
"strings"

"aoc/utils"
"aoc2022/utils"
)

func D04P1() {
Expand Down
2 changes: 1 addition & 1 deletion 2022/04p2.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"
"strings"

"aoc/utils"
"aoc2022/utils"
)

func D04P2() {
Expand Down
2 changes: 1 addition & 1 deletion 2022/05p1.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strings"

"aoc/utils"
"aoc2022/utils"
)

func D05P1() {
Expand Down
2 changes: 1 addition & 1 deletion 2022/05p2.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strings"

"aoc/utils"
"aoc2022/utils"
)

func D05P2() {
Expand Down
2 changes: 1 addition & 1 deletion 2022/06p1.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"sort"

"aoc/utils"
"aoc2022/utils"
)

func D06P1() {
Expand Down
2 changes: 1 addition & 1 deletion 2022/06p2.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"sort"

"aoc/utils"
"aoc2022/utils"
)

func D06P2() {
Expand Down
2 changes: 1 addition & 1 deletion 2022/07p1.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"aoc/utils"
"aoc2022/utils"
)

type file struct {
Expand Down
2 changes: 1 addition & 1 deletion 2022/07p2.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"aoc/utils"
"aoc2022/utils"
)

func D07P2() {
Expand Down
2 changes: 1 addition & 1 deletion 2022/08p1.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"aoc/utils"
"aoc2022/utils"
)

type tree struct {
Expand Down
2 changes: 1 addition & 1 deletion 2022/08p2.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"aoc/utils"
"aoc2022/utils"
)

func D08P2() {
Expand Down
Binary file added 2022/aoc
Binary file not shown.
Binary file added 2022/aoc2022
Binary file not shown.
4 changes: 2 additions & 2 deletions 2022/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module aoc
module aoc2022

go 1.21.4
go 1.21
2 changes: 1 addition & 1 deletion 2022/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strconv"

"aoc/utils"
"aoc2022/utils"
)

var solutions = map[string]func(){
Expand Down
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@ All my solutions to the [Advent of Code](https://adventofcode.com/) challenges,

![img](https://media.tenor.com/0hKphDvj4QAAAAAC/grinch-waiting-grinch.gif)

> [!NOTE]
> Benchmarks are run via [this GitHub Action](https://github.com/scottmckendry/aoc/actions/workflows/readmeStats.yml) and are not indicative of the performance of the code on your machine.
> The action uses the `ubuntu-latest` image, and runs each solution 100 times to get an average. This is by no means a perfect benchmark, so take the results below with a grain of salt.
## 2022
<!-- 2022TableStart -->
| Day | Part 1 | Part 2 | Stars |
| --- | --- | --- | --- |
| [Day 1: Calorie Counting](https://adventofcode.com/2022/day/1) | 992µs | 751µs | ⭐⭐ |
| [Day 2: Rock Paper Scissors](https://adventofcode.com/2022/day/2) | 1.077ms | 1.04ms | ⭐⭐ |
| [Day 3: Rucksack Reorganization](https://adventofcode.com/2022/day/3) | 1.386ms | 997µs | ⭐⭐ |
| [Day 4: Camp Cleanup](https://adventofcode.com/2022/day/4) | 2.088ms | 2.049ms | ⭐⭐ |
| [Day 5: Supply Stacks](https://adventofcode.com/2022/day/5) | 2.144ms | 1.856ms | ⭐⭐ |
| [Day 6: Tuning Trouble](https://adventofcode.com/2022/day/6) | 1.034ms | 3.906ms | ⭐⭐ |
| [Day 7: No Space Left On Device](https://adventofcode.com/2022/day/7) | 981µs | 831µs | ⭐⭐ |
| [Day 8: Treetop Tree House](https://adventofcode.com/2022/day/8) | 1.086ms | 2.795ms | ⭐⭐ |
| [Day 1: Calorie Counting](https://adventofcode.com/2022/day/1) | 231µs | 233µs | ⭐⭐ |
| [Day 2: Rock Paper Scissors](https://adventofcode.com/2022/day/2) | 244µs | 216µs | ⭐⭐ |
| [Day 3: Rucksack Reorganization](https://adventofcode.com/2022/day/3) | 304µs | 229µs | ⭐⭐ |
| [Day 4: Camp Cleanup](https://adventofcode.com/2022/day/4) | 828µs | 782µs | ⭐⭐ |
| [Day 5: Supply Stacks](https://adventofcode.com/2022/day/5) | 782µs | 757µs | ⭐⭐ |
| [Day 6: Tuning Trouble](https://adventofcode.com/2022/day/6) | 357µs | 2.012ms | ⭐⭐ |
| [Day 7: No Space Left On Device](https://adventofcode.com/2022/day/7) | 169µs | 146µs | ⭐⭐ |
| [Day 8: Treetop Tree House](https://adventofcode.com/2022/day/8) | 223µs | 1.326ms | ⭐⭐ |

<!-- 2022TableEnd -->

0 comments on commit 04a8dc9

Please sign in to comment.