Download Latest Version mitata december holidays update source code.tar.gz (1.4 MB)
Email in envelope

Get an email when there's a new version of Mitata

Home / v1.0.14
Name Modified Size InfoDownloads / Week
Parent folder
mitata november update source code.tar.gz 2024-11-20 26.2 kB
mitata november update source code.zip 2024-11-20 33.8 kB
README.md 2024-11-20 3.4 kB
Totals: 3 Items   63.3 kB 0

πŸ› οΈ Changes

groups can have names

:::js
group(name, () => {
  ...
});

β€’ math
-------------------------------------------
1 + 1                         87.43 ps/iter
                       (51.03 ps … 9.83 ns)

charts/visualizations can be nested and combined

:::js
summary(() => {
  barplot(() => {
    bench(...);
  });

  barplot(() => { ... });
});

------------------------------------------- -------------------------------
1 + 1                        105.54 ps/iter  91.55 ps        β–ˆ  β–ˆ           !
                       (61.04 ps … 1.83 Β΅s) 122.07 ps β–β–β–β–β–β–β–β–ˆβ–β–β–ˆβ–β–β–β–β–β–β–„β–β–β–‚
Date.now()                    39.61 ns/iter  28.01 ns β–ˆ                    
                       (27.83 ns … 3.19 Β΅s) 153.12 ns β–ˆβ–β–ƒβ–β–β–β–β–β–β–β–β–β–β–β–β–β–β–β–β–β–

                             β”Œ                                            ┐
                       1 + 1 ─ 105.54 ps
                  Date.now() ─■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 39.61 ns
                             β””                                            β”˜

summary
  1 + 1
   375.26x faster than Date.now()

------------------------------------------- -------------------------------
2 + 2                        117.75 ps/iter  91.55 ps         β–ˆ   β–„         !
                       (61.04 ps … 3.69 Β΅s) 112.06 ps β–β–β–β–β–β–β–β–β–ˆβ–β–β–β–ˆβ–β–β–β–β–β–β–β–
3 + 3                        126.97 ps/iter  91.55 ps        β–ˆ  β–ˆ           !
                       (61.04 ps … 4.23 Β΅s) 122.07 ps β–β–β–β–β–β–β–β–ˆβ–β–β–ˆβ–β–β–β–β–β–β–„β–β–β–‚

                             β”Œ                                            ┐
                       2 + 2 ─ 117.75 ps
                       3 + 3 ─■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 126.97 ps
                             β””                                            β”˜

summary
  2 + 2
   1.08x faster than 3 + 3

other notable changes

  • support for detecting webcontainers
  • benchmark names now have 28 chars of space
  • optimized amount of ansi codes outputted in some charts

πŸš€ New Features

benchmark names can be highlighted

:::js
bench(...).highlight('red');

image

markdown table format

:::js
await run({ format: 'markdown' });

clk: ~3.17 GHz cpu: Apple M2 Pro runtime: bun 1.1.26 (arm64-darwin)

benchmark avg min p75 p99 max
1 + 1 90.69 ps/iter 61.04 ps 91.55 ps 122.07 ps 309.74 ns
Date.now() 28.70 ns/iter 26.70 ns 28.01 ns 43.35 ns 413.05 ns

option to fine tune garbage collection behavior

:::js
// runs gc before each iteration 
bench(...).gc('inner');
Source: README.md, updated 2024-11-20