Linux监控zig,Zig的性能跟踪

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.

zigfast.png

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.

In the meantime, some automatically updated graphs can be found here.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值