Skip to content

feat: restructure benchmark tables to pivot layout grouped by method#84

Merged
BryanFRD merged 1 commit intomainfrom
feat/pivot-table-format
Apr 10, 2026
Merged

feat: restructure benchmark tables to pivot layout grouped by method#84
BryanFRD merged 1 commit intomainfrom
feat/pivot-table-format

Conversation

@BryanFRD
Copy link
Copy Markdown
Contributor

Summary

  • Restructure markdown output in both run.sh and format-release.sh to use a pivot layout
  • Tables are grouped by method (Binary, Npm, Docker) with commands as columns instead of rows
  • Reduces row count significantly: 48 rows -> 12 for one tool, 192 -> 48 for four tools
  • Each table stays compact enough for PR comments and release notes

Closes #76

Copilot AI review requested due to automatic review settings April 10, 2026 18:12
@BryanFRD BryanFRD merged commit 64c90fe into main Apr 10, 2026
8 checks passed
@BryanFRD BryanFRD deleted the feat/pivot-table-format branch April 10, 2026 18:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restructures benchmark markdown output into a pivoted layout grouped by install method, making tables significantly shorter and more readable in PR comments and release notes.

Changes:

  • Update scripts/run.sh markdown generation to output one table per method with commands as columns.
  • Update scripts/format-release.sh to emit the same pivoted layout (optionally with baseline deltas).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
scripts/run.sh Switch markdown results from row-per-command to pivot tables grouped by method.
scripts/format-release.sh Rework release-note performance summary to the same pivot format (and keep delta support).

Comment on lines +458 to +476
mem="N/A"
for cmd in "${CMD_LIST[@]}"; do
raw_file="$RAW_DIR/${fixture}-${tool}-${method}-${cmd}.json"
if [[ -f "$raw_file" ]]; then
median=$(extract_median "$raw_file" 2>/dev/null || echo "N/A")
row="$row ${median}ms |"
# Use memory from any command (they share the same peak RSS roughly)
m=$(cat "$RAW_DIR/${fixture}-${tool}-${method}-${cmd}.mem" 2>/dev/null || echo "")
[[ -n "$m" && "$m" != "N/A" ]] && mem="$m"
else
row="$row - |"
fi
done
if [[ "$mem" != "N/A" ]]; then
row="$row ${mem} MB |"
else
row="$row N/A |"
fi
echo "$row"
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "Peak RSS" value is not actually the peak across commands: mem is set to the last non-N/A .mem file encountered while iterating commands (in sorted command order). If memory differs per command, this will report an arbitrary command’s RSS. Consider tracking the maximum RSS across all commands for the fixture/tool/method (or explicitly label it as a representative command) so the column matches its name.

Copilot uses AI. Check for mistakes.
Comment on lines +406 to +415
# Parse: tool-method-cmd (tool may be multi-part like semantic-release)
for t in semantic-release release-please changesets ferrflow; do
if [[ "$rest" == "${t}-"* ]]; then
after="${rest#"${t}-"}"
method="${after%%-*}"
cmd="${after#*-}"
[[ "$cmd" == "$method" ]] && cmd=""
SEEN_METHODS[$method]=1
[[ -n "$cmd" ]] && SEEN_CMDS[$cmd]=1
break
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tool name parsing is hard-coded to semantic-release release-please changesets ferrflow. Since the benchmarked tool set is sourced from tools.json earlier (TOOLS=$(jq -r 'keys[]' ...)), adding a new tool will produce results in $RAW_DIR but it will never appear in the markdown tables. Consider driving this parsing/iteration from $TOOLS (and matching longest names first if needed) so markdown output stays in sync with configured tools.

Copilot uses AI. Check for mistakes.
Comment on lines +401 to +405
method=$(echo "$rest" | awk -F- '{
# tool is first field, method is second
for (t in KNOWN_TOOLS) {}
print $2
}')
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

method=$(echo "$rest" | awk ...) appears to be unused (it is overwritten in the subsequent known-tool parsing loop) and the embedded KNOWN_TOOLS reference isn’t defined anywhere. This adds an extra process spawn per raw file and makes the parsing harder to follow; consider removing the awk block and relying solely on the tool-prefix parsing below.

Copilot uses AI. Check for mistakes.
Comment on lines +78 to 81
[[ -n "$cmd" ]] && BENCH_DATA["${fixture}|${tool}|${method}|${cmd}"]="${median}ms${delta}"
if [[ "$mem" != "N/A" ]]; then
mem_display="${mem} MB"
BENCH_MEM["${fixture}|${tool}|${method}"]="${mem} MB"
fi
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BENCH_MEM["${fixture}|${tool}|${method}"] is overwritten for each command key, so the final "Peak RSS" value depends on key sort order rather than being the peak across commands. If memory varies by command, the release table will report an arbitrary value. Consider storing the maximum RSS seen for the fixture/tool/method (or renaming the column to reflect what’s actually shown).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restructure benchmark results table to reduce row count

2 participants