Git Product home page Git Product logo

gotta-go-fast's Introduction

Performance Tracking for Zig

This project exists to track various benchmarks related to the Zig project regarding execution speed, memory usage, throughput, and other resource utilization statistics.

The goal is to prevent performance regressions, and provide understanding and exposure to how various code changes affect key measurements.

Strategy

The main script does git pull and then runs the suite of measurements against the latest master branch commit. When it is done, it repeats. If git pull yields no new commits, it waits 60 seconds and then tries again.

The file queue.txt is a line-delimited list of git commit hashes which can be manually added to be processed. The queue will be checked before doing git pull.

This project is deployed on a virtual private sever and constantly running. It is not guaranteed to have consistent hardware over the entire life of this project, yet we want to provide a graph with meaningful changes over time.

Therefore, each time a new measurement is drawn, two benchmarks are performed: one fixed git commit, as the reference point, and then the new commit being tested. Both data points are stored, and any graphs will show the change in time in relation to the fixed reference point.

Measurements are directly stored and committed to this git repository, in CSV format. It is planned for new benchmarks to be added over time, and old benchmarks to be retired, however the data should remain available.

Installation

System requirements:

This project was only written with POSIX systems in mind.

These must be installed and available in PATH:

  • git
  • ninja

Process

For each of the baseline commit hashes in benchmarks/manifest.json, you must provide a corresponding zig installation with the prefix zig-builds/$HASH.

You also must set up zig-builds/src as a git repository, and set up the build directory using the ninja generator.

cd zig-builds/src
mkdir build
cmake .. -DCMAKE_BUILD_TYPE=Release -GNinja

You may need additional configuration to get LLVM/Clang/LLD to be detected. You can optionally test the installation by running ninja in the build directory.

This zig git source tree can't be used for anything else; the benchmarking script modifies the state of this source tree and relies on the state not being otherwise modified.

Running

Run the main.zig program from the root source directory. It is a long running process and will periodically poll for changes to the zig source git repo. Extra commits to bench can be manually added to the queue.txt file.

The program will periodically modify the records.csv file. If you want it to automatically commit this file to git and push it, use the command line parameter --auto-commit-and-push. In this case, the program must be run as a user that has permission to do perform git commit and git push commands.

What About Cool Graphs And Stuff?

Out of scope. This project's entire purpose is to keep records.csv updated with new data.

It will be the job of a separate project to periodically pull this data and do something useful with it, such as make pretty graphs and put them on ziglang.org.

Here's one such project by @wozeparrot: zig-perf-graphs.

Adding a New Benchmark

Add it to benchmarks/manifest.json.

You can run a benchmark alone to test it like this:

../../zig-builds/src/build/zig run --main-pkg-path ../.. --pkg-begin app main.zig --pkg-end --release-fast -lc ../../bench.zig -- ../../zig-builds/src/build/zig

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.