Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
fffc126
Initial plan
Copilot Jul 24, 2025
4c37ca3
Implement ForestRun performance benchmarks
Copilot Jul 24, 2025
a7cf5d9
Complete ForestRun benchmark implementation with GitHub Actions
Copilot Jul 24, 2025
5516574
Remove archived benchmark library dependency and implement custom sol…
Copilot Jul 31, 2025
f7e3339
Replace hardcoded mock data generation with dynamic GraphQL-aware system
Copilot Jul 31, 2025
523ae11
Simplify ForestRun benchmarks: focus only on ForestRun performance, a…
Copilot Aug 1, 2025
68c6705
Convert ForestRun benchmarks to measure timing instead of ops/sec and…
Copilot Aug 1, 2025
255ea31
Implement ForestRun performance benchmarks with millisecond timing an…
Copilot Aug 1, 2025
1509913
Implement high-confidence statistical measurements with <5% margin of…
Copilot Aug 1, 2025
3d9a5b4
Implement configurable confidence levels for ForestRun benchmarks wit…
Copilot Aug 1, 2025
4df9775
Implement configurable confidence levels for ForestRun benchmarks in …
Copilot Aug 5, 2025
171438f
Add gitignore entry for benchmark compiled files and clean up artifacts
Copilot Aug 5, 2025
a0f08a3
Fix benchmark configuration issues and replace mock data generation w…
Copilot Aug 5, 2025
268d602
Implement dynamic confidence-based sampling with batch measurement ap…
Copilot Aug 6, 2025
e3713c2
Extract GitHub Action inline script into reusable comparison tool
Copilot Aug 6, 2025
ebc1fbc
Fix statistical confidence calculations and clean up report structure
Copilot Aug 6, 2025
54fb85e
Implement proper confidence calculation using margin of error percent…
Copilot Aug 6, 2025
3879885
Implement parallel execution and reduce verbosity for faster ForestRu…
Copilot Aug 6, 2025
c1aec4f
Implement Node.js worker threads for true parallel execution and fix …
Copilot Aug 6, 2025
fa42581
Simplify parallel execution with CPU-aware task distribution and clea…
Copilot Aug 6, 2025
7cf9cdc
Move benchmark system to new private package with yargs and improved …
Copilot Aug 7, 2025
3c0f9c8
Add gitignore for benchmark reports and restore full query configuration
Copilot Aug 7, 2025
50ffc7e
Replace dynamic mock data with static JSON responses and add multiple…
Copilot Aug 7, 2025
bc980c5
Remove confidence customization, set to 99.5%, add reliability checki…
Copilot Aug 7, 2025
d71ef30
Fix benchmark measurement issues: proper confidence calculation, isol…
Copilot Aug 7, 2025
dd298e6
changes
pavelglac Aug 8, 2025
87500b3
scenarios
pavelglac Aug 15, 2025
104a2c6
copy caches
pavelglac Aug 19, 2025
f1d182a
cleanup
pavelglac Aug 19, 2025
64f8305
github actions
pavelglac Aug 20, 2025
c3f86db
fixies
pavelglac Aug 20, 2025
5059245
remove tests
pavelglac Aug 20, 2025
e332dd9
fixies
pavelglac Aug 20, 2025
4baa01f
test
pavelglac Aug 25, 2025
229dcd9
fixies
pavelglac Aug 25, 2025
5db7f10
changes
pavelglac Aug 25, 2025
cb1d6d7
cleanup 2
pavelglac Aug 25, 2025
64d2121
more changes
pavelglac Aug 25, 2025
e460f3a
fixies
pavelglac Aug 25, 2025
25591fd
fix runner
pavelglac Aug 25, 2025
683309d
add rest time
pavelglac Aug 25, 2025
9fcb9ef
more improvements
pavelglac Aug 25, 2025
00bc94b
improvements
pavelglac Aug 25, 2025
e97c162
more changes
pavelglac Aug 25, 2025
5a7528f
more changes
pavelglac Aug 25, 2025
ea881c6
changes
pavelglac Aug 25, 2025
9c3bf1b
types
pavelglac Aug 28, 2025
da58047
refactor
pavelglac Aug 28, 2025
43f9f78
import fixies
pavelglac Aug 28, 2025
452ba2a
fix paths
pavelglac Aug 28, 2025
5a7f62c
remove flags
pavelglac Aug 28, 2025
089b7ab
changes
pavelglac Aug 29, 2025
4cf7581
changes
pavelglac Aug 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 125 additions & 0 deletions .github/workflows/forest-run-benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: ForestRun Performance Benchmarks

