npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@wasm-lang-test/rust

v0.1.19

Published

Rust WASM benchmark module

Downloads

508

Readme

wasm-lang-test

🚀 对比 C++、Go、Rust、Dart、Kotlin 五种语言在 WebAssembly 中的性能表现。

📊 语言分布

Language Distribution

这张 SVG 现在由本地 python bump.py <version> 自动更新,不再由 GitHub Actions 回写仓库。

快速开始

方式 1:使用已发布的 npm 包(推荐)

# 克隆项目
git clone https://github.com/VincentZyu233/wasm-lang-test.git
cd wasm-lang-test
# 安装依赖(包括已发布的 wasm 模块)
npm install
# 启动开发服务器
npm run dev

访问 http://localhost:60531 查看性能测试页面。

方式 2:本地编译 wasm 模块

如果要修改 wasm 模块代码,需要本地编译:

前置要求

  • Rust: rustup + wasm-pack
  • Go: Go 1.21+
  • C++: Emscripten

编译步骤

# 编译所有 wasm 模块
npm run build:wasm
# 或单独编译
cd packages/wasm-lang-test-rust && wasm-pack build --target bundler --release
cd packages/wasm-lang-test-go && GOOS=js GOARCH=wasm go build -o wasm_exec.wasm ./cmd/main.go
cd packages/wasm-lang-test-cpp && emcc src/main.cpp -o main.js -s WASM=1 -O3

启动 UI

npm run dev

项目结构

wasm-lang-test/
├── packages/
│   ├── wasm-lang-test-cpp/        # C++ WASM 模块
│   ├── wasm-lang-test-go/         # Go WASM 模块
│   └── wasm-lang-test-rust/       # Rust WASM 模块
├── ui/                            # Web UI(性能测试页面)
│   ├── index.html
│   ├── style.css
│   ├── main.js
│   └── package.json
├── .github/workflows/
│   └── build.yml                  # CI/CD 流程
└── docs/
    ├── build.md                   # 构建文档
    └── dev/20260530.cpp-go-rust.plan.md

四个测试题目

| 测试 | 特性 | 输入 | 指标 | |------|------|------|------| | 斐波那契 | 递归密集 | fib(35) | 执行时间 | | 快速排序 | 内存操作 | 100,000 个数 | 排序时间 | | 矩阵乘法 | 计算密集 | 512×512 矩阵 | 乘法时间 | | 字符串处理 | 文本处理 | 单词频率统计 | 处理时间 |

发布流程

自动发布(GitHub Actions)

提交包含关键词的 commit:

# 先 bump 版本,并自动更新 docs/lang-stats.svg
python bump.py 0.1.8
# 仅编译
git commit -m "feat: xxx build action"
# 编译 + 发布到 npm
git commit -m "feat: xxx build publish"
git push origin main

手动发布

详见 docs/build.md

npm 包

  • npm @wasm-lang-test/rust — Rust 实现
  • npm @wasm-lang-test/go — Go 实现
  • npm @wasm-lang-test/cpp — C++ 实现
  • npm @wasm-lang-test/dart — Dart 实现
  • npm @wasm-lang-test/kotlin — Kotlin 实现

文档