{"id":13626713,"url":"https://github.com/ziglang/gotta-go-fast","last_synced_at":"2025-07-06T17:06:45.299Z","repository":{"id":44773060,"uuid":"265069124","full_name":"ziglang/gotta-go-fast","owner":"ziglang","description":"Performance Tracking for Zig","archived":false,"fork":false,"pushed_at":"2023-09-25T06:03:04.000Z","size":7831,"stargazers_count":249,"open_issues_count":11,"forks_count":17,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-20T09:06:07.355Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ziglang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-05-18T21:41:37.000Z","updated_at":"2025-05-18T20:57:54.000Z","dependencies_parsed_at":"2024-01-14T07:11:31.199Z","dependency_job_id":"3dfbad4c-cbd1-4c28-8327-d6189bd4d8a6","html_url":"https://github.com/ziglang/gotta-go-fast","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ziglang/gotta-go-fast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziglang%2Fgotta-go-fast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziglang%2Fgotta-go-fast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziglang%2Fgotta-go-fast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziglang%2Fgotta-go-fast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ziglang","download_url":"https://codeload.github.com/ziglang/gotta-go-fast/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziglang%2Fgotta-go-fast/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263940262,"owners_count":23533009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T21:02:27.462Z","updated_at":"2025-07-06T17:06:45.281Z","avatar_url":"https://github.com/ziglang.png","language":"Zig","funding_links":[],"categories":["Zig","Fundamentals"],"sub_categories":["Performance Benchmark"],"readme":"# Performance Tracking for Zig\n\nThis project exists to track various benchmarks related to the Zig project\nregarding execution speed, memory usage, throughput, and other resource\nutilization statistics.\n\nThe goal is to prevent performance regressions, and provide understanding\nand exposure to how various code changes affect key measurements.\n\n\u003ch4 align=\"center\"\u003e\n    \u003ca href=\"https://ziglang.org/perf/\"\u003e\n        See the latest results\n    \u003c/a\u003e\n\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"images/gotta_go_fast.png\"\u003e\n\u003c/p\u003e\n\n## Strategy\n\nThis repository is cloned by a Continuous Integration script that runs on every\nmaster branch commit to [ziglang/zig](https://github.com/ziglang/zig/) and\nexecutes a series of benchmarks using Linux's performance measurement syscalls\n(the same thing that `perf` does). The machine is a dedicated Hetzner server\nwith a AMD Ryzen 9 5950X 16-Core Processor, an NVMe hard drive, Linux kernel\n5.14.14-arch1-1. See more details below in the [CPU Details section](README.md#cpu-details).\n\nThe measurements are stored in a CSV file which is atomically swapped with\nupdated records when a new benchmark completes. After a new benchmark row is added\nto the dataset, it is pushed to `https://ziglang.org/perf/records.csv`. The\nstatic HTML + JavaScript at https://ziglang.org/perf/ loads `records.csv` and\npresents it in interactive graph form.\n\nEach benchmark gets a fixed amount of time allocated: 5 seconds per benchmark.\nFor each measurement, there is a min, max, mean, and median value. The best and\nworst runs according to Wall Clock Time are discarded to account for system\nnoise.\n\n### Measurements Collected\n\n * Wall Clock Time\n * Peak Resident Set Size (memory usage)\n * How many times the benchmark was executed in 5 seconds\n * instructions\n * cycles\n * cache-misses\n * cache-references\n * branches\n * branch-misses\n\nMetadata:\n\n * Benchmark name\n * Timestamp of when the benchmark was executed\n * Zig Git Commit SHA1\n * Zig Git Commit Message\n * Zig Git Commit Date\n * Zig Git Commit Author\n * gotta-go-fast Git Commit Sha1\n\n### CPU Details\n\n```\nvendor_id\t: AuthenticAMD\ncpu family\t: 25\nmodel\t\t: 33\nmodel name\t: AMD Ryzen 9 5950X 16-Core Processor\nstepping\t: 0\nmicrocode\t: 0xa201016\ncpu MHz\t\t: 3786.264\ncache size\t: 512 KB\nphysical id\t: 0\nsiblings\t: 32\ncpu cores\t: 16\napicid\t\t: 31\nfpu\t\t: yes\nfpu_exception\t: yes\ncpuid level\t: 16\nwp\t\t: yes\nflags\t\t: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm\nbugs\t\t: sysret_ss_attrs spectre_v1 spectre_v2 spec_store_bypass\nbogomips\t: 6789.81\nTLB size\t: 2560 4K pages\nclflush size\t: 64\ncache_alignment\t: 64\naddress sizes\t: 48 bits physical, 48 bits virtual\npower management: ts ttp tm hwpstate cpb eff_freq_ro [13] [14]\n```\n\n## Instructions for the CI Script\n\nThese measurements should only be taken for a Zig compiler that has passed the\nfull test suite, and the `$ZIG_EXE` command should be a release build matching the\ngit commit of `$COMMIT_SHA1`. `$COMMIT_TIMESTAMP` is required to be in the format\ngiven by `--pretty=format:%at`.\n\nAfter cloning this repository:\n\n```\n$ZIG_EXE build -- records.csv $ZIG_EXE $COMMIT_SHA1 $COMMIT_TIMESTAMP\n```\n\nThis will add 1 row per benchmark to `records.csv` for the specified commit.\nThe CI script should then push `records.csv` and `manifest.json` to the server so\nthat the frontend HTML+JavaScript can fetch them and display the information.\n\n## Backfilling Data\n\n`$ZIG_GIT_SRC` must be a git clone of zig, with a `build-backfill` folder\nconfigured with CMake already. It needs to be configured this way:\n\n```\ncmake .. -DCMAKE_BUILD_TYPE=Release -GNinja\nninja install\n```\n\nThis `ninja install` creates `stage1/bin/zig` which is left untouched, and then\n`ninja` (without the install argument) is used for older zig versions when going\nthrough the commits.\n\n`commits.txt` is a file containing whitespace-separated git commit hashes.\n\n```\n$ZIG_GIT_SRC/build-backfill/stage3/bin/zig build -Dbackfill -- records.csv $ZIG_GIT_SRC commits.txt\n```\n\nThis will check out each commit one-by-one and run `collect-measurements.zig`,\nupdating `records.csv` with the new rows.\n\nHere is a handy git CLI snippet for generating commits.txt:\n\n```\ngit log --first-parent --format=format:%H start..end\n```\n\nThis one will update commits.txt to be the next set of commits since the last\ntime the backfill script was run:\n\n```\ngit log $(head -n1 ~/gotta-go-fast/commits.txt)..origin/master --first-parent --format=format:%H \u003e ~/gotta-go-fast/commits.txt\n```\n\n## Adding a Benchmark\n\nFirst add an entry in `manifest.json`. Next, you can test it like this:\n\n```\n$ZIG_EXE run ./src/bench.zig -O ReleaseFast --deps app --mod app::$NEW_BENCH_MAIN_PATH -- $ZIG_EXE\n```\n\nUse an absolute path for the ending `$ZIG_EXE` argument which is in a subdirectory\nof the zig source tree used to build the zig binary. Some of the benchmarks\nwant to learn the zig source checkout path in order to test stuff.\n\n## Empty CSV File\n\nHandy to copy paste to start a new table.\n\n```csv\ntimestamp,benchmark_name,commit_hash,commit_timestamp,zig_version,error_message,samples_taken,wall_time_median,wall_time_mean,wall_time_min,wall_time_max,utime_median,utime_mean,utime_min,utime_max,stime_median,stime_mean,stime_min,stime_max,cpu_cycles_median,cpu_cycles_mean,cpu_cycles_min,cpu_cycles_max,instructions_median,instructions_mean,instructions_min,instructions_max,cache_references_median,cache_references_mean,cache_references_min,cache_references_max,cache_misses_median,cache_misses_mean,cache_misses_min,cache_misses_max,branch_misses_median,branch_misses_mean,branch_misses_min,branch_misses_max,maxrss\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziglang%2Fgotta-go-fast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fziglang%2Fgotta-go-fast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziglang%2Fgotta-go-fast/lists"}