on:
push:
branches: [main]
paths:
- "packages/apollo-forest-run/**"
- "packages/apollo-forest-run-benchmarks/**"
pull_request:
paths:
- "packages/apollo-forest-run/**"
- "packages/apollo-forest-run-benchmarks/**"

permissions:
contents: read
pull-requests: write

jobs:
benchmark:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "yarn"

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Change directory
run: cd packages/apollo-forest-run-benchmarks

- name: Clone caches
run: |
cd packages/apollo-forest-run-benchmarks
yarn clone

- name: Run benchmarks
run: |
cd packages/apollo-forest-run-benchmarks
yarn benchmark
env:
CI: true

- name: Comment benchmark results on PR
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');

// Find the most recent markdown report file
const benchmarkDir = 'packages/apollo-forest-run-benchmarks';
let reportPath = null;

try {
const files = fs.readdirSync(benchmarkDir);
const markdownFiles = files
.filter(file => file.startsWith('benchmark-analysis-') && file.endsWith('.md'))
.map(file => ({
name: file,
path: path.join(benchmarkDir, file),
mtime: fs.statSync(path.join(benchmarkDir, file)).mtime
}))
.sort((a, b) => b.mtime - a.mtime);

if (markdownFiles.length > 0) {
reportPath = markdownFiles[0].path;
}
} catch (error) {
console.log('Error finding markdown files:', error.message);
}

if (reportPath && fs.existsSync(reportPath)) {
const markdownContent = fs.readFileSync(reportPath, 'utf8');

// Find existing benchmark comment on this PR to update or create new one
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
});

const botComment = comments.find(comment =>
comment.user.type === 'Bot' &&
comment.body.includes('📊 Benchmark Analysis Report')
);

const commentBody = `<!-- benchmark-report -->
${markdownContent}

---
*Updated: ${new Date().toISOString()}*`;

if (botComment) {
// Update existing comment
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: commentBody
});
console.log('Updated existing benchmark comment');
} else {
// Create new comment on PR
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body: commentBody
});
console.log('Created new benchmark comment on PR');
}
} else {
console.log('No benchmark report markdown file found in', benchmarkDir);
}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ examples/apollo-watch-fragments/public/bundle.js

examples/supermassive-todomvc/**/*.d.ts*
relay-preload-hooks.ts

# Benchmark reports
packages/apollo-forest-run/benchmarks/performance/benchmark-report-*.json

# Compiled TypeScript files in benchmarks
packages/apollo-forest-run/benchmarks/performance/compiled
3 changes: 3 additions & 0 deletions packages/apollo-forest-run-benchmark/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["../../.eslintrc.json"]
}
1 change: 1 addition & 0 deletions packages/apollo-forest-run-benchmark/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
forest-runs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
query ComplexNested($organizationId: ID!, $first: Int) {
organization(id: $organizationId) {
id
name
description
createdAt
departments(first: $first) {
edges {
node {
id
name
budget
teams {
id
name
description
members {
id
name
email
role
avatar
projects {
id
title
status
priority
assignedAt
dueDate
tags
progress
tasks {
id
title
completed
priority
assignee {
id
name
email
}
}
}
}
}
}
cursor
}
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
fragment UserInfo on User {
id
name
email
avatar
createdAt
lastLoginAt
}

fragment PostInfo on Post {
id
title
content
createdAt
updatedAt
published
tags
viewCount
likeCount
}

fragment CommentInfo on Comment {
id
content
createdAt
author {
...UserInfo
}
replies {
id
content
createdAt
author {
...UserInfo
}
}
}

query FragmentedPostsQuery($userId: ID!, $first: Int, $after: String) {
user(id: $userId) {
...UserInfo
posts(first: $first, after: $after) {
edges {
node {
...PostInfo
author {
...UserInfo
}
comments(first: 5) {
edges {
node {
...CommentInfo
}
cursor
}
pageInfo {
hasNextPage
endCursor
}
}
}
cursor
}
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
query SimpleQuery($id: ID!) {
node(id: $id) {
id
__typename
}
}
Loading
Loading