Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Table format in README shows older tinybench output #187

Closed
cmdcolin opened this issue Nov 13, 2024 · 2 comments
Closed

Table format in README shows older tinybench output #187

cmdcolin opened this issue Nov 13, 2024 · 2 comments

Comments

@cmdcolin
Copy link

In the readme it says the output of the sample benchmark is:


// Output:
// simple benchmark
// ┌─────────┬───────────────┬────────────────────────────┬───────────────────────────┬──────────────────────┬─────────────────────┬─────────┐
// │ (index) │ Task name     │ Throughput average (ops/s) │ Throughput median (ops/s) │ Latency average (ns) │ Latency median (ns) │ Samples │
// ├─────────┼───────────────┼────────────────────────────┼───────────────────────────┼──────────────────────┼─────────────────────┼─────────┤
// │ 0       │ 'faster task' │ '102906 ± 0.89%'           │ '82217 ± 14'              │ '11909.14 ± 3.95%'   │ '12163.00 ± 2.00'   │ 8398    │
// │ 1       │ 'slower task' │ '988 ± 26.26%'             │ '710'                     │ '1379560.47 ± 6.72%' │ '1408552.00'        │ 73      │
// └─────────┴───────────────┴────────────────────────────┴───────────────────────────┴──────────────────────┴─────────────────────┴─────────┘


I observed it to be

simple benchmark
┌─────────┬──────────────────────┬─────────────────────┬─────────┬───────────────┬────────────────────────────┬───────────────────────────┐
│ (index) │ Latency average (ns) │ Latency median (ns) │ Samples │ Task name     │ Throughput average (ops/s) │ Throughput median (ops/s) │
├─────────┼──────────────────────┼─────────────────────┼─────────┼───────────────┼────────────────────────────┼───────────────────────────┤
│ 0       │ '5593.87 ± 1.08%'    │ '4287.00'           │ 17877   │ 'faster task' │ '208688 ± 0.37%'           │ '233263'                  │
│ 1       │ '1155352.31 ± 2.81%' │ '1163806.00'        │ 87      │ 'slower task' │ '1161 ± 51.08%'            │ '859'                     │
└─────────┴──────────────────────┴─────────────────────┴─────────┴───────────────┴────────────────────────────┴───────────────────────────┘

I think the reason is that the table format changed in tinybench v3

this is probably a matter of taste but I personally kinda like seeing task name more towards the left, and don't even care much about index :)

@jerome-benoit
Copy link
Collaborator

jerome-benoit commented Nov 13, 2024

The default .table() output of all examples is correctly ordered with node.js LTS and bun latest here on OS X and GNU/Linux.

@cmdcolin
Copy link
Author

my output is different from what is in the readme (task names in middle of table instead of on left). I am using tinybench 3

-❯❯❯ yarn bench
yarn run v1.22.22
$ tsx bench.ts
10000 letters
┌─────────┬──────────────────────┬─────────────────────┬─────────┬───────────┬────────────────────────────┬───────────────────────────┐
│ (index) │ Latency average (ns) │ Latency median (ns) │ Samples │ Task name │ Throughput average (ops/s) │ Throughput median (ops/s) │
├─────────┼──────────────────────┼─────────────────────┼─────────┼───────────┼────────────────────────────┼───────────────────────────┤
│ 0       │ '973547.71 ± 0.63%'  │ '941942.50 ± 2.50'  │ 1028    │ 'revcom1' │ '1036 ± 0.48%'             │ '1062'                    │
│ 1       │ '727983.44 ± 0.45%'  │ '705121.00 ± 16.00' │ 1374    │ 'revcom2' │ '1382 ± 0.37%'             │ '1418'                    │
│ 2       │ '634482.39 ± 0.38%'  │ '618135.00'         │ 1577    │ 'revcom3' │ '1584 ± 0.31%'             │ '1618'                    │
│ 3       │ '464227.57 ± 0.67%'  │ '439891.00'         │ 2155    │ 'revcom4' │ '2191 ± 0.46%'             │ '2273'                    │
└─────────┴──────────────────────┴─────────────────────┴─────────┴───────────┴────────────────────────────┴───────────────────────────┘
Done in 10.32s.
-❯❯❯ node --version
v22.11.0
-❯❯❯ y why tinybench
yarn why v1.22.22
[1/4] Why do we have the module "tinybench"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "tinybench@3.0.4"
info Has been hoisted to "tinybench"
info This module exists because it's specified in "dependencies".
info Disk size without dependencies: "148KB"
info Disk size with unique dependencies: "148KB"
info Disk size with transitive dependencies: "148KB"
info Number of shared dependencies: 0
Done in 0.05s.

ubuntu 24.10. have not tried bun though

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants