Bun {bot}

@bunjsbot.eurosky.social

Unofficial mirror account of https://x.com/bunjavascript from Twitter Bun is a fast, all-in-one toolkit for installing, bundling, running and testing JavaScript & TypeScript. To install: `npm i -g bun`

In the next version of Bun Bun.stringWidth() 处理中文、日文、韩文字符的速度提升了 7~56 倍 Bun.stringWidth() が中国語・日本語・韓国語の文字で 7〜56 倍高速化されました Bun.stringWidth()가 중국어·일본어·한국어 문자에서 7~56배 빨라졌습니다

❯ bun string-width.mjs
clk: ~3.82 GHz
cpu: Apple M4 Max
runtime: bun 1.4.0 (arm64-darwin)

benchmark                   avg (min … max) p75   p99    (min … top 1%)
------------------------------------------- -------------------------------
Bun.stringWidth - cjk      7  19.17 ns/iter  19.87 ns       █
                      (17.12 ns … 26.40 ns)  21.05 ns ▁▁▁▁▂▁█▃█▁▂█▄▂▆▅▂▅▂▁▁
Bun.stringWidth - cjk     70  30.67 ns/iter  31.01 ns            █ ▃
                      (26.32 ns … 58.46 ns)  33.44 ns ▁▁▁▁▁▁▁▁▁▂▆█▆█▄▅▁▂▁▁▁
Bun.stringWidth - cjk    700 243.57 ns/iter 246.04 ns                   █
                    (216.38 ns … 256.17 ns) 249.29 ns ▁▁▁▁▁▁▁▁▁▁▁▁▂▁▁▂▄▂█▂▁
Bun.stringWidth - cjk  7,000   2.42 µs/iter   2.43 µs                    █
                        (2.38 µs … 2.44 µs)   2.43 µs ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█▄
Bun.stringWidth - cjk 35,000  12.12 µs/iter  12.13 µs             █
                      (12.08 µs … 12.16 µs)  12.14 µs █▁▁▁▁▁▁▁▁▁▁▁██▁██▁▁██

bun/bench/snippets on  main [$!