Skip to content

Feat: Add Markdown table report for benchmark results#654

Open
presham wants to merge 11 commits into
NodeSecure:masterfrom
presham:feat/benchmark-result-table
Open

Feat: Add Markdown table report for benchmark results#654
presham wants to merge 11 commits into
NodeSecure:masterfrom
presham:feat/benchmark-result-table

Conversation

@presham

@presham presham commented Jun 22, 2026

Copy link
Copy Markdown

Summary

  • Add new benchmark formatting logic (formatDuration, formatBytes, toMarkdown) to create human-readable report report.md to an existing benchmark/write-snapshot.ts module
  • Extract benchmark formatting logic (formatDuration, formatBytes, toMarkdown) into a new benchmark/markdown.ts module
  • Update write-snapshot.ts to import from markdown.ts and write a human-readable report.md alongside the existing report.json
  • Re-run benchmark snapshot (report.json + new report.md)
  • Add unit tests for all three exported functions covering unit-boundary conversions, the fallback when heap/gc data is absent, and multi-row rendering

Linked Issue

Closes: #612

Verification

  • node --test workspaces/js-x-ray/test/markdown.spec.ts passes
    (14 tests across formatDuration, formatBytes, toMarkdown)
  • Existing test suite has no regressions
  • npx eslint workspaces reports no errors
  • Build pass npm run build

Report

image

Test

image

@presham presham requested a review from a team as a code owner June 22, 2026 04:36
@changeset-bot

changeset-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8cbabd7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@nodesecure/js-x-ray Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@presham

presham commented Jun 22, 2026

Copy link
Copy Markdown
Author

Hi @clemgbld
This is my first contribution to this project. I've addressed [#612] by adding a readable format for the benchmark results. Would appreciate a review when you have time!

Comment thread workspaces/js-x-ray/benchmark/write-snapshot.ts Outdated
@clemgbld

Copy link
Copy Markdown
Member

@resham57 Thanks for your contribution ! can you add the changeset
https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md

Comment thread workspaces/js-x-ray/test/markdown.spec.ts
@presham

presham commented Jun 22, 2026

Copy link
Copy Markdown
Author

@resham57 Thanks for your contribution ! can you add the changeset https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md

It's my pleasure, @clemgbld. I've applied the changes you have mentioned and added a new changeset. Could you please review them once more and let me know if any further changes changes are required? I'll be happy to make them. Thank you!

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.

(Benchmark) Store the benchmark result in a more readable format

2 participants