Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions .github/workflows/ci-performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,13 @@ jobs:
const changeStr = change > 0 ? \`+\${change.toFixed(1)}%\` : \`\${change.toFixed(1)}%\`;

let status = '✅';
if (change > 100) {
if (change > 50) {
status = '❌ Much Slower';
hasRegression = true;
} else if (change > 50) {
} else if (change > 25) {
status = '⚠️ Slower';
hasRegression = true;
} else if (change < -50) {
} else if (change < -25) {
status = '🚀 Faster';
hasImprovement = true;
}
Expand Down Expand Up @@ -304,9 +304,9 @@ jobs:
echo "" >> comment.md
echo "</details>" >> comment.md
echo "" >> comment.md
echo "*Benchmarks ran with ${BENCHMARK_ITERATIONS:-1000} iterations per test on Node.js ${{ env.NODE_VERSION }} (production mode, CPU pinned)*" >> comment.md
echo "*Benchmarks ran with ${BENCHMARK_ITERATIONS:-10000} iterations per test on Node.js ${{ env.NODE_VERSION }} (production mode, CPU pinned)*" >> comment.md
echo "" >> comment.md
echo "> **Note:** Using 1k iterations with CPU affinity for measurement stability. Thresholds: ⚠️ >50%, ❌ >100%." >> comment.md
echo "> **Note:** Using 10k iterations with CPU affinity for measurement stability. Thresholds: ⚠️ >25%, ❌ >50%." >> comment.md

- name: Comment PR with results
if: github.event_name == 'pull_request'
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ Performance benchmarks are located in [`benchmark/performance.js`](benchmark/per
4. **Test locally**: Run the benchmarks locally to verify they work:
```bash
npm run benchmark:quick # Quick test with 10 iterations
npm run benchmark # Full test with 1,000 iterations
npm run benchmark # Full test with 10,000 iterations
```

For new features where no baseline exists, the CI will establish new benchmarks that future PRs will be compared against.
Expand Down
8 changes: 4 additions & 4 deletions benchmark/performance.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const MONGODB_URI = process.env.MONGODB_URI || 'mongodb://localhost:27017/parse_
const SERVER_URL = 'http://localhost:1337/parse';
const APP_ID = 'benchmark-app-id';
const MASTER_KEY = 'benchmark-master-key';
const ITERATIONS = parseInt(process.env.BENCHMARK_ITERATIONS || '1000', 10);
const ITERATIONS = parseInt(process.env.BENCHMARK_ITERATIONS || '10000', 10);

// Parse Server instance
let parseServer;
Expand Down Expand Up @@ -248,7 +248,7 @@ async function benchmarkBatchSave() {
}

await Parse.Object.saveAll(objects);
}, Math.floor(ITERATIONS / BATCH_SIZE)); // Fewer iterations for batch operations
});
}

/**
Expand All @@ -264,7 +264,7 @@ async function benchmarkUserSignup() {
user.set('password', 'benchmark_password');
user.set('email', `benchmark${counter}@example.com`);
await user.signUp();
}, Math.floor(ITERATIONS / 10)); // Fewer iterations for user operations
});
}

/**
Expand All @@ -290,7 +290,7 @@ async function benchmarkUserLogin() {
const userCreds = users[counter++ % users.length];
await Parse.User.logIn(userCreds.username, userCreds.password);
await Parse.User.logOut();
}, Math.floor(ITERATIONS / 10)); // Fewer iterations for user operations
});
}

/**
Expand Down
Loading