Skip to content

Conversation

@fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Oct 26, 2024

eggjs/egg#5365

Summary by CodeRabbit

  • Chores

    • Migrated CI from Travis to GitHub Actions and added multi-version Node.js runs.
    • Added automation to build/ensure benchmarking tool and integrated it into CI scripts.
    • Expanded runtime test sequences to cover additional service variants, ports, and longer latency-measured blocks.
  • Documentation

    • Reformatted README lists and added a Contributors subsection.
  • Dependencies

    • Updated dependency aliases and adjusted test/ci scripts to use the new tooling.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 26, 2024

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds a GitHub Actions CI workflow and removes Travis config, introduces an install script for wrk and an npm script, updates package.json dependency aliases and scripts, starts additional egg-cluster instances with reusePort/worker_threads, and expands the test runner to probe ports 7002–7009 with latency measurement.

Changes

Cohort / File(s) Summary
CI / Workflows
​.travis.yml, ​.github/workflows/nodejs.yml
Removed Travis CI config and added .github/workflows/nodejs.yml (CI) that reuses node-test.yml@master, triggers on push/PR to master, and runs Node matrix with wrk install steps.
wrk installer & package scripts
install-wrk.sh, package.json
Added install-wrk.sh to clone/build wrk and added install-wrk npm script; updated ci script to prepend PATH with $PWD/wrk/bin.
Dependencies & scripts
package.json
Replaced egg1/egg2/egg3 versions with npm aliases (npm:egg@1, npm:egg@2, npm:egg@3); updated test-simple and ci scripts and added install-wrk.
Runtime / test runner
simple/dispatch.js, simple/run.sh
Added os usage and extra logs; started additional egg-cluster instances (ports 7008 with reusePort:true, 7009 with startMode:'worker_threads' + reusePort:true); expanded run.sh to probe ports 70027009, standardized 30s blocks, added initial sleep and latency reporting; added curl targets.
Documentation / formatting
README.md
Replaced diff-style -- lines with * bullets across sections and added a Contributors subsection under Last Results.

Sequence Diagram(s)

sequenceDiagram
    participant Actions as GitHub Actions
    participant Installer as install-wrk.sh / npm (install-wrk)
    participant CI_Script as npm ci script
    participant Tester as simple/run.sh (wrk)
    participant Dispatcher as simple/dispatch.js
    participant Cluster as egg-cluster manager
    participant Worker as worker process/thread

    Actions->>Installer: run `install-wrk` (clone & build wrk)
    Actions->>CI_Script: invoke CI script (PATH includes wrk/bin)
    CI_Script->>Tester: execute `simple/run.sh` (wrk tests)
    Tester->>Dispatcher: ensure servers started / trigger dispatch
    Dispatcher->>Cluster: start clusters on ports 7002..7009 (reusePort / worker_threads)
    Cluster->>Worker: spawn workers (processes/threads)
    Tester->>Worker: run wrk probes against ports 7002..7009
    Worker-->>Tester: return responses (latency/throughput)
    Tester-->>Actions: surface results/logs
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Focus review on:
    • simple/dispatch.js: cluster start options (reusePort, startMode) and additional logging.
    • simple/run.sh: timings, ports, latency flags, and curl targets.
    • .github/workflows/nodejs.yml and install-wrk.sh: workflow reuse and wrk build robustness.
    • package.json: npm alias dependencies and modified scripts.

Poem

🐇
I swapped old trails for Actions and dug a tiny cave,
I built a wrk that rattles, then sent workers to the wave,
I planted ports like carrots and measured every hop,
I hop, I ping, I tally — clusters hum, tests never stop,
The rabbit cheers the CI green, and scampers home to nap.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add reusePort benchmark' accurately describes the primary change: adding benchmark tests for reusePort functionality across multiple egg.js configurations.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch reuse-port

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 33bc22f and 2383fc0.

📒 Files selected for processing (1)
  • simple/dispatch.js (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • simple/dispatch.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Node.js / Test (ubuntu-latest, 20)
  • GitHub Check: Node.js / Test (ubuntu-latest, 24)
  • GitHub Check: Node.js / Test (ubuntu-latest, 22)
  • GitHub Check: Node.js / Test (ubuntu-latest, 18)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@socket-security
Copy link

socket-security bot commented Oct 26, 2024

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedegg@​2.37.0951009199100
Addedegg@​3.31.0951009197100
Addedegg@​1.21.0951009597100

View full report

@socket-security
Copy link

socket-security bot commented Oct 26, 2024

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm safer-buffer is 94.0% likely obfuscated

Confidence: 0.94

Location: Package overview

From: ?npm/egg@2.37.0npm/egg@1.21.0npm/egg@3.31.0npm/safer-buffer@2.1.2

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/safer-buffer@2.1.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

Copy link
Contributor

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 adds a benchmark for the egg3 framework with reusePort=true feature to measure performance impact. It also migrates CI from Travis to GitHub Actions and updates dependency management.

  • Adds new benchmark endpoint on port 7008 for egg3 with reusePort enabled
  • Migrates from Travis CI to GitHub Actions with Node.js 20, 22, and 24
  • Updates egg dependency declarations to use npm alias syntax and adds egg-cluster beta dependency

Reviewed changes

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

Show a summary per file
File Description
simple/run.sh Adds reusePort benchmark, reorders tests to prioritize egg3 variants, adds --latency flag to all wrk commands
simple/dispatch.js Adds new egg-cluster instance with reusePort enabled on port 7008, adds version logging
package.json Adds egg-cluster 2.4.0-beta.0 dependency, updates egg aliases to npm: syntax, adds install-wrk script
install-wrk.sh New script to install wrk benchmark tool
README.md Converts list formatting from dashes to asterisks, adds contributors section
.travis.yml Removes Travis CI configuration (file deleted)
.github/workflows/nodejs.yml Adds GitHub Actions workflow for CI with Node.js versions 20, 22, 24

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

Comment on lines 37 to 43
require('egg-cluster').startCluster(({
workers,
baseDir: __dirname,
port: 7008,
framework: 'egg3',
reusePort: true,
}));
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

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

There's an extra opening parenthesis in the startCluster call. The code has require('egg-cluster').startCluster(({ but it should be require('egg-cluster').startCluster({ - remove one opening parenthesis.

Suggested change
require('egg-cluster').startCluster(({
workers,
baseDir: __dirname,
port: 7008,
framework: 'egg3',
reusePort: true,
}));
require('egg-cluster').startCluster({
workers,
baseDir: __dirname,
port: 7008,
framework: 'egg3',
reusePort: true,
});

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

[ ! -f wrk/bin/wrk ] && rm -rf wrk && git clone --depth 1 https://github.com/wg/wrk.git && make -j10 -C wrk && mkdir wrk/bin && mv wrk/wrk wrk/bin || true
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

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

The install-wrk.sh script clones and builds wrk from the mutable default branch of https://github.com/wg/wrk.git and immediately runs make on the fetched repository. This means any compromise of that repository (or a malicious change on its default branch) would execute attacker-controlled build steps with your local or CI privileges, potentially exfiltrating secrets or modifying artifacts. To reduce this supply-chain risk, fetch and build from a pinned immutable reference (specific commit or signed release) and consider verifying integrity (e.g., via checksum or signature) before running make.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (4)
simple/dispatch.js (2)

7-7: Use imported os module consistently.

The imported os module at line 5 should be used here instead of calling require('os') again.

Apply this diff:

-let workers = Number(process.argv[2] || require('os').cpus().length);
+let workers = Number(process.argv[2] || os.cpus().length);

37-37: Fix syntax error: remove extra opening parenthesis.

The call to require('egg-cluster').startCluster has an extra opening parenthesis: startCluster(({ should be startCluster({.

Apply this diff to fix the syntax error:

-  require('egg-cluster').startCluster(({
+  require('egg-cluster').startCluster({
README.md (1)

31-31: Add documentation for the new reusePort benchmark.

The README is missing an entry for the new egg3 with reusePort benchmark on port 7008 that was added in this PR.

Apply this diff to add the missing documentation:

 * egg3 with worker_threads: `wrk http://127.0.0.1:7006/ -d 10 -c 50 -t 8`
+* egg3 with reusePort: `wrk http://127.0.0.1:7008/ -d 10 -c 50 -t 8`
install-wrk.sh (1)

3-3: Supply-chain security risk: pin to immutable reference.

The script clones and builds wrk from the mutable default branch of https://github.com/wg/wrk.git. A compromise or malicious change on that branch could execute attacker-controlled build steps. Pin to a specific commit or signed release tag and consider verifying integrity before running make.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1aa236f and 340d2f7.

📒 Files selected for processing (7)
  • .github/workflows/nodejs.yml (1 hunks)
  • .travis.yml (0 hunks)
  • README.md (1 hunks)
  • install-wrk.sh (1 hunks)
  • package.json (2 hunks)
  • simple/dispatch.js (2 hunks)
  • simple/run.sh (2 hunks)
💤 Files with no reviewable changes (1)
  • .travis.yml
🧰 Additional context used
🧬 Code graph analysis (1)
simple/run.sh (2)
simple_passport/run.sh (1)
  • print_head (11-17)
simple_view/run.sh (1)
  • print_head (25-31)
🪛 LanguageTool
README.md

[grammar] ~16-~16: Ensure spelling is correct
Context: ...led, because in most situation we won't caculate csrf token and set to cookie ## Scenes...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Node.js / Test (ubuntu-latest, 22)
  • GitHub Check: Node.js / Test (ubuntu-latest, 24)
  • GitHub Check: Node.js / Test (ubuntu-latest, 20)
🔇 Additional comments (3)
simple/run.sh (2)

17-17: LGTM - Port 7008 added for reusePort testing.

The new curl command correctly probes port 7008, which corresponds to the egg3 cluster with reusePort enabled in dispatch.js.


29-98: LGTM - Test sequence properly reorganized.

The test sequence has been reorganized to prioritize egg3 variants (standard, reusePort, worker_threads) before testing other frameworks. The addition of the --latency flag to all wrk commands provides consistent performance measurement across all benchmarks.

.github/workflows/nodejs.yml (1)

1-16: LGTM - GitHub Actions workflow properly configured.

The workflow correctly:

  • Triggers on push and pull requests to master
  • Reuses a standard node-test workflow from node-modules/github-actions
  • Tests across Node.js 20, 22, and 24
  • Installs wrk before running tests via the install-wrk script

The cat /proc/cpuinfo command at the end of the install step provides useful CPU information for benchmark context.

package.json Outdated
"description": "egg benchmark",
"private": true,
"dependencies": {
"egg-cluster": "2.4.0-beta.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

latest version of egg-cluster npm package

💡 Result:

Latest version: egg-cluster 2.4.0 — as of December 12, 2025. [1][2]

Sources:
[1] npm package page for egg-cluster.
[2] Snyk / package info for egg-cluster.


Update egg-cluster to the latest stable version 2.4.0.

The PR currently specifies egg-cluster@2.4.0-beta.0, but the stable release 2.4.0 is available. For benchmarking purposes, use the stable version instead of the beta.

🤖 Prompt for AI Agents
In package.json around line 7, the dependency currently pins "egg-cluster" to
the beta release "2.4.0-beta.0"; update it to the stable release "2.4.0" by
replacing the version string so the project uses the stable package for
benchmarking and CI.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (2)
simple/dispatch.js (2)

5-7: Use the imported os module instead of re-requiring it.
Line 7 redundantly does require('os')... despite const os = require('os'); at Line 5.

-let workers = Number(process.argv[2] || require('os').cpus().length);
+let workers = Number(process.argv[2] || os.cpus().length);

37-43: Fix syntax: extra parentheses in egg-cluster.startCluster call.
Line 37’s startCluster(( { ... } )) looks like a syntax error; should be startCluster({ ... }).

-  require('egg-cluster').startCluster(({
+  require('egg-cluster').startCluster({
     workers,
     baseDir: __dirname,
     port: 7008,
     framework: 'egg3',
     reusePort: true,
-  }));
+  });
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 340d2f7 and 98a2d43.

📒 Files selected for processing (2)
  • simple/dispatch.js (3 hunks)
  • simple/run.sh (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • simple/run.sh
🧰 Additional context used
🧬 Code graph analysis (1)
simple/dispatch.js (2)
simple_passport/dispatch.js (2)
  • workers (5-5)
  • egg3 (1-1)
simple_view/dispatch.js (3)
  • workers (6-6)
  • cluster (4-4)
  • egg3 (1-1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Node.js / Test (ubuntu-latest, 22)
  • GitHub Check: Node.js / Test (ubuntu-latest, 24)
  • GitHub Check: Node.js / Test (ubuntu-latest, 20)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (3)
simple/dispatch.js (3)

37-43: Confirm reusePort (and startMode: 'worker_threads' on egg-cluster) is actually supported; otherwise results are misleading.
You’re passing reusePort: true to egg-cluster.startCluster twice; if unsupported/ignored, the “reusePort” benchmark labels won’t reflect reality.

egg-cluster startCluster options reusePort
egg-cluster startCluster startMode worker_threads ports option

Also applies to: 61-68


37-43: Fix syntax: extra parentheses break startCluster call.
startCluster(( { ... } )) should be startCluster({ ... }).

-  require('egg-cluster').startCluster(({
+  require('egg-cluster').startCluster({
     workers,
     baseDir: __dirname,
     port: 7008,
     framework: 'egg3',
     reusePort: true,
-  }));
+  });

5-10: Use the imported os module instead of require('os') again.
Line 7 should use os.cpus().length for consistency and to avoid double-require.

-let workers = Number(process.argv[2] || require('os').cpus().length);
+let workers = Number(process.argv[2] || os.cpus().length);
🧹 Nitpick comments (2)
simple/run.sh (2)

11-19: Add basic readiness checks (curl retries / fail-fast) so benchmarks don’t run against half-started servers.
Right now a slow boot just prints curl errors and continues to wrk, skewing results.


7-10: Ensure server process is always cleaned up (trap on EXIT).
If the script exits early, dispatch.js may be left running and contaminate later runs.

 EGG_SERVER_ENV=prod node $NODE_FLAGS `dirname $0`/dispatch.js $1 &
 pid=$!
+trap 'kill $pid 2>/dev/null || true' EXIT

Also applies to: 127-129

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 98a2d43 and a0f0808.

📒 Files selected for processing (3)
  • package.json (2 hunks)
  • simple/dispatch.js (3 hunks)
  • simple/run.sh (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json
🧰 Additional context used
🧬 Code graph analysis (2)
simple/dispatch.js (2)
simple_passport/dispatch.js (2)
  • workers (5-5)
  • egg3 (1-1)
simple_view/dispatch.js (3)
  • workers (6-6)
  • cluster (4-4)
  • egg3 (1-1)
simple/run.sh (2)
simple_passport/run.sh (1)
  • print_head (11-17)
simple_view/run.sh (1)
  • print_head (25-31)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Node.js / Test (ubuntu-latest, 24)
  • GitHub Check: Node.js / Test (ubuntu-latest, 22)
  • GitHub Check: Node.js / Test (ubuntu-latest, 20)
🔇 Additional comments (2)
simple/dispatch.js (1)

13-15: Startup logging looks fine; consider hardening the egg-cluster/package.json require if optional.
If egg-cluster is always installed for this benchmark, OK; otherwise this will crash master at boot.

simple/run.sh (1)

31-90: Benchmark titles assume reusePort works—ensure the runtime actually enabled it.
If simple/dispatch.js can’t enable reusePort (or it’s ignored), the “reusePort=true” blocks (7008/7009) will be mislabeled.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (2)
simple/dispatch.js (2)

7-7: Use the imported os module instead of requiring it again.

The os module is imported at line 5, but line 7 calls require('os').cpus() directly. Use the imported module for consistency.

Apply this diff:

-let workers = Number(process.argv[2] || require('os').cpus().length);
+let workers = Number(process.argv[2] || os.cpus().length);

37-43: Fix syntax error and verify reusePort support in egg-cluster 2.5.0-beta.3.

Two issues:

  1. Syntax error: Line 37 has an extra opening parenthesis (({ — should be ({.

  2. Verify reusePort option: Previous review noted that reusePort is not supported in egg-cluster 2.4.0-beta.0. Since package.json now specifies 2.5.0-beta.3, confirm whether this version supports the reusePort option in startCluster.

Apply this diff to fix the syntax error:

-  require('egg-cluster').startCluster(({
+  require('egg-cluster').startCluster({
     workers,
     baseDir: __dirname,
     port: 7008,
     framework: 'egg3',
     reusePort: true,
-  }));
+  });

Run the following script to verify reusePort support:

#!/bin/bash
# Check if egg-cluster 2.5.0-beta.3 supports reusePort option in startCluster

# Look for reusePort in egg-cluster source code
rg -nP --type=js -C3 'reusePort' node_modules/egg-cluster/

# Check egg-cluster changelog or documentation for reusePort
fd -t f "CHANGELOG|HISTORY|README" node_modules/egg-cluster/ --exec rg -nP -i "reusePort|reuse.?port" {}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a0f0808 and b8b1ab3.

📒 Files selected for processing (3)
  • package.json (2 hunks)
  • simple/dispatch.js (3 hunks)
  • simple/run.sh (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json
🧰 Additional context used
🧬 Code graph analysis (2)
simple/run.sh (2)
simple_passport/run.sh (1)
  • print_head (11-17)
simple_view/run.sh (1)
  • print_head (25-31)
simple/dispatch.js (2)
simple_passport/dispatch.js (1)
  • workers (5-5)
simple_view/dispatch.js (2)
  • workers (6-6)
  • cluster (4-4)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Node.js / Test (ubuntu-latest, 24)
  • GitHub Check: Node.js / Test (ubuntu-latest, 22)
  • GitHub Check: Node.js / Test (ubuntu-latest, 20)
🔇 Additional comments (8)
simple/dispatch.js (1)

13-14: LGTM!

The logging statements correctly display OS and egg-cluster versions for benchmarking context.

simple/run.sh (7)

17-18: LGTM!

The curl commands for ports 7008 and 7009 correctly verify the new egg-cluster instances before running benchmarks.


32-40: Verify test labels if reusePort is unsupported.

The test block correctly targets port 7008 with appropriate wrk configuration. However, if reusePort is not supported in egg-cluster 2.5.0-beta.3 (as flagged in dispatch.js review), the test label "egg3 hello with reusePort=true" may be misleading since the feature wouldn't actually be enabled.

Ensure dispatch.js lines 37-43 are verified first — if reusePort is unsupported, consider updating the test labels to reflect the actual configuration.


44-52: LGTM!

The test block correctly benchmarks the standard egg3 configuration on port 7005 with appropriate duration and latency measurement.


56-64: LGTM!

The test block accurately benchmarks egg3 with worker_threads mode (1 worker) on port 7006.


68-76: Verify test labels if reusePort is unsupported.

The test block correctly targets port 7009 with worker_threads configuration. However, if reusePort is not supported in egg-cluster 2.5.0-beta.3 (as flagged in dispatch.js review), consider updating the test label accordingly.

Depends on verification of dispatch.js lines 53-60.


80-88: LGTM!

The koa benchmark on port 7002 is correctly configured with consistent duration and latency measurement.


92-112: LGTM!

The egg1 and egg2 test blocks provide valuable comparison benchmarks across framework versions. Port configurations and wrk parameters are correct.

fengmk2 and others added 2 commits December 13, 2025 17:22
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@fengmk2 fengmk2 merged commit 5e9b592 into master Dec 13, 2025
9 checks passed
@fengmk2 fengmk2 deleted the reuse-port branch December 13, 2025 15:28
@coderabbitai coderabbitai bot mentioned this pull request Dec 14, 2025
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