An open API service indexing awesome lists of open source software.

https://github.com/tsunaminoai/aoc2024

✨ Advent of Code 🎄
https://github.com/tsunaminoai/aoc2024

advent-of-code advent-of-code-2024-zig advent-of-code-2025-zig zig

Last synced: 4 months ago
JSON representation

✨ Advent of Code 🎄

Awesome Lists containing this project

README

          

## Getting Started

This project uses [devbox](https://github.com/jetify-com/devbox) to manage its development environment.

Install devbox:

```sh
curl -fsSL https://get.jetpack.io/devbox | bash
```

Start the devbox shell:

```sh
devbox shell
```

Run a script in the devbox environment:

```sh
devbox run
```

## Scripts

Scripts are custom commands that can be run using this project's environment. This project has the following scripts:

* [debug](#devbox-run-debug)
* [fast](#devbox-run-fast)
* [safe](#devbox-run-safe)
* [small](#devbox-run-small)
* [test](#devbox-run-test)
* [test-watch](#devbox-run-test-watch)

## Shell Init Hook

The Shell Init Hook is a script that runs whenever the devbox environment is instantiated. It runs
on `devbox shell` and on `devbox run`.

```sh
echo 'Welcome to devbox!' > /dev/null
```

## Packages

* [zig@0.15.1](https://www.nixhub.io/packages/zig)
* [zls@0.15.0](https://www.nixhub.io/packages/zls)
* [watchexec@latest](https://www.nixhub.io/packages/watchexec)

## Script Details

### devbox run debug

```sh
zig build -Doptimize=Debug run
```

 

### devbox run fast

```sh
zig build -Doptimize=ReleaseFast run
```

 

### devbox run safe

```sh
zig build -Doptimize=ReleaseSafe run
```

 

### devbox run small

```sh
zig build -Doptimize=ReleaseSmall run
```

 

### devbox run test

```sh
zig build -Doptimize=Debug test
```

 

### devbox run test-watch

```sh
zig build --watch test
```

 

<!-- gen-readme end -->

## Benchmark Results

<!-- BENCHMARK START -->

### Day 1 (100 iterations)

|Part|Avg|Min|Max|
|-|-|-|-|
|1|507.098µs|495.167µs|752.833µs
|2|507.967µs|495.334µs|754.458µs

### Day 4 (100 iterations)

|Part|Avg|Min|Max|
|-|-|-|-|
|1|2.461ms|2.317ms|3.587ms
|2|53.926ms|52.383ms|97.696ms

### Day 5 (100 iterations)

|Part|Avg|Min|Max|
|-|-|-|-|
|1|1.540ms|1.508ms|1.833ms
|2|381.384µs|368.416µs|478.709µs

### Day 7 (100 iterations)

|Part|Avg|Min|Max|
|-|-|-|-|
|1|323.309µs|214.042µs|1.172ms
|2|5.340ms|4.884ms|6.933ms

<!-- BENCHMARK END -->