Skip to content

Add controlled JDK cache benchmark scenario - #10

Merged
brunoborges merged 7 commits into
mainfrom
brunoborges-benchmark-jdk-cache
Aug 5, 2026
Merged

Add controlled JDK cache benchmark scenario#10
brunoborges merged 7 commits into
mainfrom
brunoborges-benchmark-jdk-cache

Conversation

@brunoborges

@brunoborges brunoborges commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • compare cache-jdk: false and cache-jdk: true on the same actions/setup-java@main ref, isolating JDK caching from unrelated implementation changes
  • seed per-arm dependency and wrapper caches, then collect 2–20 warm read-only samples without save races or JDK-key collisions
  • force the not-preinstalled path by purging the runner Java tool cache before every setup invocation
  • report warm medians, cold seed timings, billed-minute estimates, JDK/dependency/wrapper storage, raw JSON/CSV, cleanup, and the missing-JDK-entry degenerate case
  • document the design and unit-test the reporter's pure helpers

Why seed then measure

JDK cache keys are content-derived from the JDK identity and source, so they cannot be namespaced with a per-sample marker. A normal cold/warm matrix would let one sample's JDK entry contaminate another. The prepare job deletes existing setup-java-jdk- entries, each arm then runs one seed, and every measurement job uses cache-read-only: true. Measurement jobs can restore caches but cannot save, collide on, or race for the shared JDK key. Dependency and Maven Wrapper caches remain isolated with arm- and run-specific marker content.

A setup-java runner tool-cache hit returns before JDK cache restore/save registration. Every seed and measurement job therefore removes Java_* from $RUNNER_TOOL_CACHE first. Microsoft Build of OpenJDK is the default; Temurin remains available as an input to exercise the same forced-miss path.

This PR consolidates the earlier pinned baseline/candidate harness and PR #11. The earlier harness was successfully sampled five times, but those runs predate this same-ref, seed/read-only design; the consolidated workflow itself has intentionally not been dispatched from the PR.

How to run

Open Actions > JDK cache > Run workflow. For the primary comparison, use:

  • distribution: microsoft
  • java-version: 17
  • samples: 10
  • cleanup-caches: true

Validation

  • npm test
  • actionlint .github/workflows/jdk-cache.yml
  • YAML parse and explicit job/needs wiring check

brunoborges and others added 3 commits August 4, 2026 19:06
Compare pinned baseline and candidate setup-java commits across isolated cold and warm Microsoft JDK runs, with raw timing and cache-size artifacts.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Temporarily route the registered focused benchmark workflow through the reusable JDK cache benchmark for branch execution.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove the temporary branch-dispatch wiring now that JDK cache samples are complete, leaving the reusable benchmark harness intact for retention.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 4, 2026 23:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new benchmark harness to measure the impact of a default-on JDK cache in actions/setup-java by running pinned “baseline” vs “candidate” commits in isolated cold/warm jobs, then generating a summarized report and artifacts.

Changes:

  • Added a new jdk-cache.yml workflow that runs baseline/candidate cold+warm jobs and uploads benchmark artifacts.
  • Added scripts/report-jdk-cache.mjs to fetch job timings + cache sizes from the GitHub API and write JSON/CSV/markdown summaries.
  • Extended tests and documentation to cover the new job-name parsing and benchmark description.
Show a summary per file
File Description
scripts/report.test.mjs Adds unit test coverage for parsing JDK cache benchmark job names.
scripts/report-jdk-cache.mjs Implements report generation for the new JDK cache benchmark, including cache discovery and optional cleanup.
README.md Documents the new JDK cache benchmark workflow and its sequential sampling/cleanup requirement.
.github/workflows/jdk-cache.yml Defines the new benchmark workflow and report/artifact upload steps.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread scripts/report-jdk-cache.mjs
Comment thread scripts/report-jdk-cache.mjs
brunoborges and others added 4 commits August 4, 2026 19:38
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Retain the stricter seed/read-only implementation while joining the prior benchmark history.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@brunoborges brunoborges changed the title Add JDK cache benchmark Add controlled JDK cache benchmark scenario Aug 5, 2026
@brunoborges
brunoborges merged commit 1beb6dd into main Aug 5, 2026
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.

2 participants