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

Add a bench suite #58

Open
kirelagin opened this issue Feb 15, 2020 · 3 comments
Open

Add a bench suite #58

kirelagin opened this issue Feb 15, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@kirelagin
Copy link
Member

No description provided.

@kirelagin kirelagin added the enhancement New feature or request label Feb 15, 2020
@kirelagin kirelagin self-assigned this Feb 15, 2020
@piegamesde
Copy link
Member

What is a "bench suite"?

@Lucus16
Copy link
Contributor

Lucus16 commented May 7, 2023

A set of benchmarks used to detect performance improvements and regressions.

@dasJ
Copy link
Member

dasJ commented Sep 17, 2024

Turns out I know far too little about GH actions to add this into @infinisil's workflow for PRs so my proposal is:

  • Format nixpkgs with command -v time treefmt … to get both the time and max residient memory
  • Concat all files into one big list and format this one string as well
  • Post the results into a PR comment or into the commit messages (maybe even with a delta? But that's probably annoying to figure out)

For the second item, I hacked together this script:

#!/usr/bin/env bash

set -euo pipefail

{
	echo '['
	while IFS= read -r f; do
		if [[ -s "${f}" ]]; then
			echo -n '('
			cat "${f}"
			echo ')'
		fi
	done <<< "$(find . -type f -name '*.nix')"
	echo ']'
} | { command time -v nixfmt > /dev/null; } 2>&1

Which for me returns:

        Command being timed: "nixfmt"
        User time (seconds): 132.66
        System time (seconds): 12.59
        Percent of CPU this job got: 79%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 3:01.82
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 21199452
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 20
        Minor (reclaiming a frame) page faults: 5479701
        Voluntary context switches: 325823
        Involuntary context switches: 5360
        Swaps: 0
        File system inputs: 1403584
        File system outputs: 0
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 0

Formatting a lot of small files in the (probably) largest nix-code repo and formatting a very huge file is hopefully a good enough indicator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

4 participants