Skip to content

Commit 36e166c

Browse files
authored
ci: Fix performance step in CI (#9925)
1 parent d94f348 commit 36e166c

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

.github/workflows/ci-performance.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,13 @@ jobs:
247247
const changeStr = change > 0 ? \`+\${change.toFixed(1)}%\` : \`\${change.toFixed(1)}%\`;
248248
249249
let status = '✅';
250-
if (change > 100) {
250+
if (change > 50) {
251251
status = '❌ Much Slower';
252252
hasRegression = true;
253-
} else if (change > 50) {
253+
} else if (change > 25) {
254254
status = '⚠️ Slower';
255255
hasRegression = true;
256-
} else if (change < -50) {
256+
} else if (change < -25) {
257257
status = '🚀 Faster';
258258
hasImprovement = true;
259259
}
@@ -304,9 +304,9 @@ jobs:
304304
echo "" >> comment.md
305305
echo "</details>" >> comment.md
306306
echo "" >> comment.md
307-
echo "*Benchmarks ran with ${BENCHMARK_ITERATIONS:-1000} iterations per test on Node.js ${{ env.NODE_VERSION }} (production mode, CPU pinned)*" >> comment.md
307+
echo "*Benchmarks ran with ${BENCHMARK_ITERATIONS:-10000} iterations per test on Node.js ${{ env.NODE_VERSION }} (production mode, CPU pinned)*" >> comment.md
308308
echo "" >> comment.md
309-
echo "> **Note:** Using 1k iterations with CPU affinity for measurement stability. Thresholds: ⚠️ >50%, ❌ >100%." >> comment.md
309+
echo "> **Note:** Using 10k iterations with CPU affinity for measurement stability. Thresholds: ⚠️ >25%, ❌ >50%." >> comment.md
310310
311311
- name: Comment PR with results
312312
if: github.event_name == 'pull_request'

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ Performance benchmarks are located in [`benchmark/performance.js`](benchmark/per
341341
4. **Test locally**: Run the benchmarks locally to verify they work:
342342
```bash
343343
npm run benchmark:quick # Quick test with 10 iterations
344-
npm run benchmark # Full test with 1,000 iterations
344+
npm run benchmark # Full test with 10,000 iterations
345345
```
346346

347347
For new features where no baseline exists, the CI will establish new benchmarks that future PRs will be compared against.

benchmark/performance.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const MONGODB_URI = process.env.MONGODB_URI || 'mongodb://localhost:27017/parse_
1919
const SERVER_URL = 'http://localhost:1337/parse';
2020
const APP_ID = 'benchmark-app-id';
2121
const MASTER_KEY = 'benchmark-master-key';
22-
const ITERATIONS = parseInt(process.env.BENCHMARK_ITERATIONS || '1000', 10);
22+
const ITERATIONS = parseInt(process.env.BENCHMARK_ITERATIONS || '10000', 10);
2323

2424
// Parse Server instance
2525
let parseServer;
@@ -248,7 +248,7 @@ async function benchmarkBatchSave() {
248248
}
249249

250250
await Parse.Object.saveAll(objects);
251-
}, Math.floor(ITERATIONS / BATCH_SIZE)); // Fewer iterations for batch operations
251+
});
252252
}
253253

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

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

296296
/**

0 commit comments

Comments
 (0)