MK Michael Kennedy Michael Kennedy Python developer, PSF Fellow and founder of Talk Python Training, which offers courses for Python developers.

“What happens if I take that same awesome disk cache, the original, and I use it in a multi-threaded situation? It goes from 400,000 requests a second to 19,000. It's 20 times slower if I try to use it in a free-threaded way. … It was built for a different time.”

Python Bytes · Hands-On Engineering Podcasts · November 2026

“What happens if I take that same awesome disk cache, the original, and I use it in a multi-threaded situation? It goes from 400,000 requests a second to 19,000. It's 20 times slower if I try to use it in a free-threaded way. … It was built for a different time.” — Michael Kennedy, Python Bytes

Context

Calvin asked whether the existing diskcache library was good enough and whether a rebuild was needed. Michael answers with his own benchmark of the original library under free-threaded Python, which is why he wrote a Rust-backed version.

Transcript

Python Bytes Around 21:36 into the episode
Michael Kennedy

…On a single SQLite file with one thread, just straight Gil Python, nothing fancy yet. It does in a 99 to 1 read-write ratio. So 99 reads, one write. That's pretty cache standard. There's also a graph for a thousand reads and one write. It does 670,000 reads and writes a second. A second. Okay.

Calvin Hendryx-Parker

Michael, isn't it just good enough? Do we need this?

Michael Kennedy

Yes, we do because the previous one was also very impressive. Like I do not take away my positive comments about regular disk cache. But if, and here, remember the free-threaded mission, this is my mission. What happens if I take that same awesome disk cache, not mine, the original, and I use it in a multi-threaded situation? It goes from 400,000 requests a second to 19,000. It's 20 times slower if I try to use it in a free-threaded way. Yeah. Broken as that. It's no good. And it's just, it was built for a different time, right? And I would be totally content if I think the guy's name is Greg. Greg behind it would like go, yeah, we're totally going to ramp this thing up. But he got hired at OpenAI and then like the next day, like responses on GitHub. Like there was just, maybe it's a corporate thing. I don't know. He's just like not allowed to even reply, but done. So I went through and I said, I want to take a similar API, not identical, but almost the same. And I want to build this free-threaded, multi-threaded, rust-based version of this.…

Calvin Hendryx-Parker

you're ready to deploy onto PyZero now.

Michael Kennedy

Yes. Yeah. 100%. So you give it just SQLite file and it can be durable or not. So the serialization for disk cache, and a lot of these caches, I think I saw it in the other one is pickle. That's just wrong to me. Like it's a security violation. You hear this a lot with Hugging Face and those types…

Calvin Hendryx-Parker

That's pretty incredible. Yeah. And this is modern now.

Speaker names come from our own diarization. The position is estimated from where the line sits in the episode.

More from Python Bytes