Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create performance measurement framework #29

Open
maxfierrog opened this issue Apr 25, 2024 · 0 comments
Open

Create performance measurement framework #29

maxfierrog opened this issue Apr 25, 2024 · 0 comments
Labels
feature New feature or request help wanted Extra attention is needed

Comments

@maxfierrog
Copy link
Member

maxfierrog commented Apr 25, 2024

Create an ergonomic framework to benchmark and profile hot modules in the project. See the performance book for direction.

While this is not exactly difficult, it will take a tasteful implementation to make it useful. This includes thinking about module organization and CI integration (e.g., for regression testing).

Example

Below is an example of a benchmark function using an imaginary benchmarking framework module Benchmark:

fn solve_bench() -> Result<()> {
  let _time = Benchmark::record_time();
  solve(game);
  ...
}

Here, _time could implement Drop, and record the time difference between its instantiation and going out of scope and record it in a log file in the /dev directory for the sake of ergonomics.

This might not be the best example (since cargo bench already provides timing output), but there are plenty of useful things to try here.

Recommended Courses (UC Berkeley)

We recommend experience with testing frameworks and a mature taste in developer tooling, which university courses unfortunately do not usually teach. Beyond that:

  • CS 61B (minimum)
@maxfierrog maxfierrog added feature New feature or request help wanted Extra attention is needed labels Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant