1 comments

  • vdavid 2 hours ago
    I built a pure-Rust MTP/PTP library with no C dependencies. It talks to Android phones, Kindles, and cameras over USB.

    (Quick refresher: MTP is the protocol your phone uses when you plug it into a computer to copy files.)

    I benchmarked it against libmtp on a Pixel 9 Pro XL. Downloads are 1.06–4.04x faster, and way more consistent. At 100 MB, mtp-rs std dev was 4.7 ms. libmtp was 4,612 ms. That's not a typo, it's actually 1000x more consistent.

    I thought MTP was slow. Now it seems only libmtp is slow. libmtp has been pretty much the only option for ~20 years, and it supports tons of legacy devices, but that overhead adds up.

    Built on nusb, fully async, no unsafe. Tested on Pixel 9 Pro XL, Samsung Galaxy S23 Ultra, and a Fujifilm X-T4. I need help testing with more devices.

    Full writeup with benchmarks: https://www.veszelovszki.com/a/mtp-rs/?r=h

    (Why: for Cmdr, a file manager I'm working on, but the library is standalone and MIT OR Apache-2.0-licensed.)