SD readers/Speed, measured/07. How fast it goes
Speed, measured · 07 of 11

How fast it goes

Three modes, two boards, one card, five verified rounds each. SPI sustained 1.4 MB/s writing; 4-bit mode sustained 2.7. The interesting number is not the biggest one — it is the gap between the sustained figure and the sprint.

What the bench measured

Measured, on one card, one bench
microSD
Board
Slowest sustained
1.39 MB/s
Fastest sustained
3.80 MB/s
4-bit over SPI
2.4×
Moving from SPI to 4-bit mode bought 2.4× the sustained read on this board and cost two wires. Writing gained less — 1.9× — because a card’s own flash, not the bus, is what limits a write. Every round’s read-back was checksummed and every round matched.

One ESP32-S3, one card, jumper wires on a breadboard. Each row is five rounds of a large file — around 100 MB in SPI and 1-bit, 64 MB in 4-bit — with every round's read-back checksummed against what was written. Every round passed on both boards in all three modes.

ModeClockWriteReadSprint read
SPI24 MHz1.391.561.64
SD_MMC 1-bit40 MHz2.162.672.91
SD_MMC 4-bit40 MHz2.633.805.04

MB/s, on the microSD board. The full-size board matched it to within a hundredth in SPI and 1-bit mode; its 4-bit row is lower, and four wires, one clock is why.

Read the two read columns

The sprint figure is nearly a third higher than the sustained one in 4-bit mode, and that gap is the honest part of this table. It is the same card and the same wires; the difference is that the sprint does nothing but move bytes, while the sustained figure includes verifying every one of them.

A real sketch is closer to the sustained column, and usually below it, because a real sketch is also doing whatever made it want to write a file.

Writing barely moves

Going from SPI to 4-bit bought 2.4× the read speed and 1.9× the write speed. The reason is inside the card: flash has to be erased before it can be written, and the card's controller does that between the blocks you send it. Widening the bus does not make that step any shorter.

This is also why the advice about buffering matters more than the advice about modes. Writing 30 bytes at a time makes every one of these numbers irrelevant.

So which mode

If you are logging a line a second, use SPI. Four wires, any pins, any microcontroller — and a thirty-byte row once a second is 30 B/s, which 1.4 MB/s covers tens of thousands of times over.

If you are recording audio, writing camera frames or reading a file back to serve it over Wi-Fi, the two extra wires are worth having. Everything after this page is about getting them right.

When it does not work

My card is much slower than these numbers

Check three things in order: the SPI clock your sketch asked for, whether you are opening and closing the file per write, and whether the card is nearly full. The bench ran SPI at 24 MHz with a 32 kB buffer on a card with room on it, and each of those three can cost you more than the choice of mode does.

Will a faster card make this faster?

No. A class-10 card is rated for 10 MB/s and the fastest thing measured here was 5.04 MB/s, so the bus and the microcontroller are the limit, not the card. Buying a UHS-II card for an ESP32 buys nothing.

Writing is slower than reading in every row. Why?

Because a flash cell has to be erased before it is written, and the card's own controller does that work between the blocks you send. Reading has no equivalent step. That gap is the card's, not the bus's, which is why widening the bus to four lines helped reading more than writing.

What is the difference between the sustained and sprint figures?

The sustained figure is five rounds of a large file with every round's read-back checksummed against what went in. The sprint is the best block size a scan could find, 32 MB at a time, with no verification and nothing else happening. Sustained is what a logger sees; sprint is what a specification would print.

Where this goes next

Why four data lines carry a byte in a quarter of the clock ticks and do not go four times as fast.

Four wires, one clock

Edit this page — content/books/sd/how-fast-it-goes.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

This page covers several products. Choose yours to see the right discussions.

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum