Skip to content

perf: debug micro tasks improvement - #1142

Closed
wellwelwel wants to merge 2 commits into
mainfrom
perf
Closed

perf: debug micro tasks improvement#1142
wellwelwel wants to merge 2 commits into
mainfrom
perf

Conversation

@wellwelwel

Copy link
Copy Markdown
Owner

No description provided.

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.71%. Comparing base (b5c42e4) to head (d2b4854).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1142   +/-   ##
=======================================
  Coverage   99.71%   99.71%           
=======================================
  Files          65       65           
  Lines        3560     3564    +4     
  Branches      568      571    +3     
=======================================
+ Hits         3550     3554    +4     
  Misses          1        1           
  Partials        9        9           
Flag Coverage Δ
linux 98.90% <100.00%> (+<0.01%) ⬆️
osx 98.90% <100.00%> (+<0.01%) ⬆️
windows 95.84% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wellwelwel-bot

wellwelwel-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

🎖️ Benchmarks

🐷 Poku 🃏 Jest ⚡️ Vitest 🦕 Deno 🐢 Node.js 🍞 Bun
🏃🏻‍♀️ Test Runner $\textsf{0.181s}$
${\color{gray}\textsf{(baseline)}}$
$\textsf{0.956s}$
${\color{red}\textsf{(+775ms)}}$
$\textsf{0.831s}$
${\color{red}\textsf{(+650ms)}}$
$\textsf{0.383s}$
${\color{red}\textsf{(+202ms)}}$
$\textsf{0.217s}$
${\color{red}\textsf{(+36ms)}}$
$\textsf{0.098s}$
${\color{green}\textsf{(-83ms)}}$
🧬 No Isolation $\textsf{0.057s}$
${\color{gray}\textsf{(baseline)}}$
$\textsf{0.949s}$
${\color{red}\textsf{(+892ms)}}$
$\textsf{0.572s}$
${\color{red}\textsf{(+515ms)}}$
$\textsf{0.384s}$
${\color{red}\textsf{(+327ms)}}$
$\textsf{0.063s}$
${\color{red}\textsf{(+6ms)}}$
$\textsf{0.034s}$
${\color{green}\textsf{(-23ms)}}$
🧪 Assertion $\textsf{0.098s}$
${\color{gray}\textsf{(baseline)}}$
$\textsf{0.575s}$
${\color{red}\textsf{(+477ms)}}$
$\textsf{0.498s}$
${\color{red}\textsf{(+400ms)}}$
$\textsf{0.796s}$
${\color{red}\textsf{(+698ms)}}$
$\textsf{0.105s}$
${\color{red}\textsf{(+7ms)}}$
$\textsf{0.013s}$
${\color{green}\textsf{(-85ms)}}$
🔗 Nesting $\textsf{0.146s}$
${\color{gray}\textsf{(baseline)}}$
$\textsf{0.820s}$
${\color{red}\textsf{(+674ms)}}$
$\textsf{0.767s}$
${\color{red}\textsf{(+621ms)}}$
$\textsf{0.436s}$
${\color{red}\textsf{(+290ms)}}$
$\textsf{0.525s}$
${\color{red}\textsf{(+379ms)}}$
$\textsf{0.042s}$
${\color{green}\textsf{(-104ms)}}$
ℹ Extensive Details

🖥️ Setup

  • OS: linux x64
  • CPU: AMD EPYC 7763 64-Core Processor (4 cores)
  • RAM: 15.62 GB

🏃🏻‍♀️ Test Runner

Focuses solely in execution, using a simple assert(true) or assert(false) from Node.js and searches for files in four levels of depth.

  • success: a suite of 5 tests that will pass.
  • failure: a suite of 5 tests that will fail.
  • balanced: a suite of 10 tests where 5 tests will fail and 5 tests will pass.

🃏 Jest

  • success
  🐷 Poku (d2b4854) ran
    5.30 ± 0.10 times faster than jest
See commands
source
node --experimental-vm-modules ./node_modules/jest/bin/jest.js "./test/execution/success/jest"
poku
node ./node_modules/poku/lib/bin/index.js "./test/execution/success/poku"
  • failure
  🐷 Poku (d2b4854) ran
    5.17 ± 0.12 times faster than jest
See commands
source
node --experimental-vm-modules ./node_modules/jest/bin/jest.js "./test/execution/failure/jest"
poku
node ./node_modules/poku/lib/bin/index.js "./test/execution/failure/poku"
  • balanced
  🐷 Poku (d2b4854) ran
    5.38 ± 0.11 times faster than jest
