Sign in

Maxim Sakhno

@maxim-sakhno.bsky.social
55 followers 79 following 72 posts

Senior Python Developer & Systems Research enthusiast. Deconstructing libraries to reveal the architecture behind the magic. I read the source code so you don’t have to.

PostsRepliesMedia
Maxim Sakhno @maxim-sakhno.bsky.social · 29/07/2026
I spoke at #PyCon Russia for the second time, and I won Best Speaker again 🏆 Very happy about this! My talk was about making a typical app much faster — many more requests per second. I will post the video link when it is online. #Python
110
Maxim Sakhno @maxim-sakhno.bsky.social · 03/03/2026
Settled on AMD Ryzen AI Max+ 395 128GB for its price/performance balance, but will wait for builds from trusted manufacturers — don't want to deal with teething issues of first-wave mini PCs on this chip. #AI #LLM
130
Maxim Sakhno @maxim-sakhno.bsky.social · 27/02/2026
Can't stop thinking about running LLMs locally. Tried it on my AMD Ryzen 7 8845H + Radeon 780M 32GB — not enough for serious models. Now eyeing a MacBook, NVIDIA DGX Spark, or AMD Ryzen AI Max+ 395 128GB (my favorite so far). #AI #LLM
220
Maxim Sakhno @maxim-sakhno.bsky.social · 17/02/2026
Investigated why our lightly-loaded #FastAPI service needed 10 replicas. Optimized from 80 to 9000 RPS locally 🚀 The culprits? - Sentry SDK caused 3.5x slowdown - Sync dependencies (simple functions, no IO) caused 30x slowdown 😱 Still can't believe the numbers are real! #Python
040
Maxim Sakhno @maxim-sakhno.bsky.social · 12/02/2026
Testing #FastAPI vs #LiteStar with nested empty deps (0-5 levels). Both show smooth perf degradation, unlike LiteStar's flat deps with TaskGroup. Still, 5 deps = 28% drop for LiteStar — DI overhead is significant even when deps do nothing. #Python
A bar chart comparing the performance of LiteStar (orange bars) and FastAPI (green bars) in Requests Per Second (RPS) as the number of dependencies ('Num Deps') increases from 0 to 5. The data shows that LiteStar consistently maintains a higher throughput than FastAPI across all dependency counts. For example, at 0 dependencies, LiteStar reaches 45573 RPS versus FastAPI's 37004 RPS. At 5 dependencies, LiteStar holds 32877 RPS while FastAPI drops to 26463 RPS.
042
Maxim Sakhno @maxim-sakhno.bsky.social · 10/02/2026
Quick perf test: changed #LiteStar dependency resolution from TaskGroup to await. RPS impact? Minimal vs 17% degradation with TaskGroup at 4 deps. Each request does 4 DB calls. TaskGroup overhead matters more than expected. More details in thread 👇 #Python #Backend
A bar chart comparing performance in Requests Per Second (RPS) between 'TaskGroup' (purple bars) and 'Await' (orange bars) based on the number of dependencies ('Num Deps'). For 1 dependency, TaskGroup achieves 4604 RPS and Await achieves 4628 RPS. For 2 dependencies, TaskGroup is at 4085 RPS while Await is at 4558 RPS. For 4 dependencies, TaskGroup drops to 3817 RPS, whereas Await maintains 4529 RPS, showing that Await scales better as dependency count increases.
242
Maxim Sakhno @maxim-sakhno.bsky.social · 06/02/2026
My #PyCon RU 2025 talk (Best Speaker award! 🏆) is now on YouTube: youtu.be/MpQgrhLO6aE English subtitles available! 🇬🇧 I break down the Dependency Inversion Principle, compare popular #Python #DI frameworks, and show why they matter for building better applications.
youtu.be
Как в Python применяется инверсия зависимостей. Максим Сахно, Контур
YouTube video by Видео с мероприятий {speach!
142
Maxim Sakhno @maxim-sakhno.bsky.social · 03/02/2026
In the previous thread, Litestar's RPS dropped 36% with 2+ flat dependencies due to TaskGroup overhead. 📉 How do #Litestar and #FastAPI perform with real DB queries in dependencies? Let's figure it out in this thread 🧵 #Python
A bar chart titled 'LiteStar' showing performance in Requests Per Second (RPS) relative to the number of dependencies (Num Deps). A purple bar indicates that with 1 dependency, the RPS is 4604. For 2 and 4 dependencies, the bars are missing and replaced with red question marks, indicating unknown or pending data.
191
Maxim Sakhno @maxim-sakhno.bsky.social · 29/01/2026
Summarized my findings and opened an issue. Hoping to help make #LiteStar just a little bit better. github.com/litestar-org... #Python #Backend #WebDev
github.com
Enhancement: Optimize dependency resolution overhead (TaskGroup bottleneck) · Issue #4563 · litestar-org/litestar
Summary Benchmarks show a significant performance degradation in dependency resolution when increasing the number of flat dependencies. Specifically, moving from 1 to 2 dependencies results in a sh...
040
Maxim Sakhno @maxim-sakhno.bsky.social · 28/01/2026
Is #LiteStar faster than #FastAPI? Benchmarks say yes, but look at Dependency Injection. 📉 Adding just 2 flat dependencies significantly degrades the throughput. I dug into the source to find why. Thread: TaskGroups, Kahn's algorithm & performance trade-offs. 🧵 #Python #Backend #WebDev
A bar chart titled "LiteStar" showing Request Per Second (RPS) performance across different numbers of dependencies (0 to 5). The RPS drops from 41,451 with 1 dependency to 26,492 with 2 dependencies. A red arrow points to this 36% decrease with a handwritten caption asking "Why?".
362
Maxim Sakhno @maxim-sakhno.bsky.social · 19/01/2026
Hi! I’m Maxim Sakhno. Moving from Non-being to Being. Senior Python Dev | 10+ years of exp. Sharing what’s hidden under the hood: 🔬Internals of FastAPI, SQLA & more ⚡️ Real-world benchmarks 📊 Framework & source code analysis Diving deeper than the docs. 🐍✨ #Python #IAmNewHere
190