Skip to content

Conversation

boyeln
Copy link
Contributor

@boyeln boyeln commented May 30, 2025

This changes the format of the table outputted by deno bench to be markdown compatible.

deno coverage also outputs a table to the console, and there might very well be other commands too. However, both bench and coverage has their own logic for building up and outputting the table. So there is an opportunity to create a more generic (markdown) table builder/generator. However, as I'm not too familiar with the codebase, I did not do any generalization, and tried to keep the changes as minimal as possible to produce a markdown compatible table with the existing logic.

Example of current output (without this change):

$ deno bench
Check file:///Users/boyeln/Develepment/github/simple-parser/parser_bench.ts
    CPU | Apple M1 Pro
Runtime | Deno 2.2.10 (aarch64-apple-darwin)

file:///Users/boyeln/Develepment/github/simple-parser/parser_bench.ts

benchmark   time/iter (avg)        iter/s      (min … max)           p75      p99     p995
----------- ----------------------------- --------------------- --------------------------
parse               22.6 µs        44,190 ( 21.2 µs … 121.9 µs)  22.6 µs  30.0 µs  51.8 µs

Example of new output (with this change):

$deno bench
Check file:///Users/boyeln/Develepment/github/simple-parser/parser_bench.ts
    CPU | Apple M1 Pro
Runtime | Deno 2.3.3 (aarch64-apple-darwin)

file:///Users/boyeln/Develepment/github/simple-parser/parser_bench.ts

| benchmark   | time/iter (avg) |        iter/s |      (min … max)      |      p75 |      p99 |     p995 |
| ----------- | --------------- | ------------- | --------------------- | -------- | -------- | -------- |
| parse       |         22.6 µs |        44,300 | ( 20.9 µs … 117.3 µs) |  22.5 µs |  34.6 µs |  56.6 µs |

Related #29533
Closes #29466

@CLAassistant
Copy link

CLAassistant commented May 30, 2025

CLA assistant check
All committers have signed the CLA.

@boyeln boyeln marked this pull request as draft May 30, 2025 11:38
@boyeln boyeln marked this pull request as ready for review May 30, 2025 14:33
@bartlomieju bartlomieju added this to the 2.4.0 milestone May 30, 2025
bartlomieju pushed a commit that referenced this pull request Jun 24, 2025
This changes the format of the table outputted by `deno coverage` to be
markdown compatible.

Related #29532 
Closes #29465
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@bartlomieju bartlomieju merged commit ef6ff55 into denoland:main Jun 24, 2025
18 checks passed
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.

Option for deno bench to output markdown table
3 participants