See commands
source
node --experimental-vm-modules ./node_modules/jest/bin/jest.js "./test/execution/balanced/jest"
poku
node ./node_modules/poku/lib/bin/index.js "./test/execution/balanced/poku"

⚡️ Vitest

  • success
  🐷 Poku (d2b4854) ran
    4.65 ± 0.12 times faster than vitest
See commands
source
node ./node_modules/vitest/vitest.mjs run "./test/execution/success/vitest"
poku
node ./node_modules/poku/lib/bin/index.js "./test/execution/success/poku"
  • failure
  🐷 Poku (d2b4854) ran
    4.41 ± 0.08 times faster than vitest
See commands
source
node ./node_modules/vitest/vitest.mjs run "./test/execution/failure/vitest"
poku
node ./node_modules/poku/lib/bin/index.js "./test/execution/failure/poku"
  • balanced
  🐷 Poku (d2b4854) ran
    4.72 ± 0.08 times faster than vitest
See commands
source
node ./node_modules/vitest/vitest.mjs run "./test/execution/balanced/vitest"
poku
node ./node_modules/poku/lib/bin/index.js "./test/execution/balanced/poku"

🐢 Node.js (built-in)

  • success
  🐷 Poku (d2b4854) ran
    1.13 ± 0.03 times faster than node
See commands
source
node --test "./test/execution/success/node/**/**.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js "./test/execution/success/poku"
  • failure
  🐷 Poku (d2b4854) ran
    1.11 ± 0.04 times faster than node
See commands
source
node --test "./test/execution/failure/node/**/**.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js "./test/execution/failure/poku"
  • balanced
  🐷 Poku (d2b4854) ran
    1.31 ± 0.03 times faster than node
See commands
source
node --test "./test/execution/balanced/node/**/**.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js "./test/execution/balanced/poku"

🍞 Bun (built-in)

  • success
  bun ran
    1.77 ± 0.04 times faster than 🐷 Poku (d2b4854)
See commands
source
bun test --parallel --isolate "./test/execution/success/bun"
poku
bun --bun ./node_modules/poku/lib/bin/index.js "./test/execution/success/poku"
  • failure
  bun ran
    1.71 ± 0.07 times faster than 🐷 Poku (d2b4854)
See commands
source
bun test --parallel --isolate "./test/execution/failure/bun"
poku
bun --bun ./node_modules/poku/lib/bin/index.js "./test/execution/failure/poku"
  • balanced
  bun ran
    1.72 ± 0.04 times faster than 🐷 Poku (d2b4854)
See commands
source
bun test --parallel --isolate "./test/execution/balanced/bun"
poku
bun --bun ./node_modules/poku/lib/bin/index.js "./test/execution/balanced/poku"

🦕 Deno (built-in)

  • success
  🐷 Poku (d2b4854) ran
    1.70 ± 0.04 times faster than deno
See commands
source
deno test "./test/execution/success/deno"
poku
deno run --allow-all ./node_modules/poku/lib/bin/index.js "./test/execution/success/poku"
  • failure
  🐷 Poku (d2b4854) ran
    1.31 ± 0.04 times faster than deno
See commands
source
deno test "./test/execution/failure/deno"
poku
deno run --allow-all ./node_modules/poku/lib/bin/index.js "./test/execution/failure/poku"
  • balanced
  🐷 Poku (d2b4854) ran
    2.01 ± 0.07 times faster than deno
See commands
source
deno test "./test/execution/balanced/deno"
poku
deno run --allow-all ./node_modules/poku/lib/bin/index.js "./test/execution/balanced/poku"

🚀 No Isolation

Same fixtures as Test Runner, but with test isolation disabled where supported (Poku --isolation=none, Jest --runInBand, Vitest --no-isolate, Node.js --test-isolation=none, Bun plain bun test). Deno has no per-file isolation flag, so it stays on deno test.

  • success: a suite of 5 tests that will pass.
  • failure: a suite of 5 tests that will fail.
  • balanced: a suite of 10 tests where 5 tests will fail and 5 tests will pass.

🃏 Jest

  • success
  🐷 Poku (d2b4854) ran
   14.85 ± 0.38 times faster than jest
See commands
source
node --experimental-vm-modules ./node_modules/jest/bin/jest.js --runInBand "./test/execution/success/jest"
poku
node ./node_modules/poku/lib/bin/index.js --isolation=none "./test/execution/success/poku"
  • failure
  🐷 Poku (d2b4854) ran
   14.65 ± 0.31 times faster than jest
See commands
source
node --experimental-vm-modules ./node_modules/jest/bin/jest.js --runInBand "./test/execution/failure/jest"
poku
node ./node_modules/poku/lib/bin/index.js --isolation=none "./test/execution/failure/poku"
  • balanced
  🐷 Poku (d2b4854) ran
   20.25 ± 0.67 times faster than jest
See commands
source
node --experimental-vm-modules ./node_modules/jest/bin/jest.js --runInBand "./test/execution/balanced/jest"
poku
node ./node_modules/poku/lib/bin/index.js --isolation=none "./test/execution/balanced/poku"

⚡️ Vitest

  • success
  🐷 Poku (d2b4854) ran
   10.54 ± 0.20 times faster than vitest
See commands
source
node ./node_modules/vitest/vitest.mjs run --no-isolate "./test/execution/success/vitest"
poku
node ./node_modules/poku/lib/bin/index.js --isolation=none "./test/execution/success/poku"
  • failure
  🐷 Poku (d2b4854) ran
   10.13 ± 0.26 times faster than vitest
See commands
source
node ./node_modules/vitest/vitest.mjs run --no-isolate "./test/execution/failure/vitest"
poku
node ./node_modules/poku/lib/bin/index.js --isolation=none "./test/execution/failure/poku"
  • balanced
  🐷 Poku (d2b4854) ran
   10.03 ± 0.24 times faster than vitest
See commands
source
node ./node_modules/vitest/vitest.mjs run --no-isolate "./test/execution/balanced/vitest"
poku
node ./node_modules/poku/lib/bin/index.js --isolation=none "./test/execution/balanced/poku"

🐢 Node.js (built-in)

  • success
  🐷 Poku (d2b4854) ran
    1.09 ± 0.04 times faster than node
See commands
source
node --test --test-isolation=none "./test/execution/success/node/**/**.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js --isolation=none "./test/execution/success/poku"
  • failure
  🐷 Poku (d2b4854) ran
    1.11 ± 0.04 times faster than node
See commands
source
node --test --test-isolation=none "./test/execution/failure/node/**/**.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js --isolation=none "./test/execution/failure/poku"
  • balanced
  🐷 Poku (d2b4854) ran
    1.11 ± 0.04 times faster than node
See commands
source
node --test --test-isolation=none "./test/execution/balanced/node/**/**.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js --isolation=none "./test/execution/balanced/poku"

🍞 Bun (built-in)

  • success
  bun ran
    1.50 ± 0.04 times faster than 🐷 Poku (d2b4854)
See commands
source
bun test "./test/execution/success/bun"
poku
bun --bun ./node_modules/poku/lib/bin/index.js --isolation=none "./test/execution/success/poku"
  • failure
  bun ran
    1.47 ± 0.02 times faster than 🐷 Poku (d2b4854)
See commands
source
bun test "./test/execution/failure/bun"
poku
bun --bun ./node_modules/poku/lib/bin/index.js --isolation=none "./test/execution/failure/poku"
  • balanced
  bun ran
    1.43 ± 0.02 times faster than 🐷 Poku (d2b4854)
See commands
source
bun test "./test/execution/balanced/bun"
poku
bun --bun ./node_modules/poku/lib/bin/index.js --isolation=none "./test/execution/balanced/poku"

🦕 Deno (built-in)

  • success
  🐷 Poku (d2b4854) ran
    5.28 ± 0.13 times faster than deno
See commands
source
deno test "./test/execution/success/deno"
poku
deno run --allow-all ./node_modules/poku/lib/bin/index.js --isolation=none "./test/execution/success/poku"
  • failure
  🐷 Poku (d2b4854) ran
    4.06 ± 0.06 times faster than deno
See commands
source
deno test "./test/execution/failure/deno"
poku
deno run --allow-all ./node_modules/poku/lib/bin/index.js --isolation=none "./test/execution/failure/poku"
  • balanced
  🐷 Poku (d2b4854) ran
    8.42 ± 0.08 times faster than deno
See commands
source
deno test "./test/execution/balanced/deno"
poku
deno run --allow-all ./node_modules/poku/lib/bin/index.js --isolation=none "./test/execution/balanced/poku"

🧪 Assertion

Focuses solely in assertions, using each runner's own assertion API with 1 test file per runner per scenario (no file discovery involved).

  • success: 1.000 iterations × 3 assertion types (ok, strictEqual, deepStrictEqual), all passing.
  • failure: a suite of 3 tests, one per assertion type, all failing.
  • balanced: a suite of 6 tests where 3 tests will fail and 3 tests will pass.

Note: Jest, Vitest, Bun, Deno, and Node.js assertion libraries are not independently executable and require their own runtime environments. Consequently, results include the runner's startup and harness overhead in addition to assertion execution cost.


🃏 Jest

  • success
  🐷 Poku (d2b4854) ran
    6.58 ± 0.19 times faster than jest
See commands
source
node --experimental-vm-modules ./node_modules/jest/bin/jest.js "./test/assertion/success/jest.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js "./test/assertion/success/poku.spec.js"
  • failure
  🐷 Poku (d2b4854) ran
    5.25 ± 0.32 times faster than jest
See commands
source
node --experimental-vm-modules ./node_modules/jest/bin/jest.js "./test/assertion/failure/jest.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js "./test/assertion/failure/poku.spec.js"
  • balanced
  🐷 Poku (d2b4854) ran
    5.76 ± 0.20 times faster than jest
See commands
source
node --experimental-vm-modules ./node_modules/jest/bin/jest.js "./test/assertion/balanced/jest.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js "./test/assertion/balanced/poku.spec.js"

⚡️ Vitest

  • success
  🐷 Poku (d2b4854) ran
    5.26 ± 0.23 times faster than vitest
See commands
source
node ./node_modules/vitest/vitest.mjs run "./test/assertion/success/vitest.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js "./test/assertion/success/poku.spec.js"
  • failure
  🐷 Poku (d2b4854) ran
    4.93 ± 0.20 times faster than vitest
See commands
source
node ./node_modules/vitest/vitest.mjs run "./test/assertion/failure/vitest.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js "./test/assertion/failure/poku.spec.js"
  • balanced
  🐷 Poku (d2b4854) ran
    5.27 ± 0.12 times faster than vitest
See commands
source
node ./node_modules/vitest/vitest.mjs run "./test/assertion/balanced/vitest.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js "./test/assertion/balanced/poku.spec.js"

🐢 Node.js (built-in)

  • success
  🐷 Poku (d2b4854) ran
    1.07 ± 0.04 times faster than node
See commands
source
node --test "./test/assertion/success/node.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js "./test/assertion/success/poku.spec.js"
  • failure
  🐷 Poku (d2b4854) ran
    1.11 ± 0.05 times faster than node
See commands
source
node --test "./test/assertion/failure/node.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js "./test/assertion/failure/poku.spec.js"
  • balanced
  🐷 Poku (d2b4854) ran
    1.12 ± 0.03 times faster than node
See commands
source
node --test "./test/assertion/balanced/node.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js "./test/assertion/balanced/poku.spec.js"

🍞 Bun (built-in)

  • success
  bun ran
    6.72 ± 0.17 times faster than 🐷 Poku (d2b4854)
See commands
source
bun test --parallel --isolate "./test/assertion/success/bun.spec.js"
poku
bun --bun ./node_modules/poku/lib/bin/index.js "./test/assertion/success/poku.spec.js"
  • failure
  bun ran
    7.05 ± 0.31 times faster than 🐷 Poku (d2b4854)
See commands
source
bun test --parallel --isolate "./test/assertion/failure/bun.spec.js"
poku
bun --bun ./node_modules/poku/lib/bin/index.js "./test/assertion/failure/poku.spec.js"
  • balanced
  bun ran
    6.85 ± 0.20 times faster than 🐷 Poku (d2b4854)
See commands
source
bun test --parallel --isolate "./test/assertion/balanced/bun.spec.js"
poku
bun --bun ./node_modules/poku/lib/bin/index.js "./test/assertion/balanced/poku.spec.js"

🦕 Deno (built-in)

  • success
  🐷 Poku (d2b4854) ran
    7.08 ± 0.11 times faster than deno
See commands
source
deno test "./test/assertion/success/deno.test.js"
poku
deno run --allow-all ./node_modules/poku/lib/bin/index.js "./test/assertion/success/poku.spec.js"
  • failure
  🐷 Poku (d2b4854) ran
    6.85 ± 0.11 times faster than deno
See commands
source
deno test "./test/assertion/failure/deno.test.js"
poku
deno run --allow-all ./node_modules/poku/lib/bin/index.js "./test/assertion/failure/poku.spec.js"
  • balanced
  🐷 Poku (d2b4854) ran
    6.59 ± 0.51 times faster than deno
See commands
source
deno test "./test/assertion/balanced/deno.test.js"
poku
deno run --allow-all ./node_modules/poku/lib/bin/index.js "./test/assertion/balanced/poku.spec.js"

🔗 Nesting

Focuses on nested test suite overhead using describe blocks (3 levels deep, 100 suites), using Node.js assert for all runners.

  • success: 100 suites × 3-level deep nesting, all passing.
  • failure: 100 suites × 3-level deep nesting, all failing.
  • balanced: 50 suites passing + 50 suites failing.

🃏 Jest

  • success
  🐷 Poku (d2b4854) ran
    5.74 ± 0.25 times faster than jest
See commands
source
node --experimental-vm-modules ./node_modules/jest/bin/jest.js "./test/nesting/success/jest.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js "./test/nesting/success/poku.spec.js"
  • failure
  🐷 Poku (d2b4854) ran
    5.37 ± 0.16 times faster than jest
See commands
source
node --experimental-vm-modules ./node_modules/jest/bin/jest.js "./test/nesting/failure/jest.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js "./test/nesting/failure/poku.spec.js"
  • balanced
  🐷 Poku (d2b4854) ran
    5.85 ± 0.18 times faster than jest
See commands
source
node --experimental-vm-modules ./node_modules/jest/bin/jest.js "./test/nesting/balanced/jest.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js "./test/nesting/balanced/poku.spec.js"

⚡️ Vitest

  • success
  🐷 Poku (d2b4854) ran
    5.19 ± 0.19 times faster than vitest
See commands
source
node ./node_modules/vitest/vitest.mjs run "./test/nesting/success/vitest.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js "./test/nesting/success/poku.spec.js"
  • failure
  🐷 Poku (d2b4854) ran
    5.27 ± 0.20 times faster than vitest
See commands
source
node ./node_modules/vitest/vitest.mjs run "./test/nesting/failure/vitest.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js "./test/nesting/failure/poku.spec.js"
  • balanced
  🐷 Poku (d2b4854) ran
    5.43 ± 0.11 times faster than vitest
See commands
source
node ./node_modules/vitest/vitest.mjs run "./test/nesting/balanced/vitest.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js "./test/nesting/balanced/poku.spec.js"

🐢 Node.js (built-in)

  • success
  🐷 Poku (d2b4854) ran
    3.15 ± 0.15 times faster than node
See commands
source
node --test "./test/nesting/success/node.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js "./test/nesting/success/poku.spec.js"
  • failure
  🐷 Poku (d2b4854) ran
    3.83 ± 0.16 times faster than node
See commands
source
node --test "./test/nesting/failure/node.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js "./test/nesting/failure/poku.spec.js"
  • balanced
  🐷 Poku (d2b4854) ran
    3.60 ± 0.16 times faster than node
See commands
source
node --test "./test/nesting/balanced/node.spec.js"
poku
node ./node_modules/poku/lib/bin/index.js "./test/nesting/balanced/poku.spec.js"

🍞 Bun (built-in)

  • success
  bun ran
    2.97 ± 0.11 times faster than 🐷 Poku (d2b4854)
See commands
source
bun test --parallel --isolate "./test/nesting/success/bun.spec.js"
poku
bun --bun ./node_modules/poku/lib/bin/index.js "./test/nesting/success/poku.spec.js"
  • failure
  bun ran
    2.65 ± 0.16 times faster than 🐷 Poku (d2b4854)
See commands
source
bun test --parallel --isolate "./test/nesting/failure/bun.spec.js"
poku
bun --bun ./node_modules/poku/lib/bin/index.js "./test/nesting/failure/poku.spec.js"
  • balanced
  bun ran
    2.85 ± 0.08 times faster than 🐷 Poku (d2b4854)
See commands
source
bun test --parallel --isolate "./test/nesting/balanced/bun.spec.js"
poku
bun --bun ./node_modules/poku/lib/bin/index.js "./test/nesting/balanced/poku.spec.js"

🦕 Deno (built-in)

  • success
  🐷 Poku (d2b4854) ran
    2.48 ± 0.10 times faster than deno
See commands
source
deno test "./test/nesting/success/deno.test.js"
poku
deno run --allow-all ./node_modules/poku/lib/bin/index.js "./test/nesting/success/poku.spec.js"
  • failure
  🐷 Poku (d2b4854) ran
    2.35 ± 0.10 times faster than deno
See commands
source
deno test "./test/nesting/failure/deno.test.js"
poku
deno run --allow-all ./node_modules/poku/lib/bin/index.js "./test/nesting/failure/poku.spec.js"
  • balanced
  🐷 Poku (d2b4854) ran
    2.49 ± 0.09 times faster than deno
See commands
source
deno test "./test/nesting/balanced/deno.test.js"
poku
deno run --allow-all ./node_modules/poku/lib/bin/index.js "./test/nesting/balanced/poku.spec.js"

@wellwelwel wellwelwel closed this Jun 10, 2026
@wellwelwel
wellwelwel deleted the perf branch June 11, 2026 00:29
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.

1 participant