Giter Club home page Giter Club logo

aoc2022's Introduction

My own personal overengineered helpers to solve AoC problems in Rust!


The project is organized in one crate per year under the years directory.

Each crate has an inputs folder, which is where the tool will look for inputs.


How to run solutions

Of course each year can be run independently. Each solution is organized as its own binary under the src/bin folder, and uses the #[entry] macro (custom to this project) to define the entrypoint:

A simple way to run a single solution would be to do this:

cargo run -p y2022 --bin d05

If you want to bench a single solution, add --bench:

cargo run -p y2022 --bin d05 -- --bench

The following are the available arguments:

  • --bench - Run the solution as a benchmark.
  • --verbose - Verbose output.
  • --warmup - Warmup period for benchmark in milliseconds (default 400).
  • --time-limit - Time to run the benchmark in milliseconds (default 100).
  • --iter - How many iterations to run for a single sample, this is determined by timing the solution once so that we don't try to take timings in the nanosecond realm which would be unreliable.
  • --json - Output JSON which is used by the "run everything" tool below to collect and aggregate output. You can use it yourself if you find it interesting.

The "run everything" tool

The default tool in this project is provided by the lib crate, and allows for running every project at once (automatically discovered). It works with your default cargo run:

$ cargo run -- <args> -- <solution args>

<args> is one of the following:

  • -q | --quiet - less verbose output. * -V | --verbose - more verbose output.
  • -p <project> - only run the specified sub-project, like y2022 for 2022 solutions only.
  • --release - run in release mode.
  • --no-prod - disable the "production mode", which removes a bunch of stuff that is solely used to improve diagnostics during development.

How to run every solution in this repo:

cargo run -- -V

Run all benchmarks in this repo:

cargo run -- --release -- --bench

aoc2022's People

Contributors

udoprog avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.