MCPcopy Index your code
hub / github.com/Xuanwo/when-i-find-rust-is-slow

github.com/Xuanwo/when-i-find-rust-is-slow @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
6 symbols 11 edges 8 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

When I find rust is slow

It's crazy, I found a case where Rust is slower than Python! But, really?

Setup

Reproduce the same result requires:

  • Rust Development Tools (cargo, rustc, ..)
  • Python Development Tools (python3, venv)
  • hyperfine (benchmark runner)
  • CPU (one of AMD Ryzen 9 5950X, AMD R7 5700X, AMD Ryzen 9 5900X)

Quick Start

./bench python-fs-read rust-std-fs-read

For example:

:) `./bench python-fs-read rust-std-fs-read`
    Finished release [optimized] target(s) in 0.00s
Benchmark 1: python-fs-read/test.py
  Time (mean ± σ):      22.6 ms ±   1.5 ms    [User: 8.0 ms, System: 14.4 ms]
  Range (min … max):    21.1 ms …  30.1 ms    115 runs

Benchmark 2: rust-std-fs-read/target/release/test
  Time (mean ± σ):      26.2 ms ±   1.4 ms    [User: 0.3 ms, System: 26.1 ms]
  Range (min … max):    25.4 ms …  36.2 ms    107 runs

If python has lower System time than rust, you reproduce the same result.

Core symbols most depended-on inside this repo

Shape

Function 6

Languages

Rust50%
C33%
Python17%

Modules by API surface

scripts/read-latency.py1 symbols
rust-std-fs-read/src/main.rs1 symbols
rust-std-fs-read-with-jemalloc/src/main.rs1 symbols
rust-opendal-fs-read/src/main.rs1 symbols
c-fs-read/test.c1 symbols
c-fs-read-with-offset/test.c1 symbols

For agents

$ claude mcp add when-i-find-rust-is-slow \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page