Skip to content

add memory benchmarking#906

Open
avivkeller wants to merge 1 commit into
mainfrom
membench
Open

add memory benchmarking#906
avivkeller wants to merge 1 commit into
mainfrom
membench

Conversation

@avivkeller

Copy link
Copy Markdown
Member

Adds memory benchmarking

@avivkeller avivkeller requested a review from a team as a code owner July 14, 2026 00:10
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api-docs-tooling Ready Ready Preview Jul 14, 2026 12:12am

Request Review

@cursor

cursor Bot commented Jul 14, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Changes are CI comparators, workflow timing, tests, and worker-pool idle behavior—not auth or output semantics; missing base benchmarks are handled gracefully.

Overview
CI generation now wraps the CLI with /usr/bin/time, writing benchmark.json (elapsed time, user/system CPU, peak RSS) into the artifact out directory.

comparePerformance in scripts/comparators/performance.mjs reads that file from base and head and appends a Performance Markdown table to file-size and object-assertion reports. benchmark.json is excluded from file-size scans and JSON equality checks; if the base artifact has no benchmark file, output comparison still runs and the performance block is skipped. Docs and comparators.test.mjs cover the new behavior.

createWorkerPool no longer pins minThreads to the pool size or keeps workers alive indefinitely (idleTimeout is 1s instead of infinity), so idle workers can exit and peak memory measurements are less inflated by pre-warmed threads.

Reviewed by Cursor Bugbot for commit 798d865. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.30640% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.07%. Comparing base (4f07fee) to head (798d865).

Files with missing lines Patch % Lines
scripts/comparators/performance.mjs 94.82% 6 Missing ⚠️
scripts/comparators/object-assertion.mjs 85.71% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #906      +/-   ##
==========================================
+ Coverage   85.19%   86.07%   +0.88%     
==========================================
  Files         180      182       +2     
  Lines       16570    16855     +285     
  Branches     1514     1550      +36     
==========================================
+ Hits        14116    14508     +392     
+ Misses       2444     2337     -107     
  Partials       10       10              

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 798d865. Configure here.

Comment thread scripts/comparators/file-size.mjs
@github-actions

Copy link
Copy Markdown
Contributor

api-links Generator

Output

apilinks.json
Expected values to be strictly deep-equal:
+ actual - expected
... Skipped lines

  {
    'Agent.defaultMaxSockets': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L291',
    'Buffer.alloc': 'https://github.com/nodejs/node/blob/HEAD/lib/buffer.js#L435',
    'Buffer.allocUnsafe': 'https://github.com/nodejs/node/blob/HEAD/lib/buffer.js#L449',
    'Buffer.allocUnsafeSlow': 'https://github.com/nodejs/node/blob/HEAD/lib/buffer.js#L461',
...
    'agent.addRequest': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L356',
+   'agent.createConnection': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L295',
-   'agent.createConnection': 'https://github.com/nodejs/node/blob/HEAD/lib/https.js#L326',
    'agent.createSocket': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L427',
    'agent.destroy': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L660',
+   'agent.getName': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L325',
-   'agent.getName': 'https://github.com/nodejs/node/blob/HEAD/lib/https.js#L484',
    'agent.keepSocketAlive': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L616',
    'agent.removeSocket': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L555',
    'agent.reuseSocket': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L652',
    'assert.assert': 'https://github.com/nodejs/node/blob/HEAD/lib/assert.js#L185',
    'asyncResource.asyncId': 'https://github.com/nodejs/node/blob/HEAD/lib/async_hooks.js#L243',
...
    'server.address': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2585',
+   'server.close': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L671',
+   'server.closeAllConnections': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L681',
+   'server.closeIdleConnections': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L693',
-   'server.close': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2718',
-   'server.closeAllConnections': 'https://github.com/nodejs/node/blob/HEAD/lib/https.js#L120',
-   'server.closeIdleConnections': 'https://github.com/nodejs/node/blob/HEAD/lib/https.js#L122',
    'server.getConnections': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2680',
    'server.listen': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2387',
    'server.ref': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2823',
+   'server.setTimeout': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L709',
-   'server.setTimeout': 'https://github.com/nodejs/node/blob/HEAD/lib/https.js#L124',
    'server.unref': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2832',
+   'server[SymbolAsyncDispose]': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L677',
-   'server[SymbolAsyncDispose]': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2758',
    'server[kDeserialize]': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2308',
    'server[kTransferList]': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2281',
    'server[kTransfer]': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2286',
+   'server[undefined]': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L716',
-   'server[undefined]': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2787',
    'serverresponse._finish': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L246',
    'serverresponse._implicitHeader': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L403',
    'serverresponse.assignSocket': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L296',
    'serverresponse.detachSocket': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L307',
    'serverresponse.statusCode': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L269',
...
    'socket.addSourceSpecificMembership': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L1043',
+   'socket.address': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L932',
-   'socket.address': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L871',
    'socket.bind': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L284',
    'socket.bindSync': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L437',
    'socket.close': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L895',
+   'socket.connect': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L481',
-   'socket.connect': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L1438',
    'socket.connectSync': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L514',
    'socket.destroySoon': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L1013',
    'socket.disconnect': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L607',
    'socket.dropMembership': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L1028',
    'socket.dropSourceSpecificMembership': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L1061',
...
    'socket.read': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L996',
+   'socket.ref': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L1118',
-   'socket.ref': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L1841',
    'socket.remoteAddress': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L944',
    'socket.resetAndDestroy': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L958',
    'socket.resume': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L987',
    'socket.send': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L732',
    'socket.sendto': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L621',
...
    'socket.setTypeOfService': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L818',
+   'socket.unref': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L1128',
-   'socket.unref': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L1855',
    'socket[SymbolAsyncDispose]': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L919',
    'socket[kAfterAsyncWrite]': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L1147',
    'socket[kDeserialize]': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L1557',
    'socket[kReinitializeHandle]': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L1506',
    'socket[kTransferList]': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L1533',

orama-db Generator

Output size

| File | Base | Head | Diff |

|-|-|-|-|

| orama-db.json | 8.92 MB | 8.91 MB | -1.13 KB (-0.01%) |

web Generator

Output size

| File | Base | Head | Diff |

|-|-|-|-|

| all.html | 19.97 MB | 19.97 MB | +40.00 B (+0.00%) |

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.

3 